Kaynağa Gözat

发票导出调整(重新划页面)

[user3] 3 yıl önce
ebeveyn
işleme
4392cfa920
19 değiştirilmiş dosya ile 12183 ekleme ve 1 silme
  1. 3 0
      src/main/java/com/jeeplus/modules/workinvoice/dao/WorkInvoiceDao.java
  2. 640 0
      src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoiceExport.java
  3. 18 0
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java
  4. 19 1
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java
  5. 33 0
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllController.java
  6. 1331 0
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllTwoController.java
  7. 1367 0
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java
  8. 407 0
      src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml
  9. 677 0
      src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceAllTwoForm.jsp
  10. 672 0
      src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceAllTwoModify.jsp
  11. 665 0
      src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceTwoForm.jsp
  12. 672 0
      src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceTwoModify.jsp
  13. 895 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoForm.jsp
  14. 892 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoList.jsp
  15. 590 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoModify.jsp
  16. 590 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoReceiptForm.jsp
  17. 895 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoForm.jsp
  18. 894 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoList.jsp
  19. 923 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoModify.jsp

+ 3 - 0
src/main/java/com/jeeplus/modules/workinvoice/dao/WorkInvoiceDao.java

@@ -78,4 +78,7 @@ public interface WorkInvoiceDao extends CrudDao<WorkInvoice> {
 	 */
 	List<WorkInvoice> findListOnExport(WorkInvoice workInvoice);
 
+	List<WorkInvoice> findMapList(WorkInvoice workInvoice);
+	Integer queryMapCount(WorkInvoice workInvoice);
+
 }

+ 640 - 0
src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoiceExport.java

@@ -0,0 +1,640 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.workinvoice.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.google.common.collect.Lists;
+import com.jeeplus.common.persistence.ActEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.sys.entity.Area;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workinvoicedetail.entity.WorkInvoiceDetail;
+import org.activiti.engine.history.HistoricProcessInstance;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 开票管理Entity
+ * @author
+ * @version
+ */
+public class WorkInvoiceExport extends ActEntity<WorkInvoiceExport> {
+
+    public static final String SERIAL_BIZCODE = "3";//编号模板类型
+
+	private static final long serialVersionUID = 1L;
+	private String number;		// 发票申请编号
+	private String processInstanceId; // 流程实例编号
+	private WorkClientInfo client;		// 实际开票单位
+	private ProjectRecords project;		// 开票项目(来源项目登记)
+	private String projectName;		// 项目名称
+	private String reportNumber;		// 报告号
+	private Double money;		// 价税合计
+	private String moneyStr;		// 价税合计(String)
+	private String invoiceType;		// 发票类型
+	private String invoiceTypeStr;		// 发票类型Str
+	private String chargeType;		// 收款类型
+	private String billingContent;		// 开票内容
+	private String content;		// 开票内容要求
+	private User drawer;		// 开票经办人(暂时弃用)
+	private Office office;		// 所属部门
+	private Integer invoiceNumber;		// 发票编号(暂时弃用)
+	private Date invoiceDate;		// 开票日期
+	private Date takeDate;          //领票日期
+	private String drawerName;      //开票人(发票管理员名称)
+	private String invoiceRemarks;		// 开票备注
+	private String isInvoice;		// 是否开票
+	private String isCharge;		// 是否收款
+	private String isInvalid;		// 是否作废
+	private String invoiceState;    //发票状态
+	private String orUnicode;       //纳税人识别号
+	private String address;         //地址
+	private String telephone;        //电话
+	private String bank;              //开户银行
+	private String bankNumber;        //银行账号
+	private String cancleReason; //作废原因
+	private String companyId; //提交人的公司编号
+	private String officeId;
+	private String officeName;
+	private String submitterId;		// 发票登记人id
+	private String submitterName;		// 发票登记人名称
+	private String ext;//1总公司-上级公司0分公司-本公司
+	private String contractDate;
+	private String province; //省份
+	private String home;
+	private Date beginContractDate;		// 开始
+	private Date endContractDate;		// 结束
+	private Date receiptMoneyDate;		// 收款日期
+	private String receiptMoney;		// 是否收款
+	private String cancellation;		// 作废判断
+	private String adminFlag;		// 管理员判断
+	private String cancellationRemark;		// 作废原因
+	private List<WorkInvoiceDetail> workAccountList = Lists.newArrayList();//发票明细
+	private List<WorkInvoiceReceipt> workReceiptList;//收款明细
+	private List<WorkInvoiceProjectRelation> workInvoiceProjectRelationList;//开票和项目关系表
+	private Integer notifyFlag; //代办判定条件
+	private String notifyId; //代办判定条件
+	private String widNumber; //发票号
+	private String widTotalMoney; //发票金额
+	private Area area = new Area();		// 对账地区
+
+
+	private String accountCheckingUserId; //对账人id
+	private String accountCheckingUserName; //对账人名称
+	private List<Workattachment> workAttachments;//附件
+
+
+	@Override
+	@ExcelField(title="经办人", fieldType=User.class, value="createBy.name", align=2, sort=5)
+	public User getCreateBy() {
+		return createBy;
+	}
+
+	@Override
+	public void setCreateBy(User createBy) {
+		this.createBy = createBy;
+	}
+
+	public String getOfficeId() {
+		return officeId;
+	}
+
+	public void setOfficeId(String officeId) {
+		this.officeId = officeId;
+	}
+
+	public String getCompanyId() {
+		return companyId;
+	}
+
+	public void setCompanyId(String companyId) {
+		this.companyId = companyId;
+	}
+
+	public String getCancleReason() {
+		return cancleReason;
+	}
+
+	public void setCancleReason(String cancleReason) {
+		this.cancleReason = cancleReason;
+	}
+
+	public String getBank() {
+		return bank;
+	}
+
+	public void setBank(String bank) {
+		this.bank = bank;
+	}
+
+	public String getBankNumber() {
+		return bankNumber;
+	}
+
+	public void setBankNumber(String bankNumber) {
+		this.bankNumber = bankNumber;
+	}
+
+	@ExcelField(title="发票状态", align=2, sort=11)
+	public String getInvoiceState() {
+		return invoiceState;
+	}
+
+	public void setInvoiceState(String invoiceState) {
+		this.invoiceState = invoiceState;
+	}
+	// 流程任务
+	private Task task;
+	private Map<String, Object> variables;
+	// 运行中的流程实例
+	private ProcessInstance processInstance;
+	// 历史的流程实例
+	private HistoricProcessInstance historicProcessInstance;
+	// 流程定义
+	private ProcessDefinition processDefinition;
+
+	public Date getTakeDate() {
+		return takeDate;
+	}
+
+	public String getHome() {
+		return home;
+	}
+
+	public Date getBeginContractDate() {
+		return beginContractDate;
+	}
+
+	public void setBeginContractDate(Date beginContractDate) {
+		this.beginContractDate = beginContractDate;
+	}
+
+	public Date getEndContractDate() {
+		return endContractDate;
+	}
+
+	public void setEndContractDate(Date endContractDate) {
+		this.endContractDate = endContractDate;
+	}
+
+	public void setHome(String home) {
+		this.home = home;
+	}
+
+	public void setTakeDate(Date takeDate) {
+		this.takeDate = takeDate;
+	}
+
+
+	public String getDrawerName() {
+		return drawerName;
+	}
+
+	public void setDrawerName(String drawerName) {
+		this.drawerName = drawerName;
+	}
+
+	public WorkInvoiceExport() {
+		super();
+	}
+
+	public WorkInvoiceExport(String id){
+		super(id);
+	}
+
+	@ExcelField(title="开票号", align=2, sort=1)
+	public String getNumber() {
+		return number;
+	}
+
+	public String getContractDate() {
+		return contractDate;
+	}
+
+	public void setContractDate(String contractDate) {
+		this.contractDate = contractDate;
+	}
+
+	public void setNumber(String number) {
+		this.number = number;
+	}
+
+	@ExcelField(title="开票单位", fieldType=WorkClientInfo.class, value="client.name",align=2, sort=4)
+	public WorkClientInfo getClient() {
+		return client;
+	}
+
+	public void setClient(WorkClientInfo client) {
+		this.client = client;
+	}
+
+	@ExcelField(title="项目名称",align=2, sort=2)
+	public String getProjectName() {
+		return projectName;
+	}
+
+	public ProjectRecords getProject() {
+		return project;
+	}
+
+	public List<WorkInvoiceDetail> getWorkAccountList() {
+		return workAccountList;
+	}
+
+	public String getProvince() {
+		return province;
+	}
+
+	public void setProvince(String province) {
+		this.province = province;
+	}
+
+	public void setWorkAccountList(List<WorkInvoiceDetail> workAccountList) {
+		this.workAccountList = workAccountList;
+	}
+
+	public String getOrUnicode() {
+		return orUnicode;
+	}
+
+	public void setOrUnicode(String orUnicode) {
+		this.orUnicode = orUnicode;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
+	public String getTelephone() {
+		return telephone;
+	}
+
+	public void setTelephone(String telephone) {
+		this.telephone = telephone;
+	}
+
+	public void setProject(ProjectRecords project) {
+		this.project = project;
+	}
+
+	public void setProjectName(String projectName) {
+		this.projectName = projectName;
+	}
+
+	@ExcelField(title="开票金额", align=2, sort=7)
+	public Double getMoney() {
+		return money;
+	}
+
+	public void setMoney(Double money) {
+		this.money = money;
+	}
+
+	public String getMoneyStr() {
+		return moneyStr;
+	}
+
+	public void setMoneyStr(String moneyStr) {
+		this.moneyStr = moneyStr;
+	}
+
+	public String getInvoiceType() {
+		return invoiceType;
+	}
+
+	public void setInvoiceType(String invoiceType) {
+		this.invoiceType = invoiceType;
+	}
+	@ExcelField(title="发票类型",dictType="invoice_type", align=2, sort=8)
+	public String getChargeType() {
+		return chargeType;
+	}
+
+	public void setChargeType(String chargeType) {
+		this.chargeType = chargeType;
+	}
+
+
+	public String getContent() {
+		return content;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+
+	public User getDrawer() {
+		return drawer;
+	}
+
+	public void setDrawer(User drawer) {
+		this.drawer = drawer;
+	}
+
+	@ExcelField(title="经办人部门", fieldType=Office.class, value="office.name", align=2, sort=6)
+	public Office getOffice() {
+		return office;
+	}
+
+	public void setOffice(Office office) {
+		this.office = office;
+	}
+
+
+	public Integer getInvoiceNumber() {
+		return invoiceNumber;
+	}
+
+	public void setInvoiceNumber(Integer invoiceNumber) {
+		this.invoiceNumber = invoiceNumber;
+	}
+
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@ExcelField(title="开票日期", align=2, sort=10)
+	public Date getInvoiceDate() {
+		return invoiceDate;
+	}
+
+	public void setInvoiceDate(Date invoiceDate) {
+		this.invoiceDate = invoiceDate;
+	}
+
+	//@ExcelField(title="开票备注", align=2, sort=13)
+	public String getInvoiceRemarks() {
+		return invoiceRemarks;
+	}
+
+	public void setInvoiceRemarks(String invoiceRemarks) {
+		this.invoiceRemarks = invoiceRemarks;
+	}
+
+	//@ExcelField(title="是否开票", align=2, sort=14)
+	public String getIsInvoice() {
+		return isInvoice;
+	}
+
+	public void setIsInvoice(String isInvoice) {
+		this.isInvoice = isInvoice;
+	}
+
+
+	public String getIsCharge() {
+		return isCharge;
+	}
+
+	public void setIsCharge(String isCharge) {
+		this.isCharge = isCharge;
+	}
+
+	//@ExcelField(title="是否作废", align=2, sort=16)
+	public String getIsInvalid() {
+		return isInvalid;
+	}
+
+	public void setIsInvalid(String isInvalid) {
+		this.isInvalid = isInvalid;
+	}
+
+	public String getProcessInstanceId() {
+		return processInstanceId;
+	}
+
+	public void setProcessInstanceId(String processInstanceId) {
+		this.processInstanceId = processInstanceId;
+	}
+
+	public Task getTask() {
+		return task;
+	}
+
+	public void setTask(Task task) {
+		this.task = task;
+	}
+
+	public Map<String, Object> getVariables() {
+		return variables;
+	}
+
+	public void setVariables(Map<String, Object> variables) {
+		this.variables = variables;
+	}
+
+	public ProcessInstance getProcessInstance() {
+		return processInstance;
+	}
+
+	public void setProcessInstance(ProcessInstance processInstance) {
+		this.processInstance = processInstance;
+	}
+
+	public HistoricProcessInstance getHistoricProcessInstance() {
+		return historicProcessInstance;
+	}
+
+	public void setHistoricProcessInstance(HistoricProcessInstance historicProcessInstance) {
+		this.historicProcessInstance = historicProcessInstance;
+	}
+
+	public ProcessDefinition getProcessDefinition() {
+		return processDefinition;
+	}
+
+	public void setProcessDefinition(ProcessDefinition processDefinition) {
+		this.processDefinition = processDefinition;
+	}
+
+	public String getExt() {
+		return ext;
+	}
+
+	public void setExt(String ext) {
+		this.ext = ext;
+	}
+
+	public String getBillingContent() {
+		return billingContent;
+	}
+
+	public void setBillingContent(String billingContent) {
+		this.billingContent = billingContent;
+	}
+
+	public String getInvoiceTypeStr() {
+		return invoiceTypeStr;
+	}
+
+	public void setInvoiceTypeStr(String invoiceTypeStr) {
+		this.invoiceTypeStr = invoiceTypeStr;
+	}
+
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@ExcelField(title="收款日期", align=2, sort=12)
+	public Date getReceiptMoneyDate() {
+		return receiptMoneyDate;
+	}
+
+	public void setReceiptMoneyDate(Date receiptMoneyDate) {
+		this.receiptMoneyDate = receiptMoneyDate;
+	}
+
+	@ExcelField(title="是否收款", align=2, sort=13)
+	public String getReceiptMoney() {
+		return receiptMoney;
+	}
+
+	public void setReceiptMoney(String receiptMoney) {
+		this.receiptMoney = receiptMoney;
+	}
+
+	public String getCancellation() {
+		return cancellation;
+	}
+
+	public void setCancellation(String cancellation) {
+		this.cancellation = cancellation;
+	}
+
+	public String getAdminFlag() {
+		return adminFlag;
+	}
+
+	public void setAdminFlag(String adminFlag) {
+		this.adminFlag = adminFlag;
+	}
+
+	public String getCancellationRemark() {
+		return cancellationRemark;
+	}
+
+	public void setCancellationRemark(String cancellationRemark) {
+		this.cancellationRemark = cancellationRemark;
+	}
+
+	public String getOfficeName() {
+		return officeName;
+	}
+
+	public void setOfficeName(String officeName) {
+		this.officeName = officeName;
+	}
+
+	public String getSubmitterId() {
+		return submitterId;
+	}
+
+	public void setSubmitterId(String submitterId) {
+		this.submitterId = submitterId;
+	}
+
+	public String getSubmitterName() {
+		return submitterName;
+	}
+
+	public void setSubmitterName(String submitterName) {
+		this.submitterName = submitterName;
+	}
+
+	public List<WorkInvoiceReceipt> getWorkReceiptList() {
+		return workReceiptList;
+	}
+
+	public void setWorkReceiptList(List<WorkInvoiceReceipt> workReceiptList) {
+		this.workReceiptList = workReceiptList;
+	}
+
+	public Integer getNotifyFlag() {
+		return notifyFlag;
+	}
+
+	public void setNotifyFlag(Integer notifyFlag) {
+		this.notifyFlag = notifyFlag;
+	}
+
+	public String getNotifyId() {
+		return notifyId;
+	}
+
+	public void setNotifyId(String notifyId) {
+		this.notifyId = notifyId;
+	}
+
+	public List<WorkInvoiceProjectRelation> getWorkInvoiceProjectRelationList() {
+		return workInvoiceProjectRelationList;
+	}
+
+	public void setWorkInvoiceProjectRelationList(List<WorkInvoiceProjectRelation> workInvoiceProjectRelationList) {
+		this.workInvoiceProjectRelationList = workInvoiceProjectRelationList;
+	}
+
+	public String getAccountCheckingUserId() {
+		return accountCheckingUserId;
+	}
+
+	public void setAccountCheckingUserId(String accountCheckingUserId) {
+		this.accountCheckingUserId = accountCheckingUserId;
+	}
+
+	public String getAccountCheckingUserName() {
+		return accountCheckingUserName;
+	}
+
+	public void setAccountCheckingUserName(String accountCheckingUserName) {
+		this.accountCheckingUserName = accountCheckingUserName;
+	}
+
+	@ExcelField(title="发票编号", align=2, sort=9)
+	public String getWidNumber() {
+		return widNumber;
+	}
+
+	public void setWidNumber(String widNumber) {
+		this.widNumber = widNumber;
+	}
+	public String getWidTotalMoney() {
+		return widTotalMoney;
+	}
+
+	public void setWidTotalMoney(String widTotalMoney) {
+		this.widTotalMoney = widTotalMoney;
+	}
+
+	public Area getArea() {
+		return area;
+	}
+
+	public void setArea(Area area) {
+		this.area = area;
+	}
+
+	public List<Workattachment> getWorkAttachments() {
+		return workAttachments;
+	}
+
+	public void setWorkAttachments(List<Workattachment> workAttachments) {
+		this.workAttachments = workAttachments;
+	}
+
+	@ExcelField(title="报告号", align=2, sort=3)
+	public String getReportNumber() {
+		return reportNumber;
+	}
+
+	public void setReportNumber(String reportNumber) {
+		this.reportNumber = reportNumber;
+	}
+}

+ 18 - 0
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java

@@ -182,6 +182,9 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 	public List<WorkInvoice> findList(WorkInvoice workInvoice) {
 		return super.findList(workInvoice);
 	}
+	public List<WorkInvoice> findMapList(WorkInvoice workInvoice) {
+		return dao.findMapList(workInvoice);
+	}
 
 	public Page<WorkInvoice> findPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
 //		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
@@ -199,6 +202,21 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 		return page;
 
 	}
+	public Page<WorkInvoice> findMapPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
+		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
+			//查询该选择节点下所有的部门Id
+			List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+			officeIdList.add(workInvoice.getOfficeId());
+			workInvoice.setOfficeIdList(officeIdList);
+		}
+		int count = dao.queryMapCount(workInvoice);
+		page.setCount(count);
+		page.setCountFlag(false);
+		workInvoice.setPage(page);
+		page.setList(findMapList(workInvoice));
+		return page;
+
+	}
 
 	/**
 	 * 查询已通过的所有发票的开票金额总和

+ 19 - 1
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -218,7 +218,9 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 	public List<WorkInvoice> findList(WorkInvoice workInvoice) {
 		return super.findList(workInvoice);
 	}
-
+	public List<WorkInvoice> findMapList(WorkInvoice workInvoice) {
+		return dao.findMapList(workInvoice);
+	}
 	public Page<WorkInvoice> findPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
 		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
 		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
@@ -235,6 +237,22 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		return page;
 
 	}
+	public Page<WorkInvoice> findMapPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
+		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
+		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
+			//查询该选择节点下所有的部门Id
+			List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+			officeIdList.add(workInvoice.getOfficeId());
+			workInvoice.setOfficeIdList(officeIdList);
+		}
+		int count = dao.queryMapCount(workInvoice);
+		page.setCount(count);
+		page.setCountFlag(false);
+		workInvoice.setPage(page);
+		page.setList(findMapList(workInvoice));
+		return page;
+
+	}
 
 	/**
 	 * 查询已通过的所有发票的开票金额总和

+ 33 - 0
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllController.java

@@ -164,6 +164,39 @@ public class WorkInvoiceAllController extends BaseController {
 	/**
 	 * 开票管理列表页面
 	 */
+	@RequiresPermissions("workinvoice:workInvoiceAll:twoList")
+	@RequestMapping(value = {"twoList"})
+	public String twoList(WorkInvoice workInvoice, HttpServletRequest request, HttpServletResponse response, Model model) {
+		//进行查询之后进行任何操作,返回还是查询之后的数据页面
+		if (StringUtils.isNotBlank(workInvoice.getToflag())){
+			request.getSession().removeAttribute("searchInvoiceAll");
+			WorkInvoice searchInvoice=workInvoice;
+			request.getSession().setAttribute("searchInvoiceAll",searchInvoice);
+		}else{
+			if (request.getSession().getAttribute("searchInvoiceAll")!=null){
+				workInvoice= (WorkInvoice) request.getSession().getAttribute("searchInvoiceAll");
+				model.addAttribute("workInvoice", workInvoice);
+			}
+		}
+		Page<WorkInvoice> page = workInvoiceService.findMapPage(new Page<WorkInvoice>(request, response), workInvoice);
+		//查询已通过的所有发票的开票金额总和
+		String getSumMoney = workInvoiceService.getSumMoney(workInvoice);
+		List<WorkInvoice> workInvoiceList = page.getList();
+		for (WorkInvoice invoice: workInvoiceList) {
+			invoice.setWorkInvoiceProjectRelationList(invoiceService.getProjectRelation(invoice));
+			List<String> projectNameList = invoiceService.getProjectNameList(invoice);
+			String projectNameStr = String.join(",", projectNameList);
+			invoice.setProjectName(projectNameStr);
+		}
+		model.addAttribute("page", page);
+		model.addAttribute("sumMoney", getSumMoney);
+		model.addAttribute("workInvoiceShow", workInvoice);
+		return "modules/workinvoice/workInvoiceAllTwoList";
+	}
+
+	/**
+	 * 开票管理列表页面
+	 */
 	@RequestMapping(value = "projectview")
 	public String view(WorkInvoice invoice, HttpServletRequest request, HttpServletResponse response, Model model) {
 		invoice.setWorkInvoiceProjectRelationList(invoiceService.getProjectRelation(invoice));

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1331 - 0
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllTwoController.java


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1367 - 0
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java


+ 407 - 0
src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml

@@ -88,7 +88,285 @@
 		<include refid="workInvoiceJoins"/>
 		WHERE a.id = #{id} and a.del_flag = 0
 	</select>
+	<sql id="workInvoiceMapColumns">
+		a.id,
+		a.number,
+		a.process_instance_id as "processInstanceId",
+		a.client_id as clientId,
+		a.project_id as projectId,
+		a.project_name as "projectName",
+		a.money as "money",
+		a.invoice_type as "project_name",
+		(case when a.invoice_type = '1' then '专票' when a.invoice_type = '2' then '普票' else '' end) as 'invoiceTypeStr',
+		a.charge_type AS "chargeType",
+		a.content AS "content",
+		a.drawer_id AS "drawerId",
+		a.office_id AS "officeAId",
+		a.invoice_number AS "invoiceNumber",
+		a.invoice_date AS "invoiceDate",
+		a.drawer_name AS "drawerName",
+		a.take_date AS "takeDate",
+		a.invoice_remarks AS "invoiceRemarks",
+		a.is_invoice AS "isInvoice",
+		a.is_charge AS "isCharge",
+		a.is_invalid AS "isInvalid",
+		a.create_by AS "createById",
+		a.create_date AS "createDate",
+		a.update_by AS "updateById",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.orUnicode AS "orUnicode",
+		a.address AS "address",
+		a.telephone AS "telephone",
+		a.bank AS "bank",
+		a.bank_number AS "bankNumber",
+		a.cancle_reason AS "cancaleReason",
+		u.name AS "drawerUName",
+		su.name AS "createByUName",
+		so.top_company AS "officeName",
+		w.name AS "clientName",
+		p.project_name AS "proprojectName",
+		p.id AS "proId",
+		a.invoice_state AS "invoiceState",
+		p.project_id AS "proProjectId",
+		ci.name AS "proWorkContractInfoName",
+		w.usc_code AS "clientUscCode",
+		w.fax AS "clientFax",
+		w.or_unicode AS "clientOrUnicode",
+		w.telephone AS "clientTelephone",
+		a.company_id AS "companyId",
+		a.cancle_reason AS "cancleReason",
+		w.address AS "clientAddress",
+		a.officee_id AS "officeId",
+		a.province AS "province",
+		a.ext AS "ext",
+		a.billing_content as "billingContent",
+		prd.number as "projectReportDataNumber",
+		p.area_name as "projectCounty",
+		a.receipt_money_date as "receiptMoneyDate",
+		(case when a.receipt_money = '0' then '否' when a.receipt_money = '1' then '是' else '否' end) as receiptMoney,
+		a.cancellation_remark as "cancellationRemark",
+		a.account_checking_user_id as "accountCheckingUserId",
+		a.area_id as "areaId",
+		acu.name as "accountCheckingUserName"
+	</sql>
 
+	<resultMap type="WorkInvoice" id="InvoiceMap">
+		<id property="id" column="id"/>
+		<result  property="number" column="number"/>
+		<result property="processInstanceId" column="processInstanceId"/>
+		<result property="project_name" column="projectName"/>
+		<result property="money" column="money"/>
+		<result property="money" column="moneyStr"/>
+		<result property="invoiceType" column="invoiceType"/>
+		<result property="invoiceTypeStr" column="invoiceTypeStr"/>
+		<result property="chargeType" column="chargeType"/>
+		<result property="content" column="content"/>
+		<result property="invoiceNumber" column="invoiceNumber"/>
+		<result property="invoiceDate" column="invoiceDate"/>
+		<result property="drawerName" column="drawerName"/>
+		<result property="takeDate" column="takeDate"/>
+		<result property="invoiceRemarks" column="invoiceRemarks"/>
+		<result property="isInvoice" column="isInvoice"/>
+		<result property="isInvalid" column="isInvalid"/>
+		<result property="createDate" column="createDate"/>
+		<result property="update_by" column="update.by"/>
+		<result property="updateDate" column="updateDate"/>
+		<result property="remarks" column="remarks"/>
+		<result property="delFlag" column="delFlag"/>
+		<result property="orUnicode" column="orUnicode"/>
+		<result property="address" column="address"/>
+		<result property="telephone" column="telephone"/>
+		<result property="bank" column="bank"/>
+		<result property="bankNumber" column="bankNumber"/>
+		<result property="cancaleReason" column="cancaleReason"/>
+		<result property="invoiceState" column="invoiceState"/>
+		<result property="companyId" column="companyId"/>
+		<result property="cancleReason" column="cancleReason"/>
+		<result property="officeId" column="officeId"/>
+		<result property="province" column="province"/>
+		<result property="ext" column="ext"/>
+		<result property="billingContent" column="billingContent"/>
+		<result property="receiptMoneyDate" column="receiptMoneyDate"/>
+		<result property="receiptMoney" column="receiptMoney"/>
+		<result property="cancellationRemark" column="cancellationRemark"/>
+		<result property="accountCheckingUserId" column="accountCheckingUserId"/>
+		<result property="areaId" column="area.id"/>
+		<result property="accountCheckingUserName" column="accountCheckingUserName"/>
+		<association property="client" javaType="com.jeeplus.modules.workclientinfo.entity.WorkClientInfo">
+			<id property="id" column="clientId" />
+			<result property="name" column="clientName"/>
+			<result property="uscCode" column="clientUscCode"/>
+			<result property="fax" column="clientFax"/>
+			<result property="orUnicode" column="clientOrUnicode"/>
+			<result property="telephone" column="clientTelephone"/>
+			<result property="address" column="clientAddress"/>
+		</association>
+		<association property="project" javaType="com.jeeplus.modules.projectrecord.entity.ProjectRecords">
+			<id property="id" column="projectId"/>
+			<result property="projectName" column="proprojectName"/>
+			<result property="projectId" column="proProjectId"/>
+			<result property="workContractInfo.name" column="proWorkContractInfoName"/>
+			<result property="county" column="projectCounty"/>
+			<result property="reportData.number" column="projectReportDataNumber"/>
+		</association>
+		<association property="drawer" javaType="com.jeeplus.modules.sys.entity.User">
+			<id property="id" column="drawerId"/>
+			<result property="name" column="drawerUName"/>
+		</association>
+		<association property="createBy" javaType="com.jeeplus.modules.sys.entity.User">
+			<id property="id" column="createById"/>
+			<result property="name" column="createByUName"/>
+		</association>
+		<association property="office" javaType="com.jeeplus.modules.sys.entity.Office">
+			<id property="id" column="officeAId"/>
+			<result property="name" column="officeName"/>
+		</association>
+		<collection  property="workAccountList"  ofType="WorkInvoiceDetail" select="queryAccList" column="id">
+		</collection >
+	</resultMap>
+	<select id="findMapList" resultMap="InvoiceMap" >
+		SELECT
+			<include refid="workInvoiceMapColumns"/>
+# 			,wid.id as "wid"
+# 			,wid.number as "wNumber"
+# 			,wid.total_money as "wTotalMoney"
+		FROM work_invoice a
+		<include refid="workInvoiceJoins"/>
+# 		left join work_invoice_detail wid on a.id = wid.invoice_id
+		LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_id
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			<if test="number != null and number != ''">
+				AND a.number LIKE
+				<if test="dbName == 'oracle'">'%'||#{number}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{number}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{number},'%')</if>
+			</if>
+			<if test="invoiceState != null and invoiceState != ''">
+				AND a.invoice_state = #{invoiceState}
+			</if>
+			<if test="beginContractDate != null and endContractDate != null and beginContractDate != '' and endContractDate != ''">
+				AND a.create_date BETWEEN #{beginContractDate} AND #{endContractDate}
+			</if>
+			<if test="client != null and client.id != null and client.id != ''">
+				AND a.client_id = #{client.id}
+			</if>
+			<if test="project != null and project.id != null and project.id != ''">
+				AND a.project_id = #{project.id}
+			</if>
+			<if test="project != null and project.projectId != null and project.projectId != ''">
+				AND p.project_id LIKE
+				<if test="dbName == 'oracle'">'%'||#{project.projectId}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{project.projectId}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{project.projectId},'%')</if>
+			</if>
+			<if test="project != null and project.projectName != null and project.projectName != ''">
+				AND p.project_name LIKE
+				<if test="dbName == 'oracle'">'%'||#{project.projectName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{project.projectName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{project.projectName},'%')</if>
+			</if>
+			<if test="project != null and project.reportData != null and project.reportData.number != null and project.reportData.number != ''">
+				AND prd.number LIKE
+				<if test="dbName == 'oracle'">'%'||#{project.reportData.number}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{project.reportData.number}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{project.reportData.number},'%')</if>
+			</if>
+			<if test="client != null and client.name != null and client.name != ''">
+				AND w.name LIKE
+				<if test="dbName == 'oracle'">'%'||#{client.name}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
+			</if>
+			<!--<if test="officeId != null and officeId != ''">
+				AND so.id  = #{officeId}
+			</if>-->
+			<if test="money != null and money != ''">
+				AND a.money = #{money}
+			</if>
+			<!--<if test="submitterId != null and submitterId != ''">
+				AND a.create_by = #{submitterId}
+			</if>-->
+			<if test="(submitterId != null and submitterId != '') or (submitterName != null and submitterName != '')">
+				AND (a.create_by = #{submitterId} or su.name like concat('%',#{submitterName},'%'))
+			</if>
+			<if test="receiptMoney != null and receiptMoney != ''">
+				AND a.receipt_money = #{receiptMoney}
+			</if>
+			<if test="invoiceType != null and invoiceType != ''">
+				AND a.invoice_type = #{invoiceType}
+			</if>
+			<if test="chargeType != null and chargeType != ''">
+				AND a.charge_type = #{chargeType}
+			</if>
+			<if test="content != null and content != ''">
+				AND a.content = #{content}
+			</if>
+			<if test="drawer != null and drawer.id != null and drawer.id != ''">
+				AND a.drawer_id = #{drawer.id}
+			</if>
+			<if test="companyId != null and companyId != ''">
+				AND a.company_id = #{companyId}
+			</if>
+			<!--<if test="office != null and office.id != null and office.id != ''">
+				AND a.office_id = #{office.id}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
+			</if>
+			<if test="invoiceNumber != null and invoiceNumber != ''">
+				AND a.invoice_number LIKE
+					<if test="dbName == 'oracle'">'%'||#{invoiceNumber}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{invoiceNumber}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{invoiceNumber},'%')</if>
+			</if>
+			<if test="invoiceDate != null and invoiceDate != ''">
+				AND a.invoice_date = #{invoiceDate}
+			</if>
+			<if test="isInvoice != null and isInvoice != ''">
+				AND a.is_invoice = #{isInvoice}
+			</if>
+			<if test="isCharge != null and isCharge != ''">
+				AND a.is_charge = #{isCharge}
+			</if>
+			<if test="isInvalid != null and isInvalid != ''">
+				AND a.is_invalid = #{isInvalid}
+			</if>
+			<if test="area != null and area.id != null and area.id != ''">
+				AND a.area_parent_id LIKE
+				<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
+			</if>
+			<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
+				AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
+			</if>
+<!--			<if test="widNumber != null and widNumber != ''">-->
+<!--				AND wid.number LIKE-->
+<!--				<if test="dbName == 'oracle'">'%'||#{widNumber}||'%'</if>-->
+<!--				<if test="dbName == 'mssql'">'%'+#{widNumber}+'%'</if>-->
+<!--				<if test="dbName == 'mysql'">concat('%',#{widNumber},'%')</if>-->
+<!--			</if>-->
+			${sqlMap.dsf}
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.create_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	<select id="queryAccList" resultType="WorkInvoiceDetail">
+		select w.id,w.number,w.total_money
+		from work_invoice_detail w where w.invoice_id=#{id}
+	</select>
 	<select id="findList" resultType="WorkInvoice" >
 		SELECT
 			<include refid="workInvoiceColumns"/>
@@ -480,6 +758,135 @@
 			</otherwise>
 		</choose>
 	</select>
+	<select id="queryMapCount" resultType="int" >
+		SELECT count(1)
+		FROM work_invoice a
+		<include refid="workInvoiceJoins"/>
+		LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_id
+<!--		<if test="client != null and client.name != null and client.name != ''">-->
+<!--			LEFT JOIN work_client_info w ON  w.id = a.client_id-->
+<!--		</if>-->
+<!--		LEFT JOIN rural_project_records p ON  p.id = a.project_id-->
+<!--		LEFT join sys_office so on so.id = a.office_id-->
+<!--		left join project_report_data prd on p.id = prd.project_id-->
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			<if test="number != null and number != ''">
+				AND a.number = #{number}
+			</if>
+			<if test="invoiceState != null and invoiceState != ''">
+				AND a.invoice_state = #{invoiceState}
+			</if>
+			<if test="beginContractDate != null and endContractDate != null and beginContractDate != '' and endContractDate != ''">
+				AND a.create_date BETWEEN #{beginContractDate} AND #{endContractDate}
+			</if>
+			<if test="client != null and client.id != null and client.id != ''">
+				AND a.client_id = #{client.id}
+			</if>
+			<if test="project != null and project.id != null and project.id != ''">
+				AND a.project_id = #{project.id}
+			</if>
+			<if test="project != null and project.projectId != null and project.projectId != ''">
+				AND p.project_id LIKE
+				<if test="dbName == 'oracle'">'%'||#{project.projectId}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{project.projectId}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{project.projectId},'%')</if>
+			</if>
+			<if test="project != null and project.projectName != null and project.projectName != ''">
+				AND p.project_name LIKE
+				<if test="dbName == 'oracle'">'%'||#{project.projectName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{project.projectName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{project.projectName},'%')</if>
+			</if>
+			<if test="project != null and project.reportData != null and project.reportData.number != null and project.reportData.number != ''">
+				AND prd.number LIKE
+				<if test="dbName == 'oracle'">'%'||#{project.reportData.number}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{project.reportData.number}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{project.reportData.number},'%')</if>
+			</if>
+			<if test="client != null and client.name != null and client.name != ''">
+				AND w.name LIKE
+				<if test="dbName == 'oracle'">'%'||#{client.name}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
+			</if>
+			<!--<if test="officeId != null and officeId != ''">
+				AND so.id  = #{officeId}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
+			</if>
+			<!--<if test="submitterId != null and submitterId != ''">
+				AND a.create_by = #{submitterId}
+			</if>-->
+			<if test="(submitterId != null and submitterId != '') or (submitterName != null and submitterName != '')">
+				AND (a.create_by = #{submitterId} or su.name like concat('%',#{submitterName},'%'))
+			</if>
+			<if test="receiptMoney != null and receiptMoney != ''">
+				AND a.receipt_money = #{receiptMoney}
+			</if>
+			<if test="money != null and money != ''">
+				AND a.money = #{money}
+			</if>
+			<if test="invoiceType != null and invoiceType != ''">
+				AND a.invoice_type = #{invoiceType}
+			</if>
+			<if test="chargeType != null and chargeType != ''">
+				AND a.charge_type = #{chargeType}
+			</if>
+			<if test="content != null and content != ''">
+				AND a.content = #{content}
+			</if>
+			<if test="drawer != null and drawer.id != null and drawer.id != ''">
+				AND a.drawer_id = #{drawer.id}
+			</if>
+			<if test="companyId != null and companyId != ''">
+				AND a.company_id = #{companyId}
+			</if>
+			<if test="office != null and office.id != null and office.id != ''">
+				AND a.office_id = #{office.id}
+			</if>
+			<if test="invoiceNumber != null and invoiceNumber != ''">
+				AND a.invoice_number LIKE
+				<if test="dbName == 'oracle'">'%'||#{invoiceNumber}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{invoiceNumber}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{invoiceNumber},'%')</if>
+			</if>
+			<if test="invoiceDate != null and invoiceDate != ''">
+				AND a.invoice_date = #{invoiceDate}
+			</if>
+			<if test="isInvoice != null and isInvoice != ''">
+				AND a.is_invoice = #{isInvoice}
+			</if>
+			<if test="isCharge != null and isCharge != ''">
+				AND a.is_charge = #{isCharge}
+			</if>
+			<if test="isInvalid != null and isInvalid != ''">
+				AND a.is_invalid = #{isInvalid}
+			</if>
+			<if test="area != null and area.id != null and area.id != ''">
+				AND a.area_parent_id LIKE
+				<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
+			</if>
+			<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
+				AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
+			</if>
+			${sqlMap.dsf}
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.create_date DESC
+			</otherwise>
+		</choose>
+	</select>
 
 
 

+ 677 - 0
src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceAllTwoForm.jsp

@@ -0,0 +1,677 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>发票管理</title>
+	<meta name="decorator" content="default"/>
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+	<style>
+		#contractTypeDoc-error{
+			top:80px;
+			left:0;
+		}
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+        var validateForm;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            //debugger
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }else {
+				parent.layer.msg("信息未填写完整!", {icon: 5});
+			}
+            return false;
+        }
+        $(document).ready(function() {
+            /*$('#money').keyup(function(){
+                var c=$(this);
+                if(/[^\d]/.test(c.val())){//替换非数字字符
+                    var temp_amount=c.val().replace(/[^\d]/g,'');
+                    $(this).val(temp_amount);
+                }
+            })*/
+            jQuery.validator.addMethod("isUscCode", function(value, element) {
+                if (this.optional(element)){
+                    return true;
+                }
+                var uscCode = /^((\w{15})|(\w{18})|(\w{20}))$/;
+                return uscCode.test(value);
+            }, "请填写正确的纳税人识别号");
+
+            /* $("input[name='ext']").on('ifChecked', function(event){
+                 var radioVal = $(this).val();
+                 if(radioVal == 0){
+                     $("#td1").removeClass("hide");
+                     $("#td2").addClass("hide");
+                     $("#tr1").show()
+                 }else{
+                     $("#td1").addClass("hide");
+                     $("#td2").removeClass("hide");
+                     $("#tr1").hide()
+                 }
+             });*/
+            if("${workInvoice.ext}" == "1"){
+                $("#ext1").iCheck('check')
+            }else{
+                $("#ext").iCheck('check')
+            }
+            if("${workInvoice.invoiceType}" == "1"){
+                $("#invoiceType1").iCheck('check');
+                $(".invoicetype").show();
+            }else{
+                $("#invoiceType").iCheck('check');
+                $(".invoicetype").hide();
+            }
+            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);
+                    }
+                }
+            });
+
+            $("input[name='invoiceType']").on('ifChecked', function(event){
+                var radioVal = $(this).val();
+                //专票必填
+                if(radioVal == 1){
+                    $(".invoicetype").show();
+                    $("#bank").attr("class","form-control required layui-input");
+                    $("#bankNumber").attr("class","form-control number required layui-input");
+                    $("#orUnicode").attr("class","form-control isUscCode required layui-input");
+                    $("#address").attr("class","form-control required layui-input");
+                    $("#telephone").attr("class","form-control isTel required layui-input");
+                }else if(radioVal == 2){
+                    $(".invoicetype").hide();
+                    $("#bank").attr("class","form-control layui-input");
+                    $("#bankNumber").attr("class","form-control number layui-input");
+                    $("#orUnicode").attr("class","form-control isUscCode layui-input");
+                    $("#address").attr("class","form-control layui-input");
+                    $("#telephone").attr("class","form-control isTel layui-input");
+                }
+            });
+            /*--------------*/
+
+        });
+        function setValuee(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getWorkClientInfo',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#bank").val(d.bank);
+                    $("#orUnicode").val(d.orUnicode);
+                    $("#bankNumber").val(d.bankNumber);
+                    $("#telephone").val(d.telephone);
+                    $("#address").val(d.adress);
+                    $("#ids").val(d.ids);
+                }
+            })
+        }
+        function setDp(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getUserDp',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#dp").val(d.dp);
+                }
+            })
+        }
+        function setPNumber(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getPNumber',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#pNumber").val(d.pNumber);
+                    $("#cInfoName").val(d.cInfoName);
+                    $("#cName").val(d.cName);
+                    $("#officeName").val(d.officeName);
+                    $("#officeId").val(d.officeId);
+                }
+            })
+        }
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
+        function addRow(list, idx, tpl, row){
+            var idx1 = $("#workAccountList tr").length;
+            if(list == '#workAccountList' && idx1 < 100){
+                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");
+                    }
+                }
+            });
+        }
+        function provinceForShort(province){
+            if(province == "北京市")
+                return "京";
+            else if(province == "天津市")
+                return "津";
+            else if(province == "重庆市")
+                return "渝";
+            else if(province == "上海市")
+                return "沪";
+            else if(province == "河北省")
+                return "冀";
+            else if(province == "山西省")
+                return "晋";
+            else if(province == "辽宁省")
+                return "辽";
+            else if(province == "吉林省")
+                return "吉";
+            else if(province == "黑龙江省")
+                return "黑";
+            else if(province == "江苏省")
+                return "苏";
+            else if(province == "浙江省")
+                return "浙";
+            else if(province == "安徽省")
+                return "皖";
+            else if(province == "福建省")
+                return "闽";
+            else if(province == "江西省")
+                return "赣";
+            else if(province == "山东省")
+                return "鲁";
+            else if(province == "河南省")
+                return "豫";
+            else if(province == "湖北省")
+                return "鄂";
+            else if(province == "湖南省")
+                return "湘";
+            else if(province == "广东省")
+                return "粤";
+            else if(province == "海南省")
+                return "琼";
+            else if(province == "四川省")
+                return "川/蜀";
+            else if(province == "贵州省")
+                return "黔/贵";
+            else if(province == "云南省")
+                return "云/滇";
+            else if(province == "陕西省")
+                return "陕/秦";
+            else if(province == "甘肃省")
+                return "甘/陇";
+            else if(province == "青海省")
+                return "青";
+            else if(province == "台湾省")
+                return "台";
+            else if(province == "内蒙古自治区")
+                return "内蒙古";
+            else if(province == "广西壮族自治区")
+                return "桂";
+            else if(province == "宁夏回族自治区")
+                return "宁";
+            else if(province == "新疆维吾尔自治区 ")
+                return "新";
+            else if(province == "西藏自治区")
+                return "藏";
+            else if(province == "香港特别行政区")
+                return "港";
+            else if(province == "澳门特别行政区")
+                return "澳";
+        }
+
+        function setVs(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('allPrice','proportion');
+            var value = obj.value;
+            var p = $("#price").val() || 0;
+            if(!p || p == 0){
+                parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+                return;
+            }
+            var num = value/p ;
+            if(!/^\d+(\.\d{1,2})?$/.test( value )){
+                parent.layer.msg("合价必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+            }
+        }
+        function setTaxMoney(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('tax','taxMoney');
+            var t = a.replace('tax','totalMoney');
+            var tr = a.replace('tax','taxRate');
+            var value = obj.value || 0;
+            console.log("-value----"+value);
+            var tax = 1 + value/100;
+            console.log("-tax----"+tax);
+            var p = $("#" +  t ).val() || 0;//获取价税合计
+            console.log("-----"+p);
+            if(!p || p == 0){
+                parent.layer.msg("请先填写价税合计,且不能为零",{icon:5});
+                return;
+            }
+            var num = p/tax || 0;
+            console.log("-----"+num);
+            if(!/^\d+(\.\d{1,2})?$/.test( tax )){
+                parent.layer.msg("税率必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+                var taxRate = p - num;
+                $("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+            }
+        }
+        function setV(obj){
+            var a =  $(obj).attr("id");
+            var c = "京";
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+            var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/cancellationAudit" method="post" class="form-horizontal">
+			<form:hidden path="id"/>
+			<form:hidden path="invoiceDate"/>
+			<form:hidden path="province" id="province"/>
+
+			<div class="form-group layui-row first">
+				<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="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectName"   type="text" value="{{row.projectName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						/*if($("#id").val()){
+							workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
+				</div>
+			</div>
+			<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" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.ext eq '0'}">本公司开票	</c:when><c:when test="${workInvoice.ext eq '1'}">上级公司开票</c:when></c:choose>"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.invoiceType eq '1'}">专票</c:when><c:when test="${workInvoice.invoiceType eq '2'}">普票</c:when></c:choose>"/>
+					</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">
+						<div class="input-group">
+							<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.number}"/>
+						</div>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.client.name}"/>
+					</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="${workInvoice.orUnicode}"/>
+					</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="${workInvoice.address}"/>
+					</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="${workInvoice.telephone}"/>
+					</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="${workInvoice.bank}"/>
+					</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="${workInvoice.bankNumber}"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="##00.00"/>"/>
+					</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="${workInvoice.content}"/>
+					</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="${workInvoice.drawerName}"/>
+					</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="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">对账人:</label>
+					<div class="layui-input-block  with-icon">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workInvoice.accountCheckingUserName}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label">领票时间:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${workInvoice.takeDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label"><span class="require-item">*</span>作废原因:</label>
+					<div class="layui-input-block">
+						<form:textarea path="cancellationRemark" htmlEscape="false" rows="4"  maxlength="255"  class="form-control required"/>
+					</div>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="200px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workInvoice.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}"></td>
+											</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="${workInvoice.uploadMode == 2}">
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)" 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: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">
+				<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 details">
+						<thead>
+						<tr>
+							<th>发票代码</th>
+							<th>发票号</th>
+							<th>价税合计</th>
+							<th>税率</th>
+							<th>金额</th>
+							<th>税额</th>
+							<th>累计登记金额</th>
+							<th>发票状态</th><%--正常--%>
+							<th>被退标记</th>
+								<%--<th><span class="require-item">*</span>被退票号</th>
+                                <th><span class="require-item">*</span>开票日期</th>--%>
+						</tr>
+						</thead>
+						<tbody id="workAccountList">
+						<c:if test="${not empty workInvoice.workAccountList}">
+							<c:forEach items="${workInvoice.workAccountList}" var="workAccount" varStatus="index">
+								<tr id="workAccountList${index.index}">
+									<td title="${workAccount.code}">
+											${workAccount.code}
+									</td>
+									<td title="${workAccount.number}">
+											${workAccount.number}
+									</td>
+
+									<td title="<fmt:formatNumber value="${workAccount.totalMoney}" pattern="##00.00"/>">
+										<fmt:formatNumber value="${workAccount.totalMoney}" pattern="##00.00"/>
+									</td>
+									<td title="${workAccount.tax}">
+											${workAccount.tax}
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.taxMoney}" pattern="##00.00"/>">
+										<fmt:formatNumber value="${workAccount.taxMoney}" pattern="##00.00"/>
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.taxRate}" pattern="##00.00"/>">
+										<fmt:formatNumber value="${workAccount.taxRate}" pattern="##00.00"/>
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="##00.00"/>">
+										<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="##00.00"/>
+									</td>
+									<td title="${workAccount.state}">
+											${workAccount.state}
+									</td>
+									<td title="${workAccount.backSign}">
+											${workAccount.backSign}
+									</td>
+										<%--<td title="${workAccount.backNumber}">
+                                                ${workAccount.backNumber}
+                                        </td>
+                                        <td title="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>">
+                                            <fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>
+                                        </td>--%>
+								</tr>
+							</c:forEach>
+						</c:if>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+
+</body>
+</html>

+ 672 - 0
src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceAllTwoModify.jsp

@@ -0,0 +1,672 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>发票管理</title>
+	<meta name="decorator" content="default"/>
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+	<style>
+		#contractTypeDoc-error{
+			top:80px;
+			left:0;
+		}
+		#workInvoiceProjectRelationList tr td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			//debugger
+			if(validateForm.form()){
+				$("#inputForm").submit();
+				return true;
+			}else {
+				parent.layer.msg("信息未填写完整!", {icon: 5});
+			}
+			return false;
+		}
+		$(document).ready(function() {
+			/*$('#money').keyup(function(){
+                var c=$(this);
+                if(/[^\d]/.test(c.val())){//替换非数字字符
+                    var temp_amount=c.val().replace(/[^\d]/g,'');
+                    $(this).val(temp_amount);
+                }
+            })*/
+			jQuery.validator.addMethod("isUscCode", function(value, element) {
+				if (this.optional(element)){
+					return true;
+				}
+				var uscCode = /^((\w{15})|(\w{18})|(\w{20}))$/;
+				return uscCode.test(value);
+			}, "请填写正确的纳税人识别号");
+
+			/* $("input[name='ext']").on('ifChecked', function(event){
+                 var radioVal = $(this).val();
+                 if(radioVal == 0){
+                     $("#td1").removeClass("hide");
+                     $("#td2").addClass("hide");
+                     $("#tr1").show()
+                 }else{
+                     $("#td1").addClass("hide");
+                     $("#td2").removeClass("hide");
+                     $("#tr1").hide()
+                 }
+             });*/
+			if("${workInvoice.ext}" == "1"){
+				$("#ext1").iCheck('check')
+			}else{
+				$("#ext").iCheck('check')
+			}
+			if("${workInvoice.invoiceType}" == "1"){
+				$("#invoiceType1").iCheck('check');
+				$(".invoicetype").show();
+			}else{
+				$("#invoiceType").iCheck('check');
+				$(".invoicetype").hide();
+			}
+			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);
+					}
+				}
+			});
+
+			$("input[name='invoiceType']").on('ifChecked', function(event){
+				var radioVal = $(this).val();
+				//专票必填
+				if(radioVal == 1){
+					$(".invoicetype").show();
+					$("#bank").attr("class","form-control required layui-input");
+					$("#bankNumber").attr("class","form-control number required layui-input");
+					$("#orUnicode").attr("class","form-control isUscCode required layui-input");
+					$("#address").attr("class","form-control required layui-input");
+					$("#telephone").attr("class","form-control isTel required layui-input");
+				}else if(radioVal == 2){
+					$(".invoicetype").hide();
+					$("#bank").attr("class","form-control layui-input");
+					$("#bankNumber").attr("class","form-control number layui-input");
+					$("#orUnicode").attr("class","form-control isUscCode layui-input");
+					$("#address").attr("class","form-control layui-input");
+					$("#telephone").attr("class","form-control isTel layui-input");
+				}
+			});
+			/*--------------*/
+
+		});
+		function setValuee(obj){
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoice/workInvoice/getWorkClientInfo',
+				data:{
+					"obj":obj
+				},
+				success:function(data){
+					var d = JSON.parse(data);
+					$("#bank").val(d.bank);
+					$("#orUnicode").val(d.orUnicode);
+					$("#bankNumber").val(d.bankNumber);
+					$("#telephone").val(d.telephone);
+					$("#address").val(d.adress);
+					$("#ids").val(d.ids);
+				}
+			})
+		}
+		function setDp(obj){
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getUserDp',
+				data:{
+					"obj":obj
+				},
+				success:function(data){
+					var d = JSON.parse(data);
+					$("#dp").val(d.dp);
+				}
+			})
+		}
+		function setPNumber(obj){
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getPNumber',
+				data:{
+					"obj":obj
+				},
+				success:function(data){
+					var d = JSON.parse(data);
+					$("#pNumber").val(d.pNumber);
+					$("#cInfoName").val(d.cInfoName);
+					$("#cName").val(d.cName);
+					$("#officeName").val(d.officeName);
+					$("#officeId").val(d.officeId);
+				}
+			})
+		}
+
+		function addRow(list, idx, tpl, row){
+			var idx1 = $("#workAccountList tr").length;
+			if(list == '#workAccountList' && idx1 < 100){
+				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");
+					}
+				}
+			});
+		}
+		function provinceForShort(province){
+			if(province == "北京市")
+				return "京";
+			else if(province == "天津市")
+				return "津";
+			else if(province == "重庆市")
+				return "渝";
+			else if(province == "上海市")
+				return "沪";
+			else if(province == "河北省")
+				return "冀";
+			else if(province == "山西省")
+				return "晋";
+			else if(province == "辽宁省")
+				return "辽";
+			else if(province == "吉林省")
+				return "吉";
+			else if(province == "黑龙江省")
+				return "黑";
+			else if(province == "江苏省")
+				return "苏";
+			else if(province == "浙江省")
+				return "浙";
+			else if(province == "安徽省")
+				return "皖";
+			else if(province == "福建省")
+				return "闽";
+			else if(province == "江西省")
+				return "赣";
+			else if(province == "山东省")
+				return "鲁";
+			else if(province == "河南省")
+				return "豫";
+			else if(province == "湖北省")
+				return "鄂";
+			else if(province == "湖南省")
+				return "湘";
+			else if(province == "广东省")
+				return "粤";
+			else if(province == "海南省")
+				return "琼";
+			else if(province == "四川省")
+				return "川/蜀";
+			else if(province == "贵州省")
+				return "黔/贵";
+			else if(province == "云南省")
+				return "云/滇";
+			else if(province == "陕西省")
+				return "陕/秦";
+			else if(province == "甘肃省")
+				return "甘/陇";
+			else if(province == "青海省")
+				return "青";
+			else if(province == "台湾省")
+				return "台";
+			else if(province == "内蒙古自治区")
+				return "内蒙古";
+			else if(province == "广西壮族自治区")
+				return "桂";
+			else if(province == "宁夏回族自治区")
+				return "宁";
+			else if(province == "新疆维吾尔自治区 ")
+				return "新";
+			else if(province == "西藏自治区")
+				return "藏";
+			else if(province == "香港特别行政区")
+				return "港";
+			else if(province == "澳门特别行政区")
+				return "澳";
+		}
+
+		function setVs(obj){
+			var a = $(obj).attr("id");
+			var b = a.replace('allPrice','proportion');
+			var value = obj.value;
+			var p = $("#price").val() || 0;
+			if(!p || p == 0){
+				parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+				return;
+			}
+			var num = value/p ;
+			if(!/^\d+(\.\d{1,2})?$/.test( value )){
+				parent.layer.msg("合价必须输入数字",{icon:5});
+			}else{
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+			}
+		}
+		function setTaxMoney(obj){
+			var a = $(obj).attr("id");
+			var b = a.replace('tax','taxMoney');
+			var t = a.replace('tax','totalMoney');
+			var tr = a.replace('tax','taxRate');
+			var value = obj.value || 0;
+			console.log("-value----"+value);
+			var tax = 1 + value/100;
+			console.log("-tax----"+tax);
+			var p = $("#" +  t ).val() || 0;//获取价税合计
+			console.log("-----"+p);
+			if(!p || p == 0){
+				parent.layer.msg("请先填写价税合计,且不能为零",{icon:5});
+				return;
+			}
+			var num = p/tax || 0;
+			console.log("-----"+num);
+			if(!/^\d+(\.\d{1,2})?$/.test( tax )){
+				parent.layer.msg("税率必须输入数字",{icon:5});
+			}else{
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = p - num;
+				$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			}
+		}
+		function setV(obj){
+			var a =  $(obj).attr("id");
+			var c = "京";
+			var date=new Date;
+			var year=date.getFullYear();
+			var month=date.getMonth()+1;
+			month =(month<10 ? "0"+month:month);
+			var mydate = (year.toString()+month.toString());
+			var timestamp="["+mydate+"]";//获取固定格式年月
+			var number = c+timestamp;
+			$("#" +  a ).val(number);
+		}
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/cancellationSaveAudit" method="post" class="form-horizontal">
+			<form:hidden path="id"/>
+			<form:hidden path="invoiceDate"/>
+			<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"/>
+			<form:hidden path="province" id="province"/>
+
+			<div class="form-group layui-row first">
+				<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="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectName"   type="text" value="{{row.projectName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						/*if($("#id").val()){
+                            workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
+				</div>
+			</div>
+			<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" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.ext eq '0'}">本公司开票	</c:when><c:when test="${workInvoice.ext eq '1'}">上级公司开票</c:when></c:choose>"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.invoiceType eq '1'}">专票</c:when><c:when test="${workInvoice.invoiceType eq '2'}">普票</c:when></c:choose>"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.client.name}"/>
+					</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="${workInvoice.orUnicode}"/>
+					</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="${workInvoice.address}"/>
+					</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="${workInvoice.telephone}"/>
+					</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="${workInvoice.bank}"/>
+					</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="${workInvoice.bankNumber}"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="#,#00.00"/>"/>
+					</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="${workInvoice.content}"/>
+					</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="${workInvoice.drawerName}"/>
+					</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="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label">领票时间:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${workInvoice.takeDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label"><span class="require-item">*</span>作废原因:</label>
+					<div class="layui-input-block">
+						<form:textarea path="cancellationRemark" htmlEscape="false" rows="4"  maxlength="255"  class="form-control required"/>
+					</div>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="200px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workInvoice.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}"></td>
+											</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="${workInvoice.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>
+														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+													</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">
+				<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 details">
+						<thead>
+						<tr>
+							<th><span class="require-item">*</span>发票代码</th>
+							<th><span class="require-item">*</span>发票号</th>
+							<th><span class="require-item">*</span>价税合计</th>
+							<th><span class="require-item">*</span>税率</th>
+							<th><span class="require-item">*</span>金额</th>
+							<th><span class="require-item">*</span>税额</th>
+							<th><span class="require-item">*</span>累计登记金额</th>
+							<th><span class="require-item">*</span>发票状态</th><%--正常--%>
+							<th><span class="require-item">*</span>被退标记</th>
+								<%--<th><span class="require-item">*</span>被退票号</th>
+                                <th><span class="require-item">*</span>开票日期</th>--%>
+						</tr>
+						</thead>
+						<tbody id="workAccountList">
+						<c:if test="${not empty workInvoice.workAccountList}">
+							<c:forEach items="${workInvoice.workAccountList}" var="workAccount" varStatus="index">
+								<tr id="workAccountList${index.index}">
+									<td title="${workAccount.code}">
+											${workAccount.code}
+									</td>
+									<td title="${workAccount.number}">
+											${workAccount.number}
+									</td>
+
+									<td title="<fmt:formatNumber value="${workAccount.totalMoney}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.totalMoney}" pattern="#,#00.00"/>
+									</td>
+									<td title="${workAccount.tax}">
+											${workAccount.tax}
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.taxMoney}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.taxMoney}" pattern="#,#00.00"/>
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.taxRate}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.taxRate}" pattern="#,#00.00"/>
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="#,#00.00"/>
+									</td>
+									<td title="${workAccount.state}">
+											${workAccount.state}
+									</td>
+									<td title="${workAccount.backSign}">
+											${workAccount.backSign}
+									</td>
+										<%--<td title="${workAccount.backNumber}">
+                                                ${workAccount.backNumber}
+                                        </td>
+                                        <td title="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>">
+                                            <fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>
+                                        </td>--%>
+								</tr>
+							</c:forEach>
+						</c:if>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+
+</body>
+</html>

+ 665 - 0
src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceTwoForm.jsp

@@ -0,0 +1,665 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>发票管理</title>
+	<meta name="decorator" content="default"/>
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+	<style>
+		#contractTypeDoc-error{
+			top:80px;
+			left:0;
+		}
+		#workInvoiceProjectRelationList tr td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+        var validateForm;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            //debugger
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }else {
+				parent.layer.msg("信息未填写完整!", {icon: 5});
+			}
+            return false;
+        }
+        $(document).ready(function() {
+            /*$('#money').keyup(function(){
+                var c=$(this);
+                if(/[^\d]/.test(c.val())){//替换非数字字符
+                    var temp_amount=c.val().replace(/[^\d]/g,'');
+                    $(this).val(temp_amount);
+                }
+            })*/
+            jQuery.validator.addMethod("isUscCode", function(value, element) {
+                if (this.optional(element)){
+                    return true;
+                }
+                var uscCode = /^((\w{15})|(\w{18})|(\w{20}))$/;
+                return uscCode.test(value);
+            }, "请填写正确的纳税人识别号");
+
+            /* $("input[name='ext']").on('ifChecked', function(event){
+                 var radioVal = $(this).val();
+                 if(radioVal == 0){
+                     $("#td1").removeClass("hide");
+                     $("#td2").addClass("hide");
+                     $("#tr1").show()
+                 }else{
+                     $("#td1").addClass("hide");
+                     $("#td2").removeClass("hide");
+                     $("#tr1").hide()
+                 }
+             });*/
+            if("${workInvoice.ext}" == "1"){
+                $("#ext1").iCheck('check')
+            }else{
+                $("#ext").iCheck('check')
+            }
+            if("${workInvoice.invoiceType}" == "1"){
+                $("#invoiceType1").iCheck('check');
+                $(".invoicetype").show();
+            }else{
+                $("#invoiceType").iCheck('check');
+                $(".invoicetype").hide();
+            }
+            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);
+                    }
+                }
+            });
+
+            $("input[name='invoiceType']").on('ifChecked', function(event){
+                var radioVal = $(this).val();
+                //专票必填
+                if(radioVal == 1){
+                    $(".invoicetype").show();
+                    $("#bank").attr("class","form-control required layui-input");
+                    $("#bankNumber").attr("class","form-control number required layui-input");
+                    $("#orUnicode").attr("class","form-control isUscCode required layui-input");
+                    $("#address").attr("class","form-control required layui-input");
+                    $("#telephone").attr("class","form-control isTel required layui-input");
+                }else if(radioVal == 2){
+                    $(".invoicetype").hide();
+                    $("#bank").attr("class","form-control layui-input");
+                    $("#bankNumber").attr("class","form-control number layui-input");
+                    $("#orUnicode").attr("class","form-control isUscCode layui-input");
+                    $("#address").attr("class","form-control layui-input");
+                    $("#telephone").attr("class","form-control isTel layui-input");
+                }
+            });
+            /*--------------*/
+
+        });
+        function setValuee(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getWorkClientInfo',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#bank").val(d.bank);
+                    $("#orUnicode").val(d.orUnicode);
+                    $("#bankNumber").val(d.bankNumber);
+                    $("#telephone").val(d.telephone);
+                    $("#address").val(d.adress);
+                    $("#ids").val(d.ids);
+                }
+            })
+        }
+        function setDp(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getUserDp',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#dp").val(d.dp);
+                }
+            })
+        }
+        function setPNumber(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getPNumber',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#pNumber").val(d.pNumber);
+                    $("#cInfoName").val(d.cInfoName);
+                    $("#cName").val(d.cName);
+                    $("#officeName").val(d.officeName);
+                    $("#officeId").val(d.officeId);
+                }
+            })
+        }
+
+        function addRow(list, idx, tpl, row){
+            var idx1 = $("#workAccountList tr").length;
+            if(list == '#workAccountList' && idx1 < 100){
+                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");
+                    }
+                }
+            });
+        }
+        function provinceForShort(province){
+            if(province == "北京市")
+                return "京";
+            else if(province == "天津市")
+                return "津";
+            else if(province == "重庆市")
+                return "渝";
+            else if(province == "上海市")
+                return "沪";
+            else if(province == "河北省")
+                return "冀";
+            else if(province == "山西省")
+                return "晋";
+            else if(province == "辽宁省")
+                return "辽";
+            else if(province == "吉林省")
+                return "吉";
+            else if(province == "黑龙江省")
+                return "黑";
+            else if(province == "江苏省")
+                return "苏";
+            else if(province == "浙江省")
+                return "浙";
+            else if(province == "安徽省")
+                return "皖";
+            else if(province == "福建省")
+                return "闽";
+            else if(province == "江西省")
+                return "赣";
+            else if(province == "山东省")
+                return "鲁";
+            else if(province == "河南省")
+                return "豫";
+            else if(province == "湖北省")
+                return "鄂";
+            else if(province == "湖南省")
+                return "湘";
+            else if(province == "广东省")
+                return "粤";
+            else if(province == "海南省")
+                return "琼";
+            else if(province == "四川省")
+                return "川/蜀";
+            else if(province == "贵州省")
+                return "黔/贵";
+            else if(province == "云南省")
+                return "云/滇";
+            else if(province == "陕西省")
+                return "陕/秦";
+            else if(province == "甘肃省")
+                return "甘/陇";
+            else if(province == "青海省")
+                return "青";
+            else if(province == "台湾省")
+                return "台";
+            else if(province == "内蒙古自治区")
+                return "内蒙古";
+            else if(province == "广西壮族自治区")
+                return "桂";
+            else if(province == "宁夏回族自治区")
+                return "宁";
+            else if(province == "新疆维吾尔自治区 ")
+                return "新";
+            else if(province == "西藏自治区")
+                return "藏";
+            else if(province == "香港特别行政区")
+                return "港";
+            else if(province == "澳门特别行政区")
+                return "澳";
+        }
+
+        function setVs(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('allPrice','proportion');
+            var value = obj.value;
+            var p = $("#price").val() || 0;
+            if(!p || p == 0){
+                parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+                return;
+            }
+            var num = value/p ;
+            if(!/^\d+(\.\d{1,2})?$/.test( value )){
+                parent.layer.msg("合价必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+            }
+        }
+        function setTaxMoney(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('tax','taxMoney');
+            var t = a.replace('tax','totalMoney');
+            var tr = a.replace('tax','taxRate');
+            var value = obj.value || 0;
+            console.log("-value----"+value);
+            var tax = 1 + value/100;
+            console.log("-tax----"+tax);
+            var p = $("#" +  t ).val() || 0;//获取价税合计
+            console.log("-----"+p);
+            if(!p || p == 0){
+                parent.layer.msg("请先填写价税合计,且不能为零",{icon:5});
+                return;
+            }
+            var num = p/tax || 0;
+            console.log("-----"+num);
+            if(!/^\d+(\.\d{1,2})?$/.test( tax )){
+                parent.layer.msg("税率必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+                var taxRate = p - num;
+                $("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+            }
+        }
+        function setV(obj){
+            var a =  $(obj).attr("id");
+            var c = "京";
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+            var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoiceTwo/workinvoiceTwo/cancellationAudit" method="post" class="form-horizontal">
+			<form:hidden path="id"/>
+			<form:hidden path="invoiceDate"/>
+			<form:hidden path="province" id="province"/>
+
+			<div class="form-group layui-row first">
+				<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="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectName"   type="text" value="{{row.projectName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						/*if($("#id").val()){
+                            workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
+				</div>
+			</div>
+			<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" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.ext eq '0'}">本公司开票	</c:when><c:when test="${workInvoice.ext eq '1'}">上级公司开票</c:when></c:choose>"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.invoiceType eq '1'}">专票</c:when><c:when test="${workInvoice.invoiceType eq '2'}">普票</c:when></c:choose>"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.client.name}"/>
+					</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="${workInvoice.orUnicode}"/>
+					</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="${workInvoice.address}"/>
+					</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="${workInvoice.telephone}"/>
+					</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="${workInvoice.bank}"/>
+					</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="${workInvoice.bankNumber}"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="#,#00.00"/>"/>
+					</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="${workInvoice.content}"/>
+					</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="${workInvoice.drawerName}"/>
+					</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="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label">领票时间:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${workInvoice.takeDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label"><span class="require-item">*</span>作废原因:</label>
+					<div class="layui-input-block">
+						<form:textarea path="cancellationRemark" htmlEscape="false" rows="4"  maxlength="255"  class="form-control required"/>
+					</div>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="200px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workInvoice.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}"></td>
+											</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="${workInvoice.uploadMode == 2}">
+												<c:choose>
+													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+														<a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)" 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: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">
+				<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 details">
+						<thead>
+						<tr>
+							<th><span class="require-item">*</span>发票代码</th>
+							<th><span class="require-item">*</span>发票号</th>
+							<th><span class="require-item">*</span>价税合计</th>
+							<th><span class="require-item">*</span>税率</th>
+							<th><span class="require-item">*</span>金额</th>
+							<th><span class="require-item">*</span>税额</th>
+							<th><span class="require-item">*</span>累计登记金额</th>
+							<th><span class="require-item">*</span>发票状态</th><%--正常--%>
+							<th><span class="require-item">*</span>被退标记</th>
+								<%--<th><span class="require-item">*</span>被退票号</th>
+                                <th><span class="require-item">*</span>开票日期</th>--%>
+						</tr>
+						</thead>
+						<tbody id="workAccountList">
+						<c:if test="${not empty workInvoice.workAccountList}">
+							<c:forEach items="${workInvoice.workAccountList}" var="workAccount" varStatus="index">
+								<tr id="workAccountList${index.index}">
+									<td title="${workAccount.code}">
+											${workAccount.code}
+									</td>
+									<td title="${workAccount.number}">
+											${workAccount.number}
+									</td>
+
+									<td title="<fmt:formatNumber value="${workAccount.totalMoney}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.totalMoney}" pattern="#,#00.00"/>
+									</td>
+									<td title="${workAccount.tax}">
+											${workAccount.tax}
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.taxMoney}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.taxMoney}" pattern="#,#00.00"/>
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.taxRate}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.taxRate}" pattern="#,#00.00"/>
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="#,#00.00"/>
+									</td>
+									<td title="${workAccount.state}">
+											${workAccount.state}
+									</td>
+									<td title="${workAccount.backSign}">
+											${workAccount.backSign}
+									</td>
+										<%--<td title="${workAccount.backNumber}">
+                                                ${workAccount.backNumber}
+                                        </td>
+                                        <td title="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>">
+                                            <fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>
+                                        </td>--%>
+								</tr>
+							</c:forEach>
+						</c:if>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+
+</body>
+</html>

+ 672 - 0
src/main/webapp/webpage/modules/workinvoice/conditionWorkInvoiceTwoModify.jsp

@@ -0,0 +1,672 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>发票管理</title>
+	<meta name="decorator" content="default"/>
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+	<style>
+		#contractTypeDoc-error{
+			top:80px;
+			left:0;
+		}
+		#workInvoiceProjectRelationList tr td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			//debugger
+			if(validateForm.form()){
+				$("#inputForm").submit();
+				return true;
+			}else {
+				parent.layer.msg("信息未填写完整!", {icon: 5});
+			}
+			return false;
+		}
+		$(document).ready(function() {
+			/*$('#money').keyup(function(){
+                var c=$(this);
+                if(/[^\d]/.test(c.val())){//替换非数字字符
+                    var temp_amount=c.val().replace(/[^\d]/g,'');
+                    $(this).val(temp_amount);
+                }
+            })*/
+			jQuery.validator.addMethod("isUscCode", function(value, element) {
+				if (this.optional(element)){
+					return true;
+				}
+				var uscCode = /^((\w{15})|(\w{18})|(\w{20}))$/;
+				return uscCode.test(value);
+			}, "请填写正确的纳税人识别号");
+
+			/* $("input[name='ext']").on('ifChecked', function(event){
+                 var radioVal = $(this).val();
+                 if(radioVal == 0){
+                     $("#td1").removeClass("hide");
+                     $("#td2").addClass("hide");
+                     $("#tr1").show()
+                 }else{
+                     $("#td1").addClass("hide");
+                     $("#td2").removeClass("hide");
+                     $("#tr1").hide()
+                 }
+             });*/
+			if("${workInvoice.ext}" == "1"){
+				$("#ext1").iCheck('check')
+			}else{
+				$("#ext").iCheck('check')
+			}
+			if("${workInvoice.invoiceType}" == "1"){
+				$("#invoiceType1").iCheck('check');
+				$(".invoicetype").show();
+			}else{
+				$("#invoiceType").iCheck('check');
+				$(".invoicetype").hide();
+			}
+			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);
+					}
+				}
+			});
+
+			$("input[name='invoiceType']").on('ifChecked', function(event){
+				var radioVal = $(this).val();
+				//专票必填
+				if(radioVal == 1){
+					$(".invoicetype").show();
+					$("#bank").attr("class","form-control required layui-input");
+					$("#bankNumber").attr("class","form-control number required layui-input");
+					$("#orUnicode").attr("class","form-control isUscCode required layui-input");
+					$("#address").attr("class","form-control required layui-input");
+					$("#telephone").attr("class","form-control isTel required layui-input");
+				}else if(radioVal == 2){
+					$(".invoicetype").hide();
+					$("#bank").attr("class","form-control layui-input");
+					$("#bankNumber").attr("class","form-control number layui-input");
+					$("#orUnicode").attr("class","form-control isUscCode layui-input");
+					$("#address").attr("class","form-control layui-input");
+					$("#telephone").attr("class","form-control isTel layui-input");
+				}
+			});
+			/*--------------*/
+
+		});
+		function setValuee(obj){
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getWorkClientInfo',
+				data:{
+					"obj":obj
+				},
+				success:function(data){
+					var d = JSON.parse(data);
+					$("#bank").val(d.bank);
+					$("#orUnicode").val(d.orUnicode);
+					$("#bankNumber").val(d.bankNumber);
+					$("#telephone").val(d.telephone);
+					$("#address").val(d.adress);
+					$("#ids").val(d.ids);
+				}
+			})
+		}
+		function setDp(obj){
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getUserDp',
+				data:{
+					"obj":obj
+				},
+				success:function(data){
+					var d = JSON.parse(data);
+					$("#dp").val(d.dp);
+				}
+			})
+		}
+		function setPNumber(obj){
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getPNumber',
+				data:{
+					"obj":obj
+				},
+				success:function(data){
+					var d = JSON.parse(data);
+					$("#pNumber").val(d.pNumber);
+					$("#cInfoName").val(d.cInfoName);
+					$("#cName").val(d.cName);
+					$("#officeName").val(d.officeName);
+					$("#officeId").val(d.officeId);
+				}
+			})
+		}
+
+		function addRow(list, idx, tpl, row){
+			var idx1 = $("#workAccountList tr").length;
+			if(list == '#workAccountList' && idx1 < 100){
+				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");
+					}
+				}
+			});
+		}
+		function provinceForShort(province){
+			if(province == "北京市")
+				return "京";
+			else if(province == "天津市")
+				return "津";
+			else if(province == "重庆市")
+				return "渝";
+			else if(province == "上海市")
+				return "沪";
+			else if(province == "河北省")
+				return "冀";
+			else if(province == "山西省")
+				return "晋";
+			else if(province == "辽宁省")
+				return "辽";
+			else if(province == "吉林省")
+				return "吉";
+			else if(province == "黑龙江省")
+				return "黑";
+			else if(province == "江苏省")
+				return "苏";
+			else if(province == "浙江省")
+				return "浙";
+			else if(province == "安徽省")
+				return "皖";
+			else if(province == "福建省")
+				return "闽";
+			else if(province == "江西省")
+				return "赣";
+			else if(province == "山东省")
+				return "鲁";
+			else if(province == "河南省")
+				return "豫";
+			else if(province == "湖北省")
+				return "鄂";
+			else if(province == "湖南省")
+				return "湘";
+			else if(province == "广东省")
+				return "粤";
+			else if(province == "海南省")
+				return "琼";
+			else if(province == "四川省")
+				return "川/蜀";
+			else if(province == "贵州省")
+				return "黔/贵";
+			else if(province == "云南省")
+				return "云/滇";
+			else if(province == "陕西省")
+				return "陕/秦";
+			else if(province == "甘肃省")
+				return "甘/陇";
+			else if(province == "青海省")
+				return "青";
+			else if(province == "台湾省")
+				return "台";
+			else if(province == "内蒙古自治区")
+				return "内蒙古";
+			else if(province == "广西壮族自治区")
+				return "桂";
+			else if(province == "宁夏回族自治区")
+				return "宁";
+			else if(province == "新疆维吾尔自治区 ")
+				return "新";
+			else if(province == "西藏自治区")
+				return "藏";
+			else if(province == "香港特别行政区")
+				return "港";
+			else if(province == "澳门特别行政区")
+				return "澳";
+		}
+
+		function setVs(obj){
+			var a = $(obj).attr("id");
+			var b = a.replace('allPrice','proportion');
+			var value = obj.value;
+			var p = $("#price").val() || 0;
+			if(!p || p == 0){
+				parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+				return;
+			}
+			var num = value/p ;
+			if(!/^\d+(\.\d{1,2})?$/.test( value )){
+				parent.layer.msg("合价必须输入数字",{icon:5});
+			}else{
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+			}
+		}
+		function setTaxMoney(obj){
+			var a = $(obj).attr("id");
+			var b = a.replace('tax','taxMoney');
+			var t = a.replace('tax','totalMoney');
+			var tr = a.replace('tax','taxRate');
+			var value = obj.value || 0;
+			console.log("-value----"+value);
+			var tax = 1 + value/100;
+			console.log("-tax----"+tax);
+			var p = $("#" +  t ).val() || 0;//获取价税合计
+			console.log("-----"+p);
+			if(!p || p == 0){
+				parent.layer.msg("请先填写价税合计,且不能为零",{icon:5});
+				return;
+			}
+			var num = p/tax || 0;
+			console.log("-----"+num);
+			if(!/^\d+(\.\d{1,2})?$/.test( tax )){
+				parent.layer.msg("税率必须输入数字",{icon:5});
+			}else{
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = p - num;
+				$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			}
+		}
+		function setV(obj){
+			var a =  $(obj).attr("id");
+			var c = "京";
+			var date=new Date;
+			var year=date.getFullYear();
+			var month=date.getMonth()+1;
+			month =(month<10 ? "0"+month:month);
+			var mydate = (year.toString()+month.toString());
+			var timestamp="["+mydate+"]";//获取固定格式年月
+			var number = c+timestamp;
+			$("#" +  a ).val(number);
+		}
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoiceTwo/workinvoiceTwo/cancellationSaveAudit" method="post" class="form-horizontal">
+			<form:hidden path="id"/>
+			<form:hidden path="invoiceDate"/>
+			<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"/>
+			<form:hidden path="province" id="province"/>
+
+			<div class="form-group layui-row first">
+				<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="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectName"   type="text" value="{{row.projectName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						/*if($("#id").val()){
+                            workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
+				</div>
+			</div>
+			<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" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.ext eq '0'}">本公司开票	</c:when><c:when test="${workInvoice.ext eq '1'}">上级公司开票</c:when></c:choose>"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.invoiceType eq '1'}">专票</c:when><c:when test="${workInvoice.invoiceType eq '2'}">普票</c:when></c:choose>"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="${workInvoice.client.name}"/>
+					</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="${workInvoice.orUnicode}"/>
+					</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="${workInvoice.address}"/>
+					</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="${workInvoice.telephone}"/>
+					</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="${workInvoice.bank}"/>
+					</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="${workInvoice.bankNumber}"/>
+					</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">
+						<input htmlEscape="false" readonly="true"   class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="#,#00.00"/>"/>
+					</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="${workInvoice.content}"/>
+					</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="${workInvoice.drawerName}"/>
+					</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="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label">领票时间:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${workInvoice.takeDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label"><span class="require-item">*</span>作废原因:</label>
+					<div class="layui-input-block">
+						<form:textarea path="cancellationRemark" htmlEscape="false" rows="4"  maxlength="255"  class="form-control required"/>
+					</div>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="200px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workInvoice.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}"></td>
+											</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="${workInvoice.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>
+														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+													</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">
+				<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 details">
+						<thead>
+						<tr>
+							<th><span class="require-item">*</span>发票代码</th>
+							<th><span class="require-item">*</span>发票号</th>
+							<th><span class="require-item">*</span>价税合计</th>
+							<th><span class="require-item">*</span>税率</th>
+							<th><span class="require-item">*</span>金额</th>
+							<th><span class="require-item">*</span>税额</th>
+							<th><span class="require-item">*</span>累计登记金额</th>
+							<th><span class="require-item">*</span>发票状态</th><%--正常--%>
+							<th><span class="require-item">*</span>被退标记</th>
+								<%--<th><span class="require-item">*</span>被退票号</th>
+                                <th><span class="require-item">*</span>开票日期</th>--%>
+						</tr>
+						</thead>
+						<tbody id="workAccountList">
+						<c:if test="${not empty workInvoice.workAccountList}">
+							<c:forEach items="${workInvoice.workAccountList}" var="workAccount" varStatus="index">
+								<tr id="workAccountList${index.index}">
+									<td title="${workAccount.code}">
+											${workAccount.code}
+									</td>
+									<td title="${workAccount.number}">
+											${workAccount.number}
+									</td>
+
+									<td title="<fmt:formatNumber value="${workAccount.totalMoney}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.totalMoney}" pattern="#,#00.00"/>
+									</td>
+									<td title="${workAccount.tax}">
+											${workAccount.tax}
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.taxMoney}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.taxMoney}" pattern="#,#00.00"/>
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.taxRate}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.taxRate}" pattern="#,#00.00"/>
+									</td>
+									<td title="<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="#,#00.00"/>">
+										<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="#,#00.00"/>
+									</td>
+									<td title="${workAccount.state}">
+											${workAccount.state}
+									</td>
+									<td title="${workAccount.backSign}">
+											${workAccount.backSign}
+									</td>
+										<%--<td title="${workAccount.backNumber}">
+                                                ${workAccount.backNumber}
+                                        </td>
+                                        <td title="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>">
+                                            <fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>
+                                        </td>--%>
+								</tr>
+							</c:forEach>
+						</c:if>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+
+</body>
+</html>

+ 895 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoForm.jsp

@@ -0,0 +1,895 @@
+<%@ 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 src="${ctxStatic}/common/html/js/script.js"></script>
+	<style>
+		#contractTypeDoc-error{
+			top:80px;
+			left:0;
+		}
+		/*超过5个汉字,调整label的长度,以下是配套的*/
+		.layui-item .layui-form-label{
+			width:90px;
+		}
+		.form-group .layui-item .layui-input-block,
+		.query .layui-input-block {
+			margin-left: 116px;
+		}
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			//debugger
+			if(validateForm.form()){
+				if(obj == 2){
+					$("#inputForm").attr("action","${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/store");
+				}else{
+					var flag=judgment();
+					var leng=$("#workInvoiceProjectRelationList tr").length;
+					if (leng==0){
+						flag=2;
+					}
+					if (flag==2){
+						parent.layer.msg("先添加项目信息!", {icon: 5});
+						return false;
+					}
+					if (flag){
+						$("#inputForm").attr("action","${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/save");
+					}else if (!flags){
+						return flag;
+					}
+				}
+				$("#inputForm").submit();
+				return true;
+			}else {
+				parent.layer.msg("信息未填写完整!", {icon: 5});
+			}
+			return false;
+		}
+
+		$(document).ready(function() {
+			layui.use(['form', 'layer'], function () {
+				var form = layui.form;
+				form.on("radio(invoiceType)", function(event){
+					var radioVal = $(this).val();
+					//专票必填
+					if(radioVal == 1){
+						$(".invoicetype").show();
+						$("#bank").attr("class","form-control judgment layui-input");
+						$("#bankNumber").attr("class","form-control number judgment layui-input");
+						$("#orUnicode").attr("class","form-control isUscCode judgment layui-input");
+						$("#address").attr("class","form-control judgment layui-input");
+						$("#telephone").attr("class","form-control isTel judgment layui-input");
+					}else if(radioVal == 2){
+						$(".invoicetype").hide();
+						$("#bank").attr("class","form-control layui-input");
+						$("#bankNumber").attr("class","form-control number layui-input");
+						$("#orUnicode").attr("class","form-control isUscCode layui-input");
+						$("#address").attr("class","form-control layui-input");
+						$("#telephone").attr("class","form-control isTel layui-input");
+					}
+				});
+				$("#attachment_btn").click(function () {
+					$("#attachment_file").click();
+				});
+			});
+			/*$('#money').keyup(function(){
+                var c=$(this);
+                if(/[^\d]/.test(c.val())){//替换非数字字符
+                    var temp_amount=c.val().replace(/[^\d]/g,'');
+                    $(this).val(temp_amount);
+                }
+            })*/
+
+			jQuery.validator.addMethod("isUscCode", function(value, element) {
+				if (this.optional(element)){
+					return true;
+				}
+				var uscCode = /^((\w{15})|(\w{18})|(\w{20}))$/;
+				return uscCode.test(value);
+			}, "请填写正确的纳税人识别号");
+
+			/* $("input[name='ext']").on('ifChecked', function(event){
+                 var radioVal = $(this).val();
+                 if(radioVal == 0){
+                     $("#td1").removeClass("hide");
+                     $("#td2").addClass("hide");
+                     $("#tr1").show()
+                 }else{
+                     $("#td1").addClass("hide");
+                     $("#td2").removeClass("hide");
+                     $("#tr1").hide()
+                 }
+             });*/
+			if("${workInvoice.ext}" == "1"){
+				$("#ext1").iCheck('check')
+			}else{
+				$("#ext").iCheck('check')
+			}
+			if("${workInvoice.invoiceType}" == "1"){
+				$("#invoiceType1").iCheck('check');
+				$(".invoicetype").show();
+			}else{
+				$("#invoiceType").iCheck('check');
+				$(".invoicetype").hide();
+			}
+			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 setValuee(obj){
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoice/workInvoice/getWorkClientInfo',
+				data:{
+					"obj":obj
+				},
+				success:function(data){
+					var d = JSON.parse(data);
+					$("#bank").val(d.bank);
+					$("#orUnicode").val(d.orUnicode);
+					$("#bankNumber").val(d.bankNumber);
+					$("#telephone").val(d.telephone);
+					$("#address").val(d.registerAddress);
+					$("#ids").val(d.ids);
+				}
+			})
+		}
+		function setDp(obj){
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoice/workInvoice/getUserDp',
+				data:{
+					"obj":obj
+				},
+				success:function(data){
+					var d = JSON.parse(data);
+					$("#dp").val(d.dp);
+				}
+			})
+		}
+		function setPNumber(obj,ids,isProject,details){
+			var idx=ids.split("_")[0]
+			if (isProject==1){
+				$.ajax({
+					type:'post',
+					url:'${ctx}/workinvoice/workInvoice/getPNumber',
+					data:{
+						"obj":obj
+					},
+					success:function(data){
+						var d = JSON.parse(data);
+						var workContractName="#"+idx+"_workContractName";
+						var projectNum="#"+idx+"_projectNum";
+						var clientName="#"+idx+"_clientName";
+						var reportDataNum="#"+idx+"_reportDataNum";
+						$(workContractName).val(d.workContractName);
+						$(projectNum).val(d.projectNum);
+						$(clientName).val(d.clientName);
+						$(reportDataNum).val(d.reportDataNum);
+						var areaId = $("#areaId").val();
+						if(undefined ==areaId || null == areaId || '' == areaId){
+							$("#areaId").val(d.areaId);
+							$("#areaName").val(d.areaName);
+						}
+					}
+				})
+			}else if (isProject==2){
+				var workContractName="#"+idx+"_workContractName";
+				var detailsName="#"+idx+"_details";
+				$(workContractName).val(details);
+				$(detailsName).val(details);
+			}
+
+		}
+
+		function addRow(list, idx, tpl, row){
+			var idx1 = $("#workAccountList tr").length;
+			if(list == '#workAccountList' && idx1 < 100){
+				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");
+					}
+				}
+			});
+		}
+
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
+
+		function delRow(obj, prefix) {
+			var id = $(prefix + "_invoiceId");
+			var delFlag = $(prefix + "_delFlag");
+			if (id.val() == "") {
+				$(obj).parent().parent().remove();
+			} else if (delFlag.val() == "0") {
+				delFlag.val("1");
+				$(obj).html("&divide;").attr("title", "撤回删除");
+				$(obj).parent().parent().addClass("error");
+				$(obj).parent().parent().addClass("hide");
+			} else if (delFlag.val() == "1") {
+				delFlag.val("0");
+				$(obj).html("&times;").attr("title", "删除");
+				$(obj).parent().parent().removeClass("error");
+			}
+			// var idx1 = $("#workAccountList tr").length; //tr 总数
+			// for (var i = 0; i < idx1; i++) {
+			//     $("#workAccountList tr").eq(i).find("td").eq(1).html(i + 1);
+			// }
+		}
+		function provinceForShort(province){
+			if(province == "北京市")
+				return "京";
+			else if(province == "天津市")
+				return "津";
+			else if(province == "重庆市")
+				return "渝";
+			else if(province == "上海市")
+				return "沪";
+			else if(province == "河北省")
+				return "冀";
+			else if(province == "山西省")
+				return "晋";
+			else if(province == "辽宁省")
+				return "辽";
+			else if(province == "吉林省")
+				return "吉";
+			else if(province == "黑龙江省")
+				return "黑";
+			else if(province == "江苏省")
+				return "苏";
+			else if(province == "浙江省")
+				return "浙";
+			else if(province == "安徽省")
+				return "皖";
+			else if(province == "福建省")
+				return "闽";
+			else if(province == "江西省")
+				return "赣";
+			else if(province == "山东省")
+				return "鲁";
+			else if(province == "河南省")
+				return "豫";
+			else if(province == "湖北省")
+				return "鄂";
+			else if(province == "湖南省")
+				return "湘";
+			else if(province == "广东省")
+				return "粤";
+			else if(province == "海南省")
+				return "琼";
+			else if(province == "四川省")
+				return "川/蜀";
+			else if(province == "贵州省")
+				return "黔/贵";
+			else if(province == "云南省")
+				return "云/滇";
+			else if(province == "陕西省")
+				return "陕/秦";
+			else if(province == "甘肃省")
+				return "甘/陇";
+			else if(province == "青海省")
+				return "青";
+			else if(province == "台湾省")
+				return "台";
+			else if(province == "内蒙古自治区")
+				return "内蒙古";
+			else if(province == "广西壮族自治区")
+				return "桂";
+			else if(province == "宁夏回族自治区")
+				return "宁";
+			else if(province == "新疆维吾尔自治区 ")
+				return "新";
+			else if(province == "西藏自治区")
+				return "藏";
+			else if(province == "香港特别行政区")
+				return "港";
+			else if(province == "澳门特别行政区")
+				return "澳";
+		}
+
+		function setVs(obj){
+			var a = $(obj).attr("id");
+			var b = a.replace('allPrice','proportion');
+			var value = obj.value;
+			var p = $("#price").val() || 0;
+			if(!p || p == 0){
+				parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+				return;
+			}
+			var num = value/p ;
+			if(!/^\d+(\.\d{1,2})?$/.test( value )){
+				parent.layer.msg("合价必须输入数字",{icon:5});
+			}else{
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+			}
+		}
+		function setTaxMoney(obj){
+			var a = $(obj).attr("id");
+			var b = a.replace('tax','taxMoney');
+			var t = a.replace('tax','totalMoney');
+			var tr = a.replace('tax','taxRate');
+			var value = obj.value || 0;
+			console.log("-value----"+value);
+			var tax = 1 + value/100;
+			console.log("-tax----"+tax);
+			var p = $("#" +  t ).val() || 0;//获取发票金额
+			console.log("-----"+p);
+			if(!p || p == 0){
+				parent.layer.msg("请先填写发票金额,且不能为零",{icon:5});
+				return;
+			}
+			var num = p/tax || 0;
+			console.log("-----"+num);
+			if(!/^\d+(\.\d{1,2})?$/.test( tax )){
+				parent.layer.msg("税率必须输入数字",{icon:5});
+			}else{
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = p - num;
+				$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			}
+		}
+
+		/*function setV(obj){
+            var a =  $(obj).attr("id");
+            var b = $("#province").val();
+            var c = provinceForShort(b);//开票单位所在省/直辖市简称
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+            var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }*/
+		function setV(obj){
+			var a =  $(obj).attr("id");
+			var c = "京";
+			var date=new Date;
+			var year=date.getFullYear();
+			var month=date.getMonth()+1;
+			month =(month<10 ? "0"+month:month);
+			var mydate = (year.toString()+month.toString());
+			var timestamp="["+mydate+"]";//获取固定格式年月
+			var number = c+timestamp;
+			$("#" +  a ).val(number);
+		}
+		function insertTitle(tValue){
+			var list = "${workInvoice.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 = "115";
+				console.log(file);
+				var timestamp = new Date().getTime();
+
+				var storeAs = "workInvoice";
+				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 = "${workInvoice.workAttachments}";
+			var size = (list.split('url')).length-1;
+			var files = tValue;
+			for(var i = 0;i<files.length;i++) {
+				var file = files[i];
+				var attachmentId = "";
+				var attachmentFlag = "115";
+				var timestamp = new Date().getTime();
+
+				var storeAs = "workInvoice";
+				var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+				/*将这段字符串存到数据库即可*/
+				var divId = "_attachment";
+				$("#addFile" + divId).show();
+				multipartUploadWithStsCollection(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
+			}
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoice/workInvoice/save" method="post" class="layui-form">
+			<form:hidden path="id"/>
+			<form:hidden path="invoiceDate"/>
+			<form:hidden path="province" id="province"/>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>基本信息</h2></div>
+				<div class="layui-item nav-btns">
+					<a class="nav-btn nav-btn-add" onclick="addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl);workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+				</div>
+				<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+					<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+							<th width="100px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_details" name="workInvoiceProjectRelationList[{{idx}}].details" type="hidden" value="{{row.workContractName}}"/>
+                        </td>
+                        <td>
+                            <sys:gridselectcallprojecttss url="${ctx}/workinvoice/workInvoice/selectproject" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId"  value="{{row.projectId}}"  title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color: #fff"
+													labelValue="{{row.projectName}}" cssClass="form-control judgment layui-input" fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName"  isProject="{{row.isProject}}" details="{{row.details}}"></sys:gridselectcallprojecttss>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td class="text-center op-td" >
+                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						/*if($("#id").val()){
+							workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
+				</div>
+
+			</div>
+			<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 double-line"><span class="require-item">*</span>上级/本公司开票:</label>
+                        <div class="layui-input-block">
+                            <c:choose>
+                                <c:when test="${workInvoice.invoiceState == 4}">
+                                    <c:choose>
+                                        <c:when test="${workInvoice.ext ==0}">
+                                            <input value = "本公司开票" readonly="true" class="form-control layui-input"/>
+                                        </c:when>
+                                        <c:otherwise>
+                                            <input value = "上级公司开票" readonly="true"  class="form-control layui-input"/>
+                                        </c:otherwise>
+                                    </c:choose>
+                                </c:when>
+                                <c:otherwise>
+                                    <input type="radio" class="i-checks" name="ext" checked id="ext" value="0">
+                                    <label for="ext">本公司开票</label>
+                                    <input type="radio" class="i-checks" name="ext" id="ext1" value="1">
+                                    <label for="ext1">上级公司开票</label>
+                                </c:otherwise>
+                            </c:choose>
+                        </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">
+						<input type="radio" name="invoiceType" lay-filter="invoiceType" title="专票" checked id="invoiceType1" value="1">
+							<%--						<label for="invoiceType1">专票</label>--%>
+						<input type="radio" name="invoiceType" lay-filter="invoiceType" title="普票" id="invoiceType" value="2">
+							<%--						<label for="invoiceType">普票</label>--%>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line">发票申请编号:</label>
+					<div class="layui-input-block">
+						<div class="input-group">
+							<form:input path="number" htmlEscape="false" readonly="true"   class="form-control layui-input"/>
+							<span class="input-group-btn">
+								<label class="form-status"><c:choose><c:when test="${ empty workInvoice.invoiceState}">新添</c:when><c:otherwise>${fns:getDictLabel(workInvoice.invoiceState, 'audit_state','')}</c:otherwise>	</c:choose></label>
+							</span>
+						</div>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line"><span class="require-item">*</span>实际开票单位:</label>
+					<div class="layui-input-block with-icon">
+						<sys:gridselect url="${ctx}/workinvoice/workInvoice/selectclient" id="client" name="client.id"  value="${workInvoice.client.id}"  title="选择开票单位" labelName="workInvoice.client.name" cssStyle="background-color: #fff"
+										labelValue="${workInvoice.client.name}" cssClass="form-control judgment layui-input" fieldLabels="单位" fieldKeys="name" searchLabel="客户名称" searchKey="name" ></sys:gridselect>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line"><span class="require-item invoicetype">*</span>纳税人识别号:</label>
+					<div class="layui-input-block">
+						<form:input id="orUnicode" path="orUnicode" htmlEscape="false" placeholder="请输入纳税人识别号"   class="form-control isUscCode layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>地址:</label>
+					<div class="layui-input-block">
+						<form:input id="address" path="address" htmlEscape="false"  placeholder="请输入地址"  class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>电话:</label>
+					<div class="layui-input-block">
+						<form:input id="telephone" path="telephone" htmlEscape="false"  placeholder="请输入电话"  class="form-control isTel layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>开户银行:</label>
+					<div class="layui-input-block">
+						<form:input id ="bank"  path="bank" htmlEscape="false" placeholder="请输入开户银行"  class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>银行账号:</label>
+					<div class="layui-input-block">
+						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" placeholder="请输入银行账号"  class="form-control number layui-input"/>
+					</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:select  path="chargeType" class="form-control simple-select judgment">
+							<form:options items="${fns:getMainDictList('receipt_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+						</form:select>
+					</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:select path="billingContent" class="form-control simple-select judgment">
+							<form:options items="${fns:getMainDictList('billing_content')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+						</form:select>
+					</div>
+				</div>
+
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label double-line"><span class="require-item">*</span>发票金额(元):</label>
+					<div class="layui-input-block">
+							<%--<form:input id=""  path="money" htmlEscape="false" class="form-control number judgment layui-input"/>--%>
+						<input name="money" htmlEscape="false" placeholder="请输入发票金额" value="${workInvoice.money}" class="form-control judgment number layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label double-line">开票内容要求:</label>
+					<div class="layui-input-block">
+						<form:textarea path="content" id="contractTypeDoc" placeholder="请输入开票内容要求" htmlEscape="false" rows="4"    class="form-control"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票人:</label>
+					<div class="layui-input-block">
+						<form:input id=""  path="" htmlEscape="false" readonly="true"  class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票时间:</label>
+					<div class="layui-input-block">
+						<form:input id=""  path="" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">领票时间:</label>
+					<div class="layui-input-block">
+						<form:input id=""  path="" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+					</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">
+						<sys:treeselect id="master" name="accountCheckingUserId" value="${workInvoice.accountCheckingUserId}" labelName="accountCheckingUserName" labelValue="${workInvoice.accountCheckingUserName}"
+										cssStyle="background-color: #fff" title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label"><span class="require-item">*</span>对账地区:</label>
+					<div class="layui-input-block  with-icon">
+						<sys:treeselectArae id="area" name="area.id" value="${workInvoice.area.id}" labelName="area.name" labelValue="${workInvoice.area.name}"
+											cssStyle="background-color:#fff" title="区域" url="/sys/area/treeData" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="false" isAll="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label double-line">备注:</label>
+					<div class="layui-input-block">
+						<form:textarea path="remarks" placeholder="" htmlEscape="false" rows="4" class="form-control"/>
+					</div>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<div class="layui-item nav-btns">
+					<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+					<sys:collectSelect  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
+										name="linkman.id"  title="选择资料库"
+										cssClass="form-control judgment" fieldLabels="资料库" fieldKeys="name"
+										searchLabel="资料库" searchKey="fileName"></sys:collectSelect>
+				</div>
+				<div id="addFile_attachment" style="display: none" class="upload-progress">
+					<span id="fileName_attachment" ></span>
+					<b><span id="baifenbi_attachment" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="200px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workInvoice.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}"></td>
+											</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="${workInvoice.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>
+														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+													</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-xs12 form-table-container">
+					<table id="contentTable" class="table table-bordered table-condensed can-edit">
+						<thead>
+						<tr>
+							<th>发票代码</th>
+							<th>发票号</th>
+							<th>发票金额</th>
+							<th>税率</th>
+							<th>金额</th>
+							<th>税额</th>
+							<th>累计登记金额</th>
+							<th width="150px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="workAccountList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workAccountListTpl">//<!--
+                                    <tr id="workAccountList{{idx}}">
+                                        <td class="hide">
+                                            <input id="workAccountList{{idx}}_id" name="workAccountList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                            <input id="workAccountList{{idx}}_delFlag" name="workAccountList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                        </td>
+                                    	<td>
+                                        	<input id="workAccountList{{idx}}_code" name="workAccountList[{{idx}}].code" type="text" value="{{row.code}}"    class="form-control judgment"/>
+                                   		 </td>
+                                    	 <td>
+                                        	<input id="workAccountList{{idx}}_number" name="workAccountList[{{idx}}].number" type="text" value="{{row.number}}"    class="form-control judgment"/>
+                                   		 </td>
+                                    	<td>
+                                            <input id="workAccountList{{idx}}_totalMoney"  name="workAccountList[{{idx}}].totalMoney" type="text" value="{{row.totalMoney}}"    class="form-control judgment"/>
+                                        </td>
+                                        <td>
+                                        <div class="input-group">
+                                            <input id="workAccountList{{idx}}_tax" onblur="setTaxMoney(this)" name="workAccountList[{{idx}}].tax" type="text" value="{{row.tax}}"    class="form-control number judgment"/><span class="input-group-addon">%</span>
+                                            </div>
+
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList{{idx}}_taxMoney" name="workAccountList[{{idx}}].taxMoney" type="text" value="{{row.taxMoney}}"    class="form-control judgment"/>
+                                        </td>
+										<td>
+                                            <input id="workAccountList{{idx}}_taxRate" name="workAccountList[{{idx}}].taxRate" type="text" value="{{row.taxRate}}"    class="form-control judgment"/>
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList{{idx}}_incomeMoney" name="workAccountList[{{idx}}].incomeMoney" type="text" value="0"  readonly="true"  class="form-control judgment"/>
+                                        </td>
+
+                                            <input id="workAccountList{{idx}}_state" name="workAccountList[{{idx}}].state"  type="hidden" value="正常"   class="form-control"/>
+
+                                            <input id="workAccountList{{idx}}_backSign" name="workAccountList[{{idx}}].backSign"  type="hidden" value="正常"  readonly="true"  class="form-control judgment"/>
+
+                                            <input id="workAccountList{{idx}}_backNumber" name="workAccountList[{{idx}}].backNumber"  type="hidden" value=""  readonly="true"  class="form-control judgment"/>
+
+
+                                        <td class="text-center op-td">
+                                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workAccountList{{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,"");
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workAccountList)};
+							for (var i=0; i<data.length; i++){
+								addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, data[i]);
+								workAccountListRowIdx = workAccountListRowIdx + 1;
+							}
+						});
+					</script>
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+
+</body>
+</html>

+ 892 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoList.jsp

@@ -0,0 +1,892 @@
+<%@ page import="com.jeeplus.modules.sys.utils.UserUtils" %>
+<%@ 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 Srole = "<%= UserUtils.getSelectRole().getName()%>";--%>
+
+        $(document).ready(function() {
+            // laydate.render({
+            //     elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+            //     event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+				// ,type:'datetime'
+            // });
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginContractDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endContractDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+			<%--$(".").mouseover(function(){--%>
+			<%--	//tips层-下--%>
+			<%--	var input=$(this).parent().find("input").val();--%>
+			<%--	var data=${fns:toJson(investmentCostList)};--%>
+			<%--	alert(data)--%>
+			<%--	// var tdval=$(this).find("input").val();--%>
+			<%--	// layer.tips(tdval, td, {--%>
+			<%--	// 	tips: 3--%>
+			<%--	// });--%>
+			<%--	// top.layer.tips('下', '#id或者.class', {--%>
+			<%--	// 	tips: 3--%>
+			<%--	// });--%>
+			<%--})--%>
+
+        });
+        function openDialogre(title,url,width,height,target){
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url ,
+                skin:"three-btns",
+                btn: ['送审','暂存','关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                    return false;
+                },
+                btn3: function(index){
+                }
+            });
+
+        }
+
+        function openDialogreplay(title,url,width,height,target){
+
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url ,
+                skin:"two-btns",
+                btn: ['送审','关闭'],
+                yes: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+
+                    if(iframeWin.contentWindow.doSubmit() ){
+                        top.layer.close(index);//关闭对话框。
+                        //setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+
+                },
+                cancel: function(index){
+                }
+            });
+        }
+
+        function receiptInvoice(title,url,width,height,target){
+
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+			top.layer.open({
+				type: 2,
+				area: [width, height],
+				title: title,
+				maxmin: true, //开启最大化最小化按钮
+				content: url ,
+				skin:"three-btns",
+				btn: ['保留',/*'确认收款',*/'关闭'],
+				btn1: function(index, layero){
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(1) ){
+						// top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}
+				},
+				/*btn2:function(index,layero){
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(2) ){
+						// top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}
+					return false;
+				},*/
+				btn3: function(index){
+				}
+			});
+        }
+
+        function contractOpenDialogre(title,url,width,height,target){
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: false, //开启最大化最小化按钮
+                skin:"three-btns",
+                content: url ,
+                btn: ['送审','暂存','关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                    return false;
+                },
+                btn3: function(index){
+                }
+            });
+
+        }
+
+		function openDialogreModify(title,url,id,width,height,target) {
+
+			if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+				width = 'auto';
+				height = 'auto';
+			} else {//如果是PC端,根据用户设置的width和height显示。
+
+			}
+
+			$.ajax({
+				async: false,
+				url: "${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getInvoiceExist?id="+id,
+				dataType: "json",
+				success: function (data) {
+					if(data.success){
+                        top.layer.open({
+                            type: 2,
+                            area: [width, height],
+                            title: title,
+                            maxmin: true, //开启最大化最小化按钮
+                            content: url ,
+                            skin:"two-btns",
+                            btn: ['送审','关闭'],
+                            yes: function(index, layero){
+                                var body = top.layer.getChildFrame('body', index);
+                                var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                                var inputForm = body.find('#inputForm');
+                                var top_iframe;
+                                if(target){
+                                    top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                                }else{
+                                    top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                                }
+                                inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+
+                                if(iframeWin.contentWindow.doSubmit() ){
+                                    top.layer.close(index);//关闭对话框。
+                                    //setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                                }
+
+                            },
+                            cancel: function(index){
+                            }
+                        });
+					}else{
+						top.layer.msg("该发票信息已删除!", {icon: 0});
+						window.location.reload();
+					}
+				}
+			});
+
+
+		}
+
+
+		//打开对话框(查看)
+		function openDialogListView(title,url,id,width,height){
+
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			$.ajax({
+				async: false,
+				url: "${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getInvoiceExist?id="+id,
+				dataType: "json",
+				success: function (data) {
+					if(data.success){
+						top.layer.open({
+							type: 2,
+							skin: 'one-btn',
+							area: [width, height],
+							title: title,
+							maxmin: true, //开启最大化最小化按钮
+							content: url ,
+							btn: ['关闭'],
+							cancel: function(index){
+							}
+						});
+					}else{
+						top.layer.msg("该发票信息已删除!", {icon: 0});
+						window.location.reload();
+					}
+				}
+			});
+
+		}
+		function cBlur(obj) {
+			var id = $("#accountCheckingUserId").val();
+			if(undefined != obj.value && null != obj.value && '' != obj.value){
+				$.ajax({
+					url:'${ctx}/sys/user/getUserByName?name='+obj.value,
+					type:"post",
+					success:function(data){
+						var user = data.body.data;
+						if(undefined == user || null == user || '' == user){
+							$("#accountCheckingUserId").val("");
+						}else{
+							if(data.body.data.id != id){
+								if(undefined != id && null != id && '' != id){
+									$("#accountCheckingUserId").val("");
+								}
+							}
+						}
+					}
+				});
+			}else{
+				$("#accountCheckingUserId").val("");
+			}
+
+		}
+		function blurSubmitterId(obj) {
+			var id = $("#submitterId").val();
+			if(undefined != obj.value && null != obj.value && '' != obj.value){
+				$.ajax({
+					url:'${ctx}/sys/user/getUserByName?name='+obj.value,
+					type:"post",
+					success:function(data){
+						var user = data.body.data;
+						if(undefined == user || null == user || '' == user){
+							$("#submitterId").val("");
+						}else{
+							if(data.body.data.id != id){
+								if(undefined != id && null != id && '' != id){
+									$("#submitterId").val("");
+								}
+							}
+						}
+					}
+				});
+			}else{
+				$("#submitterId").val("");
+			}
+
+		}
+
+
+		function openDialogreModify(title,url,width,height,target){
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			top.layer.open({
+				type: 2,
+				area: [width, height],
+				title: title,
+				maxmin: true, //开启最大化最小化按钮
+				content: url ,
+				skin:"three-btns",
+				btn: ['提交','关闭'],
+				btn1: function(index, layero){
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(1) ){
+						// top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}
+				},
+				btn2: function(index){
+				}
+			});
+
+		}
+		function readDetailInfo(obj,numbers) {
+        	if(numbers!=undefined && numbers!=""){
+				var vals=numbers.split(",");
+				var value="";
+				for (var i=0;i<vals.length;i++){
+					value+=vals[i]+"</br>"
+				}
+				if (vals.length>0){
+					layer.tips(value, obj, {
+						tips: [3, '#000'],
+						area: ['250px', 'auto'],
+						time: 3000
+					});
+				}
+			}
+		}
+
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row ">
+		<%--<div class="full-width fl">
+			<div class=" contentShadow shadowLTR list-form-tab" id="tabDiv">
+				<ul class="list-tabs" >
+					<li class="active"><a href="${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/list">发票管理</a></li>
+					<li><a href="${ctx}/workinvoicealter/workInvoiceAlter/list">发票变更</a></li>
+				</ul>
+			</div>
+		</div>--%>
+		<div class="full-width fl">
+			<div class=" layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="workInvoice" action="${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/" method="post" class="form-inline">
+				<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+				<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+				<input id="toflag" name="toflag" type="hidden" value="1"/>
+				<%--<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->--%>
+
+					<div class="commonQuery lw9">
+<%--						<div class="layui-item query athird">--%>
+<%--							<label class="layui-form-label">发票号:</label>--%>
+<%--							<div class="layui-input-block with-icon">--%>
+<%--								<form:input path="widNumber" htmlEscape="false"  class=" form-control layui-input"/>--%>
+<%--							</div>--%>
+<%--						</div>--%>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">发票申请编号:</label>
+							<div class="layui-input-block">
+								<form:input path="number" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">开票金额:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="money" htmlEscape="false"  class=" form-control layui-input"/>
+							</div>
+						</div>
+
+						<%--<div class="layui-item query athird">
+							<label class="layui-form-label">项目编号:</label>
+							<div class="layui-input-block">
+								<form:input path="project.projectId" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">项目名称:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="project.projectName" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+							</div>
+						</div>--%>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<div class="layui-btn-group search-spacing">
+									<button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+									<button id="searchReset" class="layui-btn layui-btn-sm " onclick="resetSearch()">重置</button>
+								</div>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+					<div id="moresees" class="lw9" style="clear:both;display:none;">
+							<%--<div class="layui-item query athird">
+                                <label class="layui-form-label">报告号名称:</label>
+                                <div class="layui-input-block with-icon">
+                                    <form:input path="project.reportData.number" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+                                </div>
+                            </div>--%>
+								<div class="layui-item query athird">
+									<label class="layui-form-label">对账人:</label>
+									<div class="layui-input-block with-icon">
+										<sys:inquireselectUserNotReadolny id="accountCheckingUser" name="accountCheckingUserId" value="${workInvoice.accountCheckingUserId}" labelName="accountCheckingUserName" labelValue="${workInvoice.accountCheckingUserName}" cssStyle="background-color: #fff"
+																		  title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+									</div>
+								</div>
+								<div class="layui-item query athird">
+									<label class="layui-form-label">对账地区:</label>
+									<div class="layui-input-block  with-icon">
+										<sys:treeselectArae id="area" name="area.id" value="${workInvoice.area.id}" labelName="area.name" labelValue="${workInvoice.area.name}"
+															cssStyle="background-color:#fff" title="区域" url="/sys/area/treeData" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false" isAll="true"/>
+									</div>
+								</div>
+
+								<div class="layui-item query athird">
+									<label class="layui-form-label">开票日期:</label>
+									<div class="layui-input-block">
+										<input id="beginContractDate" name="beginContractDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group" style="background-color: #fff"
+											   value="<fmt:formatDate value="${workInvoice.beginContractDate}" pattern="yyyy-MM-dd"/>"/>
+										</input>
+										<span class="group-sep">-</span>
+										<input id="endContractDate" name="endContractDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group" style="background-color: #fff"
+											   value="<fmt:formatDate value="${workInvoice.endContractDate}" pattern="yyyy-MM-dd"/>"/>
+										</input>
+									</div>
+								</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">经办人部门:</label>
+							<div class="layui-input-block with-icon">
+								<sys:treeselect id="officeId" name="officeId" value="${workInvoice.officeId}" labelName="officeName" labelValue="${workInvoice.officeName}" cssStyle="background-color: #fff"
+												title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">经办人:</label>
+							<div class="layui-input-block with-icon">
+								<sys:inquireselectUserNotReadolnyTow id="submitter" name="submitterId" value="${workInvoice.submitterId}" labelName="submitterName" labelValue="${workInvoice.submitterName}" cssStyle="background-color: #fff"
+																	 title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">开票单位:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="client.name" htmlEscape="false"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">是否收款:</label>
+							<div class="layui-input-block with-icon">
+								<select id="receiptMoney" name="receiptMoney" class="form-control simple-select">
+									<option value=""></option>
+									<option value="0" <c:if test="${workInvoiceShow.receiptMoney=='0'}">selected</c:if>>否</option>
+									<option value="1" <c:if test="${workInvoiceShow.receiptMoney=='1'}">selected</c:if>>是</option>
+								</select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">发票类型:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="invoiceType" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('invoice_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">状态:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="invoiceState" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getDictList('invoice_audit_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">收款类型:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="chargeType" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('receipt_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">开票内容:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="billingContent" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('billing_content')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class=" contentShadow shadowLBR layui-form contentDetails">
+				<div class="nav-btns">
+					<%--此处按钮样式包括 nav-btn-add nav-btn-refresh nav-btn-import nav-btn-export nav-btn-query nav-btn-reset--%>
+					<div class="layui-btn-group" style="float: left">
+						<shiro:hasPermission name="workinvoice:workInvoice:add">
+							<button class="layui-btn layui-btn-sm layui-bg-blue" title="发票管理" onclick="openDialogre('发票管理','${ctx}//workinvoiceAllTwo/workinvoiceAllTwo/form','95%','95%')">&nbsp;添加</button>
+						</shiro:hasPermission>
+						<shiro:hasPermission name="workinvoiceAllTwo:workinvoiceAllTwo:export">
+							<table:exportExcel url="${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/export"></table:exportExcel><!-- 导出按钮 -->
+						</shiro:hasPermission>
+						<button class="layui-btn layui-btn-sm layui-bg-green" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+						<div class=" layui-btn-sm" style="float: right;width: 300px">
+							<span style="color: red">金额汇总(开票金额):${sumMoney}(元)</span>
+						</div>
+					</div>
+					<%--<shiro:hasPermission name="workinvoice:workInvoice:del">
+						<table:delRow url="${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/deleteAll" id="contentTable"></table:delRow><!-- 删除按钮 -->
+					</shiro:hasPermission>--%>
+					<div style="clear: both;"></div>
+				</div>
+				<table class="oa-table layui-table" id="contentTable"></table>
+
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+    <div id="changewidth"></div>
+</div>
+<script>
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+            ,elem: '#contentTable'
+            ,page: false
+            ,cols: [[
+				//{checkbox: true, fixed: true},
+                {field:'index',align:'center', title: '序号',width:40}
+				,{field:'projName',align:'center', title: '项目名称', minWidth:160,templet:function(d){
+						if(1 == d.showView && d.showView != undefined){
+							return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/projectview?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
+						}else{
+							return "<span title='"+ d.projName +"'>" +d.projName+ "</span>";
+						}
+					<%--return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralProjectRecords/view?id=" + d.projectId +"','95%', '95%')\">" + d.projName + "</a>";--%>
+					}}
+                ,{field:'invoiceNum',align:'center', sort:true,title: '发票申请编号', minWidth:130,templet:function(d){
+                        return "<a class=\"attention-info\" title=\""+ d.invoiceNum +"\"href=\"javascript:void(0);\" onclick=\"openDialogListView('查看发票管理', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/form?id=" + d.id + "&tabId=1','"+ d.id +"','95%', '95%')\">" + d.invoiceNum + "</a>";
+                    }}
+				// ,{field:'widNumber',align:'center', title: '发票号',  width:90,templet:function(d){
+				// 		return "<span title='"+ d.widNumber +"'>" + d.widNumber + "</span>";
+				// 	}}
+				,{field:'clientName', align:'center',title: '开票单位', minWidth:160,templet:function(d){
+						return "<span title='"+ d.clientName +"'>" + d.clientName + "</span>";
+					}}
+				,{field:'responsibleName', align:'center',title: '经办人', minWidth:80,templet:function(d){
+						return "<span title='"+ d.responsibleName +"'>" + d.responsibleName + "</span>";
+					}}
+				,{field:'officeName', align:'center',title: '经办单位',width:80,templet:function(d){
+						return "<span title='"+ d.officeName +"'>" + d.officeName + "</span>";
+					}}
+				,{field:'money',align:'center', title: '开票金额(元)',  width:110,templet:function(d){
+						var numbers = new Array();;
+						if (d.workAccountListStr.length>0){
+							for (var i=0;i<d.workAccountListStr.length;i++){
+								numbers[i]="发票号:"+d.workAccountListStr[i].number+" 发票金额:"+d.workAccountListStr[i].totalMoney;
+							}
+						}
+						var xml= "<span onmouseover=\"readDetailInfo(this,'"+numbers+"')\">" + d.money+"</span>" ;
+						return xml;
+					}}
+				// ,{field:'widTotalMoney',align:'center', title: '发票金额(元)',  width:120,templet:function(d){
+				// 		return "<span title='"+ d.widTotalMoney +"'>" + d.widTotalMoney + "</span>";
+				// 	}}
+				,{field:'billingContent',align:'center', title: '开票内容',  width:90,templet:function(d){
+						return "<span title='"+ d.billingContent +"'>" + d.billingContent + "</span>";
+					}}
+				,{field:'chargeType',align:'center', title: '收款类型',  width:90,templet:function(d){
+						return "<span title='"+ d.chargeType +"'>" + d.chargeType + "</span>";
+					}}
+				,{field:'invoiceType',align:'center', title: '发票类型',  width:90,templet:function(d){
+						return "<span title='"+ d.invoiceType +"'>" + d.invoiceType + "</span>";
+					}}
+
+				,{field:'createDate',align:'center', sort:true,title: '开票日期',  width:80}
+				,{field:'receiptMoneyDate',align:'center', sort:true,title: '收款日期',  width:80}
+				,{field:'receiptMoney',align:'center', title: '是否收款',  width:80}
+				,{field:'cancellation',align:'center', title: '是否作废',  width:80}
+                ,{align:'center', title: '状态', fixed: 'right', width:70,templet:function(d){
+                        <%--var st = getAuditState(d.status);--%>
+
+                        <%--var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getProcessOne?id=" + d.id + "','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";--%>
+                        <%--return xml;--%>
+                        var st = getAuditState(d.status);
+                        if(st.action)
+                            var xml = "<span onclick=\"openDialogListView('流程追踪', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getProcessOne?id=" + d.id + "','"+ d.id +"','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        else
+                            var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        return xml;
+                    }}
+                ,{field:'op',align:'center',title:"操作",fixed: 'right',width:220,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="<div class=\"layui-btn-group\">";
+                        if(d.canedit1 != undefined && d.canedit1 =="1")
+                        {
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('修改发票', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/form?id=" + d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" >修改</a>";
+                        }
+                        if(d.canedit2 != undefined && d.canedit2 =="1")
+                        {
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreModify('修改发票', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/form?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" >修改</a>";
+                        }
+                        if(d.canedit3 != undefined && d.canedit3 =="1")
+                        {
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('重新申请发票', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/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}/workinvoiceAllTwo/workinvoiceAllTwo/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该发票记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+                        }
+                        if(d.cancancel != undefined && d.cancancel =="1")
+                        {
+                            xml += "<a href=\"${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/cancelInvalidate?id="+ d.id +"\" onclick=\"return confirmx('确认要强制撤回?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 撤回</a>";
+                        }
+                        /*if(d.canalter != undefined && d.canalter =="1")
+                        {
+                            xml += "<a href=\"javascript:void(0)\" onclick=\"contractOpenDialogre('变更发票管理', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/alterForm?id="+ d.id +"','95%','95%')\" class=\"op-btn op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
+                        }*/
+
+						if(d.adminModify != undefined && d.adminModify =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreModify('管理员修改发票', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/form?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" >管理员修改</a>";
+						}
+						if(d.financeFlag != undefined && d.financeFlag =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"receiptInvoice('发票收款', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/receiptForm?id=" + d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-orange\" > 收款</a>";
+							xml+="<a href=\"${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/saveAffirmReceipt?id=" + d.id + "\" onclick=\"return confirmx('是否确认收款?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-orange\"> 确认收款</a>";
+						}
+						if(d.cancellationFlag != undefined && d.cancellationFlag =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('作废发票', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/cancellationForm?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 作废</a>";
+						}
+						if(d.conditionCanedit != undefined && d.conditionCanedit =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('作废修改发票', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/cancellationForm?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+						}
+						if(d.conditionCanedit3 != undefined && d.conditionCanedit3 =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('重新申请发票', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/cancellationForm?id=" + d.id + "&tabId=4','95%','95%')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 修改</a>";
+						}
+						if(d.conditionCandelete != undefined && d.conditionCandelete =="1")
+						{
+							xml += "<a href=\"${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/cancellationDelete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该发票作废记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+						}
+						if(d.conditionCancancel != undefined && d.conditionCancancel =="1")
+						{
+							xml += "<a href=\"${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/conditionCancelInvalidate?id="+ d.id +"\" onclick=\"return confirmx('确认要强制撤回?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\"\" > 作废撤回</a>";
+						}
+
+						if(d.adminFlag != undefined && d.adminFlag =="1")
+						{
+							xml += "<a href=\"${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该发票记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+						}
+						xml+="</div>"
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="workInvoice" varStatus="index"><c:set var="Srole" scope="session" value="<%= UserUtils.getSelectRole().get(0).getEnname()%>"/>
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${workInvoice.id}"
+                    ,"invoiceNum":"${workInvoice.number}"
+                    ,"chargeType":"${fns:getMainDictLabels(workInvoice.chargeType,',','receipt_type', '')}"
+                    ,"billingContent":"${fns:getMainDictLabels(workInvoice.billingContent,',','billing_content', '')}"
+                    ,"invoiceType":"${workInvoice.invoiceTypeStr}"
+                    ,"projNum":"${workInvoice.project.projectId}"
+                    ,"projectId":"${workInvoice.project.id}"
+                    ,"areaName":"${workInvoice.project.county}"
+                    ,"reportNumber":"${workInvoice.project.reportData.number}"
+                    ,"projName":"${workInvoice.projectName}"
+                    ,"clientName":"${workInvoice.client.name}"
+                    ,"officeName":"${workInvoice.office.name}"
+                    ,"responsibleName":"${workInvoice.createBy.name}"
+                    ,"receiptMoney":"${workInvoice.receiptMoney}"
+                    ,"status":"${workInvoice.invoiceState}"
+					,"widNumber":"${workInvoice.widNumber}"
+					,"widTotalMoney":"${workInvoice.widTotalMoney}"
+					,"workAccountList":"${workInvoice.workAccountList}"
+					,"workAccountListStr":${fns:toJson(workInvoice.workAccountList)}
+					,"money":"<fmt:formatNumber value="${workInvoice.money}" pattern="##0.00"/>"
+                    ,"createDate":"<fmt:formatDate value="${workInvoice.createDate}" pattern="yyyy-MM-dd"/>"
+                    ,"receiptMoneyDate":"<fmt:formatDate value="${workInvoice.receiptMoneyDate}" pattern="yyyy-MM-dd"/>"
+                    <c:if test="${workInvoice.invoiceState == 1 && fns:getUser().id == workInvoice.createBy.id}"><shiro:hasPermission name="workinvoice:workInvoice:edit">,"canedit1":"1"</shiro:hasPermission></c:if><%--暂存-修改--%>
+                    <c:if test="${workInvoice.invoiceState == '4' && fns:getUser().id == workInvoice.createBy.id}">,"canedit2":"1"</c:if><%--驳回--修改--%>
+                    <c:if test="${workInvoice.invoiceState == '9' && fns:getUser().id == workInvoice.createBy.id}">,"conditionCanedit":"1"</c:if><%--驳回--修改--%>
+                    <c:if test="${workInvoice.invoiceState == '11' && fns:getUser().id == workInvoice.createBy.id}">,"conditionCanedit3":"1"</c:if><%--作废撤回--修改--%>
+                    <c:if test="${workInvoice.invoiceState == '3' && fns:getUser().id == workInvoice.createBy.id}">,"canedit3":"1"</c:if><%--撤回--修改--%>
+                    <c:if test="${fns:getUser().id == workInvoice.createBy.id}"><c:if test="${workInvoice.invoiceState == '1' or workInvoice.invoiceState == '3' or workInvoice.invoiceState == '4'}"><shiro:hasPermission name="workinvoice:workInvoice:del">,"candelete":"1"</shiro:hasPermission></c:if></c:if>
+                    <c:if test="${fns:getUser().id == workInvoice.createBy.id}"><c:if test="${workInvoice.invoiceState == '9' || workInvoice.invoiceState == '11' }">,"conditionCandelete":"1"</c:if></c:if>
+                    <c:if test="${workInvoice.invoiceState == '2' && fns:getUser().id == workInvoice.createBy.id}">,"cancancel":"1"</c:if>
+                    <c:if test="${workInvoice.invoiceState == '6' && fns:getUser().id == workInvoice.createBy.id}">,"conditionCancancel":"1"</c:if>
+					<%--管理员修改--%>
+					<shiro:hasPermission name="workinvoice:workInvoice:adminModify">
+						<c:if test="${workInvoice.invoiceState == '5'}">,"adminModify":"1"</c:if>
+					</shiro:hasPermission>
+					<shiro:hasPermission name="workinvoice:workInvoice:alteredit">
+                    <c:if test="${workInvoice.invoiceState == '5'}">,"canalter":"1"</c:if>
+                    </shiro:hasPermission>
+					,"cancellation":<c:choose>
+							<c:when test="${workInvoice.invoiceState == '7'}">"是"</c:when>
+					<c:otherwise>"否"</c:otherwise>
+					</c:choose>
+					<shiro:hasPermission name="workinvoice:workInvoice:receipt">
+						,"financeFlag":
+							<c:choose>
+								<c:when test="${workInvoice.invoiceState == 5 && workInvoice.receiptMoney == '否'}">"1"</c:when>
+								<c:otherwise>"0"</c:otherwise>
+						</c:choose>
+					</shiro:hasPermission>
+					<shiro:hasPermission name="workinvoice:workInvoice:invalid">
+						,"cancellationFlag":
+							<c:choose>
+								<c:when test="${workInvoice.invoiceState == 5}">"1"</c:when>
+								<c:otherwise>"0"</c:otherwise>
+						</c:choose>
+					</shiro:hasPermission>
+					<shiro:hasPermission name="workinvoice:workInvoice:adminDel">
+						,"adminFlag":
+							<c:choose>
+								<c:when test="${workInvoice.invoiceState == 5}">"1"</c:when>
+								<c:otherwise>"0"</c:otherwise>
+						</c:choose>
+					</shiro:hasPermission>
+					<shiro:hasPermission name="ruralProject:ruralProjectView:workInvoiceAllView">
+					,"showView":1
+					</shiro:hasPermission>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+
+            // ,height: 315
+        });
+
+    })
+
+    resizeListTable();/*消除由于有竖向滚动条造成table出现横向滚动条*/
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+
+</body>
+</html>

+ 590 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoModify.jsp

@@ -0,0 +1,590 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>发票管理</title>
+	<meta name="decorator" content="default"/>
+	<style>
+		#workInvoiceProjectRelationList tr td{
+			padding: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+        var validateForm;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            //debugger
+            if(validateForm.form()){
+                if(obj == 2){
+                    $("#flag").val("no");
+                }else{
+                    $("#flag").val("yes");
+                }
+                $("#inputForm").submit();
+                return true;
+            }else {
+				parent.layer.msg("信息未填写完整!", {icon: 5});
+			}
+            return false;
+        }
+        $(document).ready(function() {
+            /*$('#money').keyup(function(){
+                var c=$(this);
+                if(/[^\d]/.test(c.val())){//替换非数字字符
+                    var temp_amount=c.val().replace(/[^\d]/g,'');
+                    $(this).val(temp_amount);
+                }
+            })*/
+            jQuery.validator.addMethod("isUscCode", function(value, element) {
+                if (this.optional(element)){
+                    return true;
+                }
+                var uscCode = /^((\w{15})|(\w{18})|(\w{20}))$/;
+                return uscCode.test(value);
+            }, "请填写正确的纳税人识别号");
+
+            $("input[name='ext']").on('ifChecked', function(event){
+                var radioVal = $(this).val();
+                if(radioVal == 0){
+                    $("#td1").removeClass("hide");
+                    $("#td2").addClass("hide");
+                    $("#tr1").show()
+                }else{
+                    $("#td1").addClass("hide");
+                    $("#td2").removeClass("hide");
+                    $("#tr1").hide()
+                }
+            });
+            if("${workInvoice.ext}" == "1"){
+                $("#ext1").iCheck('check')
+            }else{
+                $("#ext").iCheck('check')
+            }
+            if("${workInvoice.invoiceType}" == "1"){
+                $("#invoiceType1").iCheck('check');
+                $(".invoicetype").show();
+            }else{
+                $("#invoiceType").iCheck('check');
+                $(".invoicetype").hide();
+            }
+            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);
+                    }
+                }
+            });
+
+            $("input[name='invoiceType']").on('ifChecked', function(event){
+                var radioVal = $(this).val();
+                //专票必填
+                if(radioVal == 1){
+                    $(".invoicetype").show();
+                    $("#bank").attr("class","form-control required layui-input");
+                    $("#bankNumber").attr("class","form-control number required layui-input");
+                    $("#orUnicode").attr("class","form-control isUscCode required layui-input");
+                    $("#address").attr("class","form-control required layui-input");
+                    $("#telephone").attr("class","form-control isTel required layui-input");
+                }else if(radioVal == 2){
+                    $(".invoicetype").hide();
+                    $("#bank").attr("class","form-control layui-input");
+                    $("#bankNumber").attr("class","form-control number layui-input");
+                    $("#orUnicode").attr("class","form-control isUscCode layui-input");
+                    $("#address").attr("class","form-control layui-input");
+                    $("#telephone").attr("class","form-control isTel layui-input");
+                }
+            });
+
+        });
+        function setValuee(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getWorkClientInfo',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#bank").val(d.bank);
+                    $("#orUnicode").val(d.orUnicode);
+                    $("#bankNumber").val(d.bankNumber);
+                    $("#telephone").val(d.telephone);
+                    $("#address").val(d.adress);
+                    $("#ids").val(d.ids);
+                }
+            })
+        }
+        function setDp(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getUserDp',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#dp").val(d.dp);
+                }
+            })
+        }
+        function setPNumber(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/getPNumber',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#pNumber").val(d.pNumber);
+                    $("#cInfoName").val(d.cInfoName);
+                    $("#cName").val(d.cName);
+                    $("#officeName").val(d.officeName);
+                    $("#officeId").val(d.officeId);
+					$("#prdNumber").val(d.prdNumber);
+                }
+            })
+        }
+
+        function addRow(list, idx, tpl, row){
+            var idx1 = $("#workAccountList tr").length;
+            if(list == '#workAccountList' && idx1 < 100){
+                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");
+                    }
+                }
+            });
+        }
+        /*function delRow(obj, prefix) {
+            var id = $(prefix + "_id");
+            var delFlag = $(prefix + "_delFlag");
+            if (id.val() == "") {
+                $(obj).parent().parent().remove();
+            } else if (delFlag.val() == "0") {
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            } else if (delFlag.val() == "1") {
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+            // var idx1 = $("#workAccountList tr").length; //tr 总数
+            // for (var i = 0; i < idx1; i++) {
+            //     $("#workAccountList tr").eq(i).find("td").eq(1).html(i + 1);
+            // }
+        }*/
+        function provinceForShort(province){
+            if(province == "北京市")
+                return "京";
+            else if(province == "天津市")
+                return "津";
+            else if(province == "重庆市")
+                return "渝";
+            else if(province == "上海市")
+                return "沪";
+            else if(province == "河北省")
+                return "冀";
+            else if(province == "山西省")
+                return "晋";
+            else if(province == "辽宁省")
+                return "辽";
+            else if(province == "吉林省")
+                return "吉";
+            else if(province == "黑龙江省")
+                return "黑";
+            else if(province == "江苏省")
+                return "苏";
+            else if(province == "浙江省")
+                return "浙";
+            else if(province == "安徽省")
+                return "皖";
+            else if(province == "福建省")
+                return "闽";
+            else if(province == "江西省")
+                return "赣";
+            else if(province == "山东省")
+                return "鲁";
+            else if(province == "河南省")
+                return "豫";
+            else if(province == "湖北省")
+                return "鄂";
+            else if(province == "湖南省")
+                return "湘";
+            else if(province == "广东省")
+                return "粤";
+            else if(province == "海南省")
+                return "琼";
+            else if(province == "四川省")
+                return "川/蜀";
+            else if(province == "贵州省")
+                return "黔/贵";
+            else if(province == "云南省")
+                return "云/滇";
+            else if(province == "陕西省")
+                return "陕/秦";
+            else if(province == "甘肃省")
+                return "甘/陇";
+            else if(province == "青海省")
+                return "青";
+            else if(province == "台湾省")
+                return "台";
+            else if(province == "内蒙古自治区")
+                return "内蒙古";
+            else if(province == "广西壮族自治区")
+                return "桂";
+            else if(province == "宁夏回族自治区")
+                return "宁";
+            else if(province == "新疆维吾尔自治区 ")
+                return "新";
+            else if(province == "西藏自治区")
+                return "藏";
+            else if(province == "香港特别行政区")
+                return "港";
+            else if(province == "澳门特别行政区")
+                return "澳";
+        }
+
+        function setVs(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('allPrice','proportion');
+            var value = obj.value;
+            var p = $("#price").val() || 0;
+            if(!p || p == 0){
+                parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+                return;
+            }
+            var num = value/p ;
+            if(!/^\d+(\.\d{1,2})?$/.test( value )){
+                parent.layer.msg("合价必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+            }
+        }
+        function setTaxMoney(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('tax','taxMoney');
+            var t = a.replace('tax','totalMoney');
+            var tr = a.replace('tax','taxRate');
+            var value = obj.value || 0;
+            console.log("-value----"+value);
+            var tax = 1 + value/100;
+            console.log("-tax----"+tax);
+            var p = $("#" +  t ).val() || 0;//获取开票金额
+            console.log("-----"+p);
+            if(!p || p == 0){
+                parent.layer.msg("请先填写开票金额,且不能为零",{icon:5});
+                return;
+            }
+            var num = p/tax || 0;
+            console.log("-----"+num);
+            if(!/^\d+(\.\d{1,2})?$/.test( tax )){
+                parent.layer.msg("税率必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+                var taxRate = p - num;
+                $("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+            }
+        }
+
+        /*function setV(obj){
+            var a =  $(obj).attr("id");
+            var b = $("#province").val();
+            var c = provinceForShort(b);//开票单位所在省/直辖市简称
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+			var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }*/
+        function setV(obj){
+            var a =  $(obj).attr("id");
+            var c = "京";
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+            var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/adminModify" method="post" class="form-horizontal">
+			<form:hidden path="id"/>
+			<form:hidden path="invoiceDate"/>
+			<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"/>
+			<form:hidden path="province" id="province"/>
+			<%--<form:hidden path="invoiceNumber"/>--%>
+
+			<div class="form-group layui-row first lw14">
+				<div class="form-group-label"><h2>发票项目信息</h2></div>
+				<div class="layui-table-body layui-item layui-col-xs12 form-table-container" >
+					<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+								<%--						<th width="100px">操作</th>--%>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						<c:forEach items="${workInvoice.workInvoiceProjectRelationList}" var="list">
+							<tr>
+								<td>
+									<a onclick="openDialogView('查看项目', '${ctx}/ruralProject/ruralProjectView/view?id=${list.projectId}','95%', '95%')">
+										<input type="text" value="${list.projectName}" readonly="readonly"  class="form-control"/></a>
+								</td>
+								<td>
+									<input type="text" value="${list.workContractName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td style="text-align:center;">
+									<input type="text" value="${list.projectNum}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.clientName}" readonly="readonly"  class="form-control"/>
+								</td>
+								<td>
+									<input type="text" value="${list.reportDataNum}" readonly="readonly"  class="form-control"/>
+								</td>
+									<%--								<td class="text-center op-td" >--%>
+									<%--									{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}--%>
+									<%--								</td>--%>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<div class="form-group layui-row first lw14">
+				<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" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.ext eq '0'}">本公司开票	</c:when><c:when test="${workInvoice.ext eq '1'}">上级公司开票</c:when></c:choose>"/>
+                        </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">
+						<input htmlEscape="false" readonly="true" style="background-color: #f1f1f1"  class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.invoiceType eq '1'}">专票</c:when><c:when test="${workInvoice.invoiceType eq '2'}">普票</c:when></c:choose>"/>
+					</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">
+						<input htmlEscape="false" readonly="true" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.client.name}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.orUnicode}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.address}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.telephone}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.bank}"/>
+					</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" style="background-color: #f1f1f1" class="form-control layui-input" value="${workInvoice.bankNumber}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">收款类型:</label>
+					<div class="layui-input-block">
+						<input id="chargeType" htmlEscape="false" readonly="true" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.chargeType}" />
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票内容:</label>
+					<div class="layui-input-block">
+						<input id="billingContent" htmlEscape="false" readonly="true"  style="background-color: #f1f1f1" class="form-control layui-input" value="${workInvoice.billingContent}" />
+					</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">
+						<input htmlEscape="false" readonly="true" style="background-color: #f1f1f1"  class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="##00.00"/>"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.content}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.drawerName}"/>
+					</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" style="background-color: #f1f1f1" class="form-control layui-input" value="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">对账人:</label>
+					<div class="layui-input-block  with-icon">
+						<input type="text"  readonly="true" value="${workInvoice.accountCheckingUserName}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">对账地区:</label>
+					<div class="layui-input-block  with-icon">
+						<input type="text"  readonly="true" value="${workInvoice.area.name}"  class="form-control layui-input" style="background-color: #f1f1f1" >
+					</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" style="background-color: #f1f1f1" class="form-control layui-input" value="<fmt:formatDate value="${workInvoice.takeDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label double-line">备注:</label>
+					<div class="layui-input-block">
+						<form:textarea path="remarks" readonly="true" htmlEscape="false" rows="4" class="form-control" style="background-color: #f1f1f1" />
+					</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="contentTable" class="table table-bordered table-condensed can-edit">
+						<thead>
+						<tr>
+							<th>发票代码</th>
+							<th><span class="require-item">*</span>发票号</th>
+							<th><span class="require-item">*</span>开票金额</th>
+							<th>税率</th>
+							<th>金额</th>
+							<th>税额</th>
+							<th>累计登记金额</th>
+						</tr>
+						</thead>
+						<tbody id="workAccountList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workAccountListTpl">//<!--
+                                    <tr id="workAccountList{{idx}}">
+                                        <td class="hide">
+                                            <input id="workAccountList{{idx}}_id" name="workAccountList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                            <input id="workAccountList{{idx}}_delFlag" name="workAccountList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                        </td>
+                                    	<td>
+                                        	<input id="workAccountList{{idx}}_code" name="workAccountList[{{idx}}].code" type="text" value="{{row.code}}"    class="form-control"/>
+                                   		 </td>
+                                    	 <td>
+                                        	<input id="workAccountList{{idx}}_number" name="workAccountList[{{idx}}].number" type="text" value="{{row.number}}"    class="form-control required"/>
+                                   		 </td>
+                                    	<td>
+                                            <input id="workAccountList{{idx}}_totalMoney"  name="workAccountList[{{idx}}].totalMoney" type="text" value="{{row.totalMoney}}"    class="form-control required"/>
+                                        </td>
+                                        <td>
+                                        <div class="input-group">
+                                            <input id="workAccountList{{idx}}_tax" onblur="setTaxMoney(this)" name="workAccountList[{{idx}}].tax" type="text" value="{{row.tax}}"    class="form-control number"/><span class="input-group-addon">%</span>
+                                            </div>
+
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList{{idx}}_taxMoney" name="workAccountList[{{idx}}].taxMoney" type="text" value="{{row.taxMoney}}"    class="form-control"/>
+                                        </td>
+										<td>
+                                            <input id="workAccountList{{idx}}_taxRate" name="workAccountList[{{idx}}].taxRate" type="text" value="{{row.taxRate}}"    class="form-control"/>
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList{{idx}}_incomeMoney" name="workAccountList[{{idx}}].incomeMoney" type="text" value="0"  readonly="true"  class="form-control"/>
+                                        </td>
+
+                                            <input id="workAccountList{{idx}}_state" name="workAccountList[{{idx}}].state"  type="hidden" value="正常"   class="form-control"/>
+
+                                            <input id="workAccountList{{idx}}_backSign" name="workAccountList[{{idx}}].backSign"  type="hidden" value="正常"  readonly="true"  class="form-control"/>
+
+                                            <input id="workAccountList{{idx}}_backNumber" name="workAccountList[{{idx}}].backNumber"  type="hidden" value=""  readonly="true"  class="form-control"/>
+
+                                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+                        var workAccountListRowIdx = 0, workAccountListTpl = $("#workAccountListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                        $(document).ready(function() {
+                            var data = ${fns:toJson(workInvoice.workAccountList)};
+                            for (var i=0; i<data.length; i++){
+                                addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, data[i]);
+                                workAccountListRowIdx = workAccountListRowIdx + 1;
+                            }
+                        });
+					</script></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" >
+					<act:flowChart procInsId="${workInvoice.act.procInsId}"/>
+					<act:histoicFlow procInsId="${workInvoice.act.procInsId}" />
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 590 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoReceiptForm.jsp

@@ -0,0 +1,590 @@
+<%@ 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 src="${ctxStatic}/common/html/js/script.js"></script>
+	<style>
+		td input{
+			margin-left:0px !important;
+			height: 42px !important;
+		}
+		#receiptTable td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  if(obj == 2){
+				  var length = $("#workReceiptList tr").length;
+				  var invoiceMoneyStr = $("#invoiceMoney").val();
+				  invoiceMoneyStr = invoiceMoneyStr.replace(/\,/g, "");
+				  var invoiceMoney = parseFloat(invoiceMoneyStr);
+				  if(length==0){
+					  parent.layer.msg('请录入收款信息',{icon:5});
+					  return false;
+				  }else{
+					  var moneys = 0;
+					  for(var i=0; i<length; i++) {
+						  //获取每一行的汇款金额
+						  var money = parseFloat(workReceiptList.rows[i].cells[2].getElementsByTagName("INPUT")[0].value);
+						  //计算所有汇款综合
+						  moneys = moneys+money;
+					  }
+				  }
+				  var flags=judgment();
+				  if (flags){
+					  if(moneys<invoiceMoney){
+						  layer.confirm('收款金额小于发票金额,确定收款吗?', {
+							  btn: ['确定', '关闭'],
+							  btn1: function(index, layero){
+								  var flags=judgment();
+								  if (flags){
+									  $("#inputForm").attr("action","${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/saveAffirmReceipt");
+								  }else{
+									  return flags;
+								  }
+								  $("#inputForm").submit();
+								  top.layer.close(index);//关闭对话框。
+								  //关闭iframe页面
+								  var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
+								  parent.layer.close(index);
+							  },btn2: function(index){
+							  }
+						  });
+					  }else if(moneys>invoiceMoney){
+						  parent.layer.msg('收款金额不得大于开票金额',{icon:5});
+						  return false;
+					  }else if(moneys == invoiceMoney){
+						  var flags=judgment();
+						  if (flags){
+							  $("#inputForm").attr("action","${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/saveAffirmReceipt");
+						  }else{
+							  return flags;
+						  }
+						  $("#inputForm").submit();
+						  top.layer.close();//关闭对话框。
+						  //关闭iframe页面
+						  var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
+						  parent.layer.close(index);
+					  }
+				  }else{
+					  return flags;
+				  }
+			  }else{
+			  	if(moneys > invoiceMoney){
+					parent.layer.msg('收款金额不能大于开票金额',{icon:5});
+					return false;
+				}
+				$("#inputForm").attr("action","${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/saveReceipt");
+				  $("#inputForm").submit();
+				  return true;
+			  }
+		  }
+		}
+		$(document).ready(function() {
+			$("#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);
+					}
+				}
+			});
+
+			laydate.render({
+				elem: '#receiptDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+				, trigger: 'click'
+			});
+		});
+
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
+
+		function addRow(list, idx, tpl, row){
+			var idx1 = $("#workReceiptList tr").length;
+			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");
+					}
+				}
+			});
+
+			laydate.render({
+				elem : (list+idx+"_receiptDate"),
+				event: 'focus',
+				type : 'date'
+				, trigger: 'click',
+				trigger: 'click'
+			});
+		}
+		function delRow(obj, prefix){
+			var id = $(prefix+"_id");
+			var delFlag = $(prefix+"_delFlag");
+			if (id.val() == ""){
+				$(obj).parent().parent().remove();
+			}else if(delFlag.val() == "0"){
+				delFlag.val("1");
+				$(obj).html("&divide;").attr("title", "撤回删除");
+				$(obj).parent().parent().addClass("error");
+				$(obj).parent().parent().addClass("hide");
+			}else if(delFlag.val() == "1"){
+				delFlag.val("0");
+				$(obj).html("&times;").attr("title", "删除");
+				$(obj).parent().parent().removeClass("error");
+			}
+
+		}
+	</script>
+</head>
+<body >
+<div class="single-form view-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/saveReceipt" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+
+			<div class="form-group layui-row first lw14">
+				<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="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+                            <input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectName"   type="text" value="{{row.projectName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						/*if($("#id").val()){
+							workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
+				</div>
+			</div>
+			<div class="form-group layui-row first lw14">
+				<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" readonly="true"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.ext eq '0'}">本公司开票	</c:when><c:when test="${workInvoice.ext eq '1'}">上级公司开票</c:when></c:choose>"/>
+					</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">
+						<input htmlEscape="false" readonly="true" style="background-color: #f1f1f1"   class="form-control layui-input" value="<c:choose><c:when test="${workInvoice.invoiceType eq '1'}">专票</c:when><c:when test="${workInvoice.invoiceType eq '2'}">普票</c:when></c:choose>"/>
+					</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">
+						<div class="input-group">
+							<input htmlEscape="false" readonly="true"  style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.number}"/>
+						</div>
+					</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">
+						<input htmlEscape="false" readonly="true" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.client.name}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.orUnicode}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.address}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.telephone}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.bank}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.bankNumber}"/>
+					</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">
+						<input htmlEscape="false" readonly="true" style="background-color: #f1f1f1" id="invoiceMoney" class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="##00.00"/>"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.content}"/>
+					</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" style="background-color: #f1f1f1"  class="form-control layui-input" value="${workInvoice.drawerName}"/>
+					</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" style="background-color: #f1f1f1" class="form-control layui-input" value="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">对账人:</label>
+					<div class="layui-input-block  with-icon">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${workInvoice.accountCheckingUserName}" style="background-color: #f1f1f1"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label">领票时间:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" style="background-color: #f1f1f1" class="form-control layui-input" value="<fmt:formatDate value="${workInvoice.takeDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="200px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workInvoice.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}"></td>
+											</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="${workInvoice.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>
+														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+													</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">
+				<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 details">
+						<thead>
+						<tr>
+							<th>发票代码</th>
+							<th>发票号</th>
+							<th>开票金额</th>
+							<th>税率</th>
+							<th>金额</th>
+							<th>税额</th>
+							<th>累计登记金额</th>
+							<th>发票状态</th><%--正常--%>
+							<th>被退标记</th>
+							<%--<th><span class="require-item">*</span>被退票号</th>
+							<th><span class="require-item">*</span>开票日期</th>--%>
+						</tr>
+						</thead>
+						<tbody id="workAccountList">
+						<c:if test="${not empty workInvoice.workAccountList}">
+						<c:forEach items="${workInvoice.workAccountList}" var="workAccount" varStatus="index">
+							<tr id="workAccountList${index.index}">
+								<td title="${workAccount.code}">
+										${workAccount.code}
+								</td>
+								<td title="${workAccount.number}">
+										${workAccount.number}
+								</td>
+
+								<td title="<fmt:formatNumber value="${workAccount.totalMoney}" pattern="##00.00"/>">
+									<fmt:formatNumber value="${workAccount.totalMoney}" pattern="##00.00"/>
+								</td>
+								<td title="${workAccount.tax}">
+										${workAccount.tax}
+								</td>
+								<td title="<fmt:formatNumber value="${workAccount.taxMoney}" pattern="##00.00"/>">
+									<fmt:formatNumber value="${workAccount.taxMoney}" pattern="##00.00"/>
+								</td>
+								<td title="<fmt:formatNumber value="${workAccount.taxRate}" pattern="##00.00"/>">
+									<fmt:formatNumber value="${workAccount.taxRate}" pattern="##00.00"/>
+								</td>
+								<td title="<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="##00.00"/>">
+									<fmt:formatNumber value="${workAccount.incomeMoney}" pattern="##00.00"/>
+								</td>
+								<td title="${workAccount.state}">
+										${workAccount.state}
+								</td>
+								<td title="${workAccount.backSign}">
+										${workAccount.backSign}
+								</td>
+								<%--<td title="${workAccount.backNumber}">
+										${workAccount.backNumber}
+								</td>
+								<td title="<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>">
+									<fmt:formatDate value="${workInvoice.invoiceDate}" pattern="yyyy-MM-dd"/>
+								</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">
+					<div class="layui-item nav-btns" style="padding-left:0px;">
+						<a class="nav-btn nav-btn-add"
+						   onclick="addRow('#workReceiptList', workClientBankRowIdx, workClientBankTpl);workClientBankRowIdx = workClientBankRowIdx + 1;"
+						   title="新增"><i class="fa fa-plus"></i> 新增</a>
+					</div>
+					<table id="receiptTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+							<th><span class="require-item">*</span>汇款单位</th>
+							<th><span class="require-item">*</span>汇款金额</th>
+							<th width="160px"><span class="require-item">*</span>汇款时间</th>
+							<th width="100px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="workReceiptList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workClientBankTpl">//<!--
+                                <tr id="workReceiptList{{idx}}">
+                                    <td class="hide">
+                                        <input id="workReceiptList{{idx}}_id" name="workReceiptList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                        <input id="workReceiptList{{idx}}_delFlag" name="workReceiptList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                    </td>
+                                    <td>
+                                        <input id="workReceiptList{{idx}}_companyName" placeholder="请输入汇款单位" name="workReceiptList[{{idx}}].companyName" value="{{row.companyName}}" style="text-align: center" class="form-control judgment "/>
+                                    </td>
+                                    <td>
+                                        <input id="workReceiptList{{idx}}_money" name="workReceiptList[{{idx}}].money" placeholder="请输入汇款金额" value="{{row.money}}" style="text-align: center" class="form-control number judgment"/>
+                                    </td>
+
+                                    <td>
+                                        <input lay-verify="date" readonly="true" placeholder="yyyy-MM-dd" autocomplete="off" id="workReceiptList{{idx}}_receiptDate" name="workReceiptList[{{idx}}].receiptDate" type="text" value="{{row.receiptDate}}" style="text-align: center" class="form-control judgment datetime required"/>
+                                    </td>
+
+                                    <td class="text-center op-td" width="10">
+                                        {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workReceiptList{{idx}}')" title="删除"><i class="fa fa-trash"></i>&nbsp;删除</span>{{/delBtn}}
+                                    </td>
+                                </tr>//-->
+					</script>
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+<script type="text/javascript">
+	var workClientBankRowIdx = 0,
+			workClientBankTpl = $("#workClientBankTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+	$(document).ready(function () {
+		var dataBank = ${fns:toJson(workInvoice.workReceiptList)};
+		for (var i = 0; i < dataBank.length; i++) {
+			addRow('#workReceiptList', workClientBankRowIdx, workClientBankTpl, dataBank[i]);
+			workClientBankRowIdx = workClientBankRowIdx + 1;
+		}
+	});
+
+</script>
+</body>
+</html>

+ 895 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoForm.jsp

@@ -0,0 +1,895 @@
+<%@ 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 src="${ctxStatic}/common/html/js/script.js"></script>
+	<style>
+		#contractTypeDoc-error{
+			top:80px;
+			left:0;
+		}
+		 /*超过5个汉字,调整label的长度,以下是配套的*/
+		 .layui-item .layui-form-label{
+			 width:90px;
+		 }
+		.form-group .layui-item .layui-input-block,
+		.query .layui-input-block {
+			margin-left: 116px;
+		}
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+        var validateForm;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            //debugger
+            if(validateForm.form()){
+                if(obj == 2){
+                    $("#inputForm").attr("action","${ctx}/workinvoiceTwo/workinvoiceTwo/store");
+                }else{
+					var flag=judgment();
+					var leng=$("#workInvoiceProjectRelationList tr").length;
+					if (leng==0){
+						flag=2;
+					}
+					if (flag==2){
+						parent.layer.msg("先添加项目信息!", {icon: 5});
+						return false;
+					}
+					if (flag){
+						$("#inputForm").attr("action","${ctx}/workinvoiceTwo/workinvoiceTwo/save");
+					}else if (!flags){
+						return flag;
+					}
+                }
+                $("#inputForm").submit();
+                return true;
+            }else {
+				parent.layer.msg("信息未填写完整!", {icon: 5});
+			}
+            return false;
+        }
+
+        $(document).ready(function() {
+			layui.use(['form', 'layer'], function () {
+				var form = layui.form;
+				form.on("radio(invoiceType)", function(event){
+					var radioVal = $(this).val();
+					//专票必填
+					if(radioVal == 1){
+						$(".invoicetype").show();
+						$("#bank").attr("class","form-control judgment layui-input");
+						$("#bankNumber").attr("class","form-control number judgment layui-input");
+						$("#orUnicode").attr("class","form-control isUscCode judgment layui-input");
+						$("#address").attr("class","form-control judgment layui-input");
+						$("#telephone").attr("class","form-control isTel judgment layui-input");
+					}else if(radioVal == 2){
+						$(".invoicetype").hide();
+						$("#bank").attr("class","form-control layui-input");
+						$("#bankNumber").attr("class","form-control number layui-input");
+						$("#orUnicode").attr("class","form-control isUscCode layui-input");
+						$("#address").attr("class","form-control layui-input");
+						$("#telephone").attr("class","form-control isTel layui-input");
+					}
+				});
+			});
+            /*$('#money').keyup(function(){
+                var c=$(this);
+                if(/[^\d]/.test(c.val())){//替换非数字字符
+                    var temp_amount=c.val().replace(/[^\d]/g,'');
+                    $(this).val(temp_amount);
+                }
+            })*/
+
+            jQuery.validator.addMethod("isUscCode", function(value, element) {
+                if (this.optional(element)){
+                    return true;
+                }
+                var uscCode = /^((\w{15})|(\w{18})|(\w{20}))$/;
+                return uscCode.test(value);
+            }, "请填写正确的纳税人识别号");
+
+            /* $("input[name='ext']").on('ifChecked', function(event){
+                 var radioVal = $(this).val();
+                 if(radioVal == 0){
+                     $("#td1").removeClass("hide");
+                     $("#td2").addClass("hide");
+                     $("#tr1").show()
+                 }else{
+                     $("#td1").addClass("hide");
+                     $("#td2").removeClass("hide");
+                     $("#tr1").hide()
+                 }
+             });*/
+            if("${workInvoice.ext}" == "1"){
+                $("#ext1").iCheck('check')
+            }else{
+                $("#ext").iCheck('check')
+            }
+            if("${workInvoice.invoiceType}" == "1"){
+                $("#invoiceType1").iCheck('check');
+                $(".invoicetype").show();
+            }else{
+                $("#invoiceType").iCheck('check');
+                $(".invoicetype").hide();
+            }
+            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);
+                    }
+                }
+            });
+
+
+            /*--------------*/
+			$("#attachment_btn").click(function () {
+				$("#attachment_file").click();
+			});
+        });
+
+        function setValuee(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getWorkClientInfo',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#bank").val(d.bank);
+                    $("#orUnicode").val(d.orUnicode);
+                    $("#bankNumber").val(d.bankNumber);
+                    $("#telephone").val(d.telephone);
+                    $("#address").val(d.registerAddress);
+                    $("#ids").val(d.ids);
+                }
+            })
+        }
+        function setDp(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getUserDp',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#dp").val(d.dp);
+                }
+            })
+        }
+        function setPNumber(obj,ids,isProject,details){
+			var idx=ids.split("_")[0]
+			if (isProject==1){
+				$.ajax({
+					type:'post',
+					url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getPNumber',
+					data:{
+						"obj":obj
+					},
+					success:function(data){
+						var d = JSON.parse(data);
+						var workContractName="#"+idx+"_workContractName";
+						var projectNum="#"+idx+"_projectNum";
+						var clientName="#"+idx+"_clientName";
+						var reportDataNum="#"+idx+"_reportDataNum";
+						$(workContractName).val(d.workContractName);
+						$(projectNum).val(d.projectNum);
+						$(clientName).val(d.clientName);
+						$(reportDataNum).val(d.reportDataNum);
+						var areaId = $("#areaId").val();
+						if(undefined ==areaId || null == areaId || '' == areaId){
+							$("#areaId").val(d.areaId);
+							$("#areaName").val(d.areaName);
+						}
+					}
+				})
+			}else if (isProject==2){
+				var workContractName="#"+idx+"_workContractName";
+				var detailsName="#"+idx+"_details";
+				$(workContractName).val(details);
+				$(detailsName).val(details);
+			}
+
+        }
+
+        function addRow(list, idx, tpl, row){
+            var idx1 = $("#workAccountList tr").length;
+            if(list == '#workAccountList' && idx1 < 100){
+                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");
+                    }
+                }
+            });
+        }
+
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
+
+       function delRow(obj, prefix) {
+            var id = $(prefix + "_invoiceId");
+            var delFlag = $(prefix + "_delFlag");
+            if (id.val() == "") {
+                $(obj).parent().parent().remove();
+            } else if (delFlag.val() == "0") {
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            } else if (delFlag.val() == "1") {
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+            // var idx1 = $("#workAccountList tr").length; //tr 总数
+            // for (var i = 0; i < idx1; i++) {
+            //     $("#workAccountList tr").eq(i).find("td").eq(1).html(i + 1);
+            // }
+        }
+        function provinceForShort(province){
+            if(province == "北京市")
+                return "京";
+            else if(province == "天津市")
+                return "津";
+            else if(province == "重庆市")
+                return "渝";
+            else if(province == "上海市")
+                return "沪";
+            else if(province == "河北省")
+                return "冀";
+            else if(province == "山西省")
+                return "晋";
+            else if(province == "辽宁省")
+                return "辽";
+            else if(province == "吉林省")
+                return "吉";
+            else if(province == "黑龙江省")
+                return "黑";
+            else if(province == "江苏省")
+                return "苏";
+            else if(province == "浙江省")
+                return "浙";
+            else if(province == "安徽省")
+                return "皖";
+            else if(province == "福建省")
+                return "闽";
+            else if(province == "江西省")
+                return "赣";
+            else if(province == "山东省")
+                return "鲁";
+            else if(province == "河南省")
+                return "豫";
+            else if(province == "湖北省")
+                return "鄂";
+            else if(province == "湖南省")
+                return "湘";
+            else if(province == "广东省")
+                return "粤";
+            else if(province == "海南省")
+                return "琼";
+            else if(province == "四川省")
+                return "川/蜀";
+            else if(province == "贵州省")
+                return "黔/贵";
+            else if(province == "云南省")
+                return "云/滇";
+            else if(province == "陕西省")
+                return "陕/秦";
+            else if(province == "甘肃省")
+                return "甘/陇";
+            else if(province == "青海省")
+                return "青";
+            else if(province == "台湾省")
+                return "台";
+            else if(province == "内蒙古自治区")
+                return "内蒙古";
+            else if(province == "广西壮族自治区")
+                return "桂";
+            else if(province == "宁夏回族自治区")
+                return "宁";
+            else if(province == "新疆维吾尔自治区 ")
+                return "新";
+            else if(province == "西藏自治区")
+                return "藏";
+            else if(province == "香港特别行政区")
+                return "港";
+            else if(province == "澳门特别行政区")
+                return "澳";
+        }
+
+        function setVs(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('allPrice','proportion');
+            var value = obj.value;
+            var p = $("#price").val() || 0;
+            if(!p || p == 0){
+                parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+                return;
+            }
+            var num = value/p ;
+            if(!/^\d+(\.\d{1,2})?$/.test( value )){
+                parent.layer.msg("合价必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+            }
+        }
+        function setTaxMoney(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('tax','taxMoney');
+            var t = a.replace('tax','totalMoney');
+            var tr = a.replace('tax','taxRate');
+            var value = obj.value || 0;
+            console.log("-value----"+value);
+            var tax = 1 + value/100;
+            console.log("-tax----"+tax);
+            var p = $("#" +  t ).val() || 0;//获取发票金额
+            console.log("-----"+p);
+            if(!p || p == 0){
+                parent.layer.msg("请先填写发票金额,且不能为零",{icon:5});
+                return;
+            }
+            var num = p/tax || 0;
+            console.log("-----"+num);
+            if(!/^\d+(\.\d{1,2})?$/.test( tax )){
+                parent.layer.msg("税率必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+                var taxRate = p - num;
+                $("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+            }
+        }
+
+        /*function setV(obj){
+            var a =  $(obj).attr("id");
+            var b = $("#province").val();
+            var c = provinceForShort(b);//开票单位所在省/直辖市简称
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+			var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }*/
+        function setV(obj){
+            var a =  $(obj).attr("id");
+            var c = "京";
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+            var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }
+		function insertTitle(tValue){
+			var list = "${workInvoice.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 = "115";
+				console.log(file);
+				var timestamp = new Date().getTime();
+
+				var storeAs = "workInvoice";
+				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 = "${workInvoice.workAttachments}";
+			var size = (list.split('url')).length-1;
+			var files = tValue;
+			for(var i = 0;i<files.length;i++) {
+				var file = files[i];
+				var attachmentId = "";
+				var attachmentFlag = "115";
+				var timestamp = new Date().getTime();
+
+				var storeAs = "workInvoice";
+				var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+				/*将这段字符串存到数据库即可*/
+				var divId = "_attachment";
+				$("#addFile" + divId).show();
+				multipartUploadWithStsCollection(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
+			}
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoiceTwo/workinvoiceTwo/save" method="post" class="layui-form">
+			<form:hidden path="id"/>
+			<form:hidden path="invoiceDate"/>
+			<form:hidden path="province" id="province"/>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>基本信息</h2></div>
+				<div class="layui-item nav-btns">
+					<a class="nav-btn nav-btn-add" onclick="addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl);workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+				</div>
+				<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+					<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+							<th width="100px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_details" name="workInvoiceProjectRelationList[{{idx}}].details" type="hidden" value="{{row.workContractName}}"/>
+                        </td>
+                        <td>
+                            <sys:gridselectcallprojecttss url="${ctx}/workinvoiceTwo/workinvoiceTwo/selectproject" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId"  value="{{row.projectId}}"  title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color: #fff"
+													labelValue="{{row.projectName}}" cssClass="form-control judgment layui-input" fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName"  isProject="{{row.isProject}}" details="{{row.details}}"></sys:gridselectcallprojecttss>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td class="text-center op-td" >
+                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						/*if($("#id").val()){
+							workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
+				</div>
+
+			</div>
+			<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 double-line"><span class="require-item">*</span>上级/本公司开票:</label>
+					<div class="layui-input-block">
+						<c:choose>
+							<c:when test="${workInvoice.invoiceState == 4}">
+								<c:choose>
+									<c:when test="${workInvoice.ext ==0}">
+										<input value = "本公司开票" readonly="true" class="form-control layui-input"/>
+									</c:when>
+									<c:otherwise>
+										<input value = "上级公司开票" readonly="true"  class="form-control layui-input"/>
+									</c:otherwise>
+								</c:choose>
+							</c:when>
+							<c:otherwise>
+								<input type="radio" class="i-checks" name="ext" checked id="ext" value="0">
+								<label for="ext">本公司开票</label>
+								<input type="radio" class="i-checks" name="ext" id="ext1" value="1">
+								<label for="ext1">上级公司开票</label>
+							</c:otherwise>
+						</c:choose>
+					</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">
+						<input type="radio" name="invoiceType" lay-filter="invoiceType" title="专票" checked id="invoiceType1" value="1">
+<%--						<label for="invoiceType1">专票</label>--%>
+						<input type="radio" name="invoiceType" lay-filter="invoiceType" title="普票" id="invoiceType" value="2">
+<%--						<label for="invoiceType">普票</label>--%>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line">发票申请编号:</label>
+					<div class="layui-input-block">
+						<div class="input-group">
+							<form:input path="number" htmlEscape="false" readonly="true"   class="form-control layui-input"/>
+							<span class="input-group-btn">
+								<label class="form-status"><c:choose><c:when test="${ empty workInvoice.invoiceState}">新添</c:when><c:otherwise>${fns:getDictLabel(workInvoice.invoiceState, 'audit_state','')}</c:otherwise>	</c:choose></label>
+							</span>
+						</div>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line"><span class="require-item">*</span>实际开票单位:</label>
+					<div class="layui-input-block with-icon">
+						<sys:gridselect url="${ctx}/workinvoiceTwo/workinvoiceTwo/selectclient" id="client" name="client.id"  value="${workInvoice.client.id}"  title="选择开票单位" labelName="workInvoice.client.name" cssStyle="background-color: #fff"
+										labelValue="${workInvoice.client.name}" cssClass="form-control judgment layui-input" fieldLabels="单位" fieldKeys="name" searchLabel="客户名称" searchKey="name" ></sys:gridselect>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line"><span class="require-item invoicetype">*</span>纳税人识别号:</label>
+					<div class="layui-input-block">
+						<form:input id="orUnicode" path="orUnicode" htmlEscape="false" placeholder="请输入纳税人识别号"   class="form-control isUscCode layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>地址:</label>
+					<div class="layui-input-block">
+						<form:input id="address" path="address" htmlEscape="false"  placeholder="请输入地址"  class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>电话:</label>
+					<div class="layui-input-block">
+						<form:input id="telephone" path="telephone" htmlEscape="false"  placeholder="请输入电话"  class="form-control isTel layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>开户银行:</label>
+					<div class="layui-input-block">
+						<form:input id ="bank"  path="bank" htmlEscape="false" placeholder="请输入开户银行"  class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>银行账号:</label>
+					<div class="layui-input-block">
+						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" placeholder="请输入银行账号"  class="form-control number layui-input"/>
+					</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:select  path="chargeType" class="form-control simple-select judgment">
+							<form:options items="${fns:getMainDictList('receipt_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+						</form:select>
+					</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:select path="billingContent" class="form-control simple-select judgment">
+							<form:options items="${fns:getMainDictList('billing_content')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+						</form:select>
+					</div>
+				</div>
+
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label double-line"><span class="require-item">*</span>发票金额(元):</label>
+					<div class="layui-input-block">
+							<%--<form:input id=""  path="money" htmlEscape="false" class="form-control number judgment layui-input"/>--%>
+						<input name="money" htmlEscape="false" placeholder="请输入发票金额" value="${workInvoice.money}" class="form-control judgment number layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label double-line">开票内容要求:</label>
+					<div class="layui-input-block">
+						<form:textarea path="content" id="contractTypeDoc" placeholder="请输入开票内容要求" htmlEscape="false" rows="4"    class="form-control"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票人:</label>
+					<div class="layui-input-block">
+						<form:input id=""  path="" htmlEscape="false" readonly="true"  class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票时间:</label>
+					<div class="layui-input-block">
+						<form:input id=""  path="" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">领票时间:</label>
+					<div class="layui-input-block">
+						<form:input id=""  path="" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+					</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">
+						<sys:treeselect id="master" name="accountCheckingUserId" value="${workInvoice.accountCheckingUserId}" labelName="accountCheckingUserName" labelValue="${workInvoice.accountCheckingUserName}"
+										cssStyle="background-color: #fff" title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label"><span class="require-item">*</span>对账地区:</label>
+					<div class="layui-input-block  with-icon">
+						<sys:treeselectArae id="area" name="area.id" value="${workInvoice.area.id}" labelName="area.name" labelValue="${workInvoice.area.name}"
+											cssStyle="background-color:#fff" title="区域" url="/sys/area/treeData" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="false" isAll="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label double-line">备注:</label>
+					<div class="layui-input-block">
+						<form:textarea path="remarks" placeholder="" htmlEscape="false" rows="4" class="form-control"/>
+					</div>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<div class="layui-item nav-btns">
+					<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+					<sys:collectSelect  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
+										name="linkman.id"  title="选择资料库"
+										cssClass="form-control judgment" fieldLabels="资料库" fieldKeys="name"
+										searchLabel="资料库" searchKey="fileName"></sys:collectSelect>
+				</div>
+				<div id="addFile_attachment" style="display: none" class="upload-progress">
+					<span id="fileName_attachment" ></span>
+					<b><span id="baifenbi_attachment" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="200px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workInvoice.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}"></td>
+											</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="${workInvoice.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>
+														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+													</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-xs12 form-table-container">
+					<table id="contentTable" class="table table-bordered table-condensed can-edit">
+						<thead>
+						<tr>
+							<th>发票代码</th>
+							<th>发票号</th>
+							<th>发票金额</th>
+							<th>税率</th>
+							<th>金额</th>
+							<th>税额</th>
+							<th>累计登记金额</th>
+							<th width="150px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="workAccountList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workAccountListTpl">//<!--
+                                    <tr id="workAccountList{{idx}}">
+                                        <td class="hide">
+                                            <input id="workAccountList{{idx}}_id" name="workAccountList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                            <input id="workAccountList{{idx}}_delFlag" name="workAccountList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                        </td>
+                                    	<td>
+                                        	<input id="workAccountList{{idx}}_code" name="workAccountList[{{idx}}].code" type="text" value="{{row.code}}"    class="form-control judgment"/>
+                                   		 </td>
+                                    	 <td>
+                                        	<input id="workAccountList{{idx}}_number" name="workAccountList[{{idx}}].number" type="text" value="{{row.number}}"    class="form-control judgment"/>
+                                   		 </td>
+                                    	<td>
+                                            <input id="workAccountList{{idx}}_totalMoney"  name="workAccountList[{{idx}}].totalMoney" type="text" value="{{row.totalMoney}}"    class="form-control judgment"/>
+                                        </td>
+                                        <td>
+                                        <div class="input-group">
+                                            <input id="workAccountList{{idx}}_tax" onblur="setTaxMoney(this)" name="workAccountList[{{idx}}].tax" type="text" value="{{row.tax}}"    class="form-control number judgment"/><span class="input-group-addon">%</span>
+                                            </div>
+
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList{{idx}}_taxMoney" name="workAccountList[{{idx}}].taxMoney" type="text" value="{{row.taxMoney}}"    class="form-control judgment"/>
+                                        </td>
+										<td>
+                                            <input id="workAccountList{{idx}}_taxRate" name="workAccountList[{{idx}}].taxRate" type="text" value="{{row.taxRate}}"    class="form-control judgment"/>
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList{{idx}}_incomeMoney" name="workAccountList[{{idx}}].incomeMoney" type="text" value="0"  readonly="true"  class="form-control judgment"/>
+                                        </td>
+
+                                            <input id="workAccountList{{idx}}_state" name="workAccountList[{{idx}}].state"  type="hidden" value="正常"   class="form-control"/>
+
+                                            <input id="workAccountList{{idx}}_backSign" name="workAccountList[{{idx}}].backSign"  type="hidden" value="正常"  readonly="true"  class="form-control judgment"/>
+
+                                            <input id="workAccountList{{idx}}_backNumber" name="workAccountList[{{idx}}].backNumber"  type="hidden" value=""  readonly="true"  class="form-control judgment"/>
+
+
+                                        <td class="text-center op-td">
+                                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workAccountList{{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,"");
+                        $(document).ready(function() {
+                            var data = ${fns:toJson(workInvoice.workAccountList)};
+                            for (var i=0; i<data.length; i++){
+                                addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, data[i]);
+                                workAccountListRowIdx = workAccountListRowIdx + 1;
+                            }
+                        });
+					</script>
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+
+</body>
+</html>

+ 894 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoList.jsp

@@ -0,0 +1,894 @@
+<%@ page import="com.jeeplus.modules.sys.utils.UserUtils" %>
+<%@ 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">
+        <%--var Srole = "<%= UserUtils.getSelectRole().getName()%>";--%>
+
+        $(document).ready(function() {
+            // laydate.render({
+            //     elem: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+            //     event: 'focus' //响应事件。如果没有传入event,则按照默认的click
+				// ,type:'datetime'
+            // });
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginContractDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endContractDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+        });
+        function openDialogre(title,url,width,height,target){
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url ,
+                skin:"three-btns",
+                btn: ['送审','暂存','关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                    return false;
+                },
+                btn3: function(index){
+                }
+            });
+
+        }
+
+        function openDialogreplay(title,url,width,height,target){
+
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url ,
+                skin:"two-btns",
+                btn: ['送审','关闭'],
+                yes: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+
+                    if(iframeWin.contentWindow.doSubmit() ){
+                        top.layer.close(index);//关闭对话框。
+                        //setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+
+                },
+                cancel: function(index){
+                }
+            });
+        }
+
+        function receiptInvoice(title,url,width,height,target){
+
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+			top.layer.open({
+				type: 2,
+				area: [width, height],
+				title: title,
+				maxmin: true, //开启最大化最小化按钮
+				content: url ,
+				skin:"three-btns",
+				btn: ['保留','确认收款','关闭'],
+				btn1: function(index, layero){
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(1) ){
+						// top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}
+				},
+				btn2:function(index,layero){
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(2) ){
+						// top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}
+					return false;
+				},
+				btn3: function(index){
+				}
+			});
+        }
+
+        function contractOpenDialogre(title,url,width,height,target){
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: false, //开启最大化最小化按钮
+                skin:"three-btns",
+                content: url ,
+                btn: ['送审','暂存','关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                    return false;
+                },
+                btn3: function(index){
+                }
+            });
+
+        }
+
+		function openDialogreModify(title,url,id,width,height,target) {
+
+			if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+				width = 'auto';
+				height = 'auto';
+			} else {//如果是PC端,根据用户设置的width和height显示。
+
+			}
+
+			$.ajax({
+				async: false,
+				url: "${ctx}/workinvoiceTwo/workinvoiceTwo/getInvoiceExist?id="+id,
+				dataType: "json",
+				success: function (data) {
+					if(data.success){
+                        top.layer.open({
+                            type: 2,
+                            area: [width, height],
+                            title: title,
+                            maxmin: true, //开启最大化最小化按钮
+                            content: url ,
+                            skin:"two-btns",
+                            btn: ['送审','关闭'],
+                            yes: function(index, layero){
+                                var body = top.layer.getChildFrame('body', index);
+                                var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                                var inputForm = body.find('#inputForm');
+                                var top_iframe;
+                                if(target){
+                                    top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                                }else{
+                                    top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                                }
+                                inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+
+                                if(iframeWin.contentWindow.doSubmit() ){
+                                    top.layer.close(index);//关闭对话框。
+                                    //setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                                }
+
+                            },
+                            cancel: function(index){
+                            }
+                        });
+					}else{
+						top.layer.msg("该发票信息已删除!", {icon: 0});
+						window.location.reload();
+					}
+				}
+			});
+
+
+		}
+
+
+		//打开对话框(查看)
+		function openDialogListView(title,url,id,width,height){
+
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			$.ajax({
+				async: false,
+				url: "${ctx}/workinvoiceTwo/workinvoiceTwo/getInvoiceExist?id="+id,
+				dataType: "json",
+				success: function (data) {
+					if(data.success){
+						top.layer.open({
+							type: 2,
+							skin: 'one-btn',
+							area: [width, height],
+							title: title,
+							maxmin: true, //开启最大化最小化按钮
+							content: url ,
+							btn: ['关闭'],
+							cancel: function(index){
+							}
+						});
+					}else{
+						top.layer.msg("该发票信息已删除!", {icon: 0});
+						window.location.reload();
+					}
+				}
+			});
+
+		}
+
+	</script>
+	<script>
+
+		function notifyDialogre(title,url,width,height,target){
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			top.layer.open({
+				type: 2,
+				area: [width, height],
+				title: title,
+				skin:"three-btns",
+				maxmin: true, //开启最大化最小化按钮
+				content: url ,
+				btn: ['通过','驳回','关闭'],
+				btn1: function(index, layero){
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(1) ){
+						top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}
+				},
+				btn2:function(index,layero){
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(2) ){
+						top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}
+					return false;
+				},
+				btn3: function(index){
+				}
+			});
+
+		}
+		function cBlur(obj) {
+			var id = $("#accountCheckingUserId").val();
+			if(undefined != obj.value && null != obj.value && '' != obj.value){
+				$.ajax({
+					url:'${ctx}/sys/user/getUserByName?name='+obj.value,
+					type:"post",
+					success:function(data){
+						var user = data.body.data;
+						if(undefined == user || null == user || '' == user){
+							$("#accountCheckingUserId").val("");
+						}else{
+							if(data.body.data.id != id){
+								if(undefined != id && null != id && '' != id){
+									$("#accountCheckingUserId").val("");
+								}
+							}
+						}
+					}
+				});
+			}else{
+				$("#accountCheckingUserId").val("");
+			}
+
+		}
+		function blurSubmitterId(obj) {
+			var id = $("#submitterId").val();
+			if(undefined != obj.value && null != obj.value && '' != obj.value){
+				$.ajax({
+					url:'${ctx}/sys/user/getUserByName?name='+obj.value,
+					type:"post",
+					success:function(data){
+						var user = data.body.data;
+						if(undefined == user || null == user || '' == user){
+							$("#submitterId").val("");
+						}else{
+							if(data.body.data.id != id){
+								if(undefined != id && null != id && '' != id){
+									$("#submitterId").val("");
+								}
+							}
+						}
+					}
+				});
+			}else{
+				$("#submitterId").val("");
+			}
+
+		}
+		function readDetailInfo(obj,numbers) {
+			if(numbers!=undefined && numbers!=""){
+				var vals=numbers.split(",");
+				var value="";
+				for (var i=0;i<vals.length;i++){
+					value+=vals[i]+"</br>"
+				}
+				if (vals.length>0){
+					layer.tips(value, obj, {
+						tips: [3, '#000'],
+						area: ['250px', 'auto'],
+						time: 3000
+					});
+				}
+			}
+		}
+
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row ">
+		<%--<div class="full-width fl">
+			<div class=" contentShadow shadowLTR list-form-tab" id="tabDiv">
+				<ul class="list-tabs" >
+					<li class="active"><a href="${ctx}/workinvoice/workInvoice/list">发票管理</a></li>
+					<li><a href="${ctx}/workinvoicealter/workInvoiceAlter/list">发票变更</a></li>
+				</ul>
+			</div>
+		</div>--%>
+		<div class="full-width fl">
+			<div class=" layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="workInvoiceShow" action="${ctx}/workinvoiceTwo/workinvoiceTwo/" method="post" class="form-inline">
+				<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+				<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+				<input id="toflag" name="toflag" type="hidden" value="1"/>
+				<%--<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->--%>
+
+					<div class="commonQuery lw9">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">发票申请编号:</label>
+							<div class="layui-input-block">
+								<form:input path="number" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">开票金额:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="money" htmlEscape="false"  class=" form-control layui-input"/>
+							</div>
+						</div>
+
+						<%--<div class="layui-item query athird">
+							<label class="layui-form-label">项目编号:</label>
+							<div class="layui-input-block">
+								<form:input path="project.projectId" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">项目名称:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="project.projectName" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+							</div>
+						</div>--%>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<div class="layui-btn-group search-spacing">
+									<button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+									<button id="searchReset" class="layui-btn layui-btn-sm " onclick="resetSearch()">重置</button>
+								</div>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+					<div id="moresees" class="lw9" style="clear:both;display:none;">
+						<%--<div class="layui-item query athird">
+							<label class="layui-form-label">报告号名称:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="project.reportData.number" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+							</div>
+						</div>--%>
+							<div class="layui-item query athird">
+								<label class="layui-form-label">对账人:</label>
+								<div class="layui-input-block with-icon">
+									<sys:inquireselectUserNotReadolny id="accountCheckingUser" name="accountCheckingUserId" value="${workInvoice.accountCheckingUserId}" labelName="accountCheckingUserName" labelValue="${workInvoice.accountCheckingUserName}" cssStyle="background-color: #fff"
+																	  title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+								</div>
+							</div>
+							<div class="layui-item query athird">
+								<label class="layui-form-label">对账地区:</label>
+								<div class="layui-input-block  with-icon">
+									<sys:treeselectArae id="area" name="area.id" value="${workInvoice.area.id}" labelName="area.name" labelValue="${workInvoice.area.name}"
+														cssStyle="background-color:#fff" title="区域" url="/sys/area/treeData" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false" isAll="true"/>
+								</div>
+							</div>
+
+							<div class="layui-item query athird">
+								<label class="layui-form-label">开票日期:</label>
+								<div class="layui-input-block">
+									<input id="beginContractDate" name="beginContractDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group" style="background-color: #fff"
+										   value="<fmt:formatDate value="${workInvoice.beginContractDate}" pattern="yyyy-MM-dd"/>"/>
+									</input>
+									<span class="group-sep">-</span>
+									<input id="endContractDate" name="endContractDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group" style="background-color: #fff"
+										   value="<fmt:formatDate value="${workInvoice.endContractDate}" pattern="yyyy-MM-dd"/>"/>
+									</input>
+								</div>
+							</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">经办人部门:</label>
+							<div class="layui-input-block with-icon">
+								<sys:treeselect id="officeId" name="officeId" value="${workInvoice.officeId}" labelName="officeName" labelValue="${workInvoice.officeName}" cssStyle="background-color: #fff"
+												title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">经办人:</label>
+							<div class="layui-input-block with-icon">
+								<sys:inquireselectUserNotReadolnyTow id="submitter" name="submitterId" value="${workInvoice.submitterId}" labelName="submitterName" labelValue="${workInvoice.submitterName}" cssStyle="background-color: #fff"
+												title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">开票单位:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="client.name" htmlEscape="false"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">是否收款:</label>
+							<div class="layui-input-block with-icon">
+								<select id="receiptMoney" name="receiptMoney" class="form-control simple-select">
+									<option value=""></option>
+									<option value="0" <c:if test="${workInvoiceShow.receiptMoney=='0'}">selected</c:if>>否</option>
+									<option value="1" <c:if test="${workInvoiceShow.receiptMoney=='1'}">selected</c:if>>是</option>
+								</select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">发票类型:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="invoiceType" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('invoice_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">状态:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="invoiceState" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getDictList('invoice_audit_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">收款类型:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="chargeType" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('receipt_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">开票内容:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="billingContent" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('billing_content')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class=" contentShadow shadowLBR layui-form contentDetails">
+				<div class="nav-btns">
+					<div class="layui-btn-group" style="float: left">
+						<shiro:hasPermission name="workinvoice:workInvoice:add">
+							<button class="layui-btn layui-btn-sm layui-bg-blue" title="发票管理" onclick="openDialogre('发票管理','${ctx}//workinvoiceTwo/workinvoiceTwo/form','95%','95%')">&nbsp;添加</button>
+						</shiro:hasPermission>
+						<shiro:hasPermission name="workinvoiceTwo:workinvoiceTwo:export">
+							<table:exportExcel url="${ctx}/workinvoiceTwo/workinvoiceTwo/export"></table:exportExcel><!-- 导出按钮 -->
+						</shiro:hasPermission>
+						<button class="layui-btn layui-btn-sm layui-bg-green" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+						<div class=" layui-btn-sm" style="float: right;width: 300px">
+							<span style="color: red">金额汇总(开票金额):${sumMoney}(元)</span>
+						</div>
+					</div>
+
+
+					<div style="clear: both;"></div>
+				</div>
+				<table class="oa-table layui-table" id="contentTable"></table>
+
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+    <div id="changewidth"></div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+            ,elem: '#contentTable'
+            ,page: false
+            ,cols: [[
+				//{checkbox: true, fixed: true},
+                {field:'index',align:'center', title: '序号',width:40}
+				,{field:'projName',align:'center', title: '项目名称', minWidth:160,templet:function(d){
+						if(1 == d.showView && d.showView != undefined){
+							return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/workinvoiceAll/workInvoiceAll/projectview?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
+						}else{
+							return "<span title='"+ d.projName +"'>" +d.projName+ "</span>";
+						}
+					}}
+                ,{field:'invoiceNum',align:'center', sort:true,title: '发票申请编号', minWidth:130,templet:function(d){
+                        return "<a class=\"attention-info\" title=\""+ d.invoiceNum +"\"href=\"javascript:void(0);\" onclick=\"openDialogListView('查看发票管理', '${ctx}/workinvoiceTwo/workinvoiceTwo/form?id=" + d.id + "&tabId=1','"+ d.id +"','95%', '95%')\">" + d.invoiceNum + "</a>";
+                    }}
+				// ,{field:'widNumber',align:'center', title: '发票号',  width:90,templet:function(d){
+				// 		return "<span title='"+ d.widNumber +"'>" + d.widNumber + "</span>";
+				// 	}}
+				,{field:'clientName', align:'center',title: '开票单位', minWidth:160,templet:function(d){
+						return "<span title='"+ d.clientName +"'>" + d.clientName + "</span>";
+					}}
+				,{field:'responsibleName', align:'center',title: '经办人', minWidth:80,templet:function(d){
+						return "<span title='"+ d.responsibleName +"'>" + d.responsibleName + "</span>";
+					}}
+				,{field:'officeName', align:'center',title: '经办单位',width:80,templet:function(d){
+						return "<span title='"+ d.officeName +"'>" + d.officeName + "</span>";
+					}}
+				,{field:'money',align:'center', title: '开票金额(元)',  width:110,templet:function(d){
+						var numbers = new Array();;
+						if (d.workAccountListStr.length>0){
+							for (var i=0;i<d.workAccountListStr.length;i++){
+								numbers[i]="发票号:"+d.workAccountListStr[i].number+" 发票金额:"+d.workAccountListStr[i].totalMoney;
+							}
+						}
+						var xml= "<span onmouseover=\"readDetailInfo(this,'"+numbers+"')\">" + d.money+"</span>" ;
+						return xml;
+					}}
+				// ,{field:'widTotalMoney',align:'center', title: '发票金额(元)',  width:120,templet:function(d){
+				// 		return "<span title='"+ d.widTotalMoney +"'>" + d.widTotalMoney + "</span>";
+				// 	}}
+				,{field:'billingContent',align:'center', title: '开票内容',  width:90,templet:function(d){
+						return "<span title='"+ d.billingContent +"'>" + d.billingContent + "</span>";
+					}}
+				,{field:'chargeType',align:'center', title: '收款类型',  width:90,templet:function(d){
+						return "<span title='"+ d.chargeType +"'>" + d.chargeType + "</span>";
+					}}
+				,{field:'invoiceType',align:'center', title: '发票类型',  width:90,templet:function(d){
+						return "<span title='"+ d.invoiceType +"'>" + d.invoiceType + "</span>";
+					}}
+
+                <%--,{field:'reportNumber',align:'center', title: '报告号', minWidth:150,templet:function(d){--%>
+				<%--		&lt;%&ndash;return "<a class=\"attention-info\" title=\"" + d.reportNumber + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看报告信息', '${ctx}/ruralProject/ruralProjectMessage/modify?projectId=" + d.projectId + "&view=view','95%', '95%')\">" + d.reportNumber + "</a>";&ndash;%&gt;--%>
+				<%--		return d.reportNumber;--%>
+                <%--    }}--%>
+                <%--,{field:'areaName',align:'center', title: '项目所在地', minWidth:80,templet:function(d){--%>
+                <%--        return "<span title='"+ d.areaName +"'>" + d.areaName + "</span>";--%>
+                <%--    }}--%>
+				,{field:'createDate',align:'center', sort:true,title: '开票日期',  width:80}
+				,{field:'receiptMoneyDate',align:'center', sort:true,title: '收款日期',  width:80}
+				,{field:'receiptMoney',align:'center', title: '是否收款',  width:80}
+				,{field:'cancellation',align:'center', title: '是否作废',  width:80}
+                ,{align:'center', title: '状态', fixed: 'right', width:70,templet:function(d){
+                        <%--var st = getAuditState(d.status);--%>
+
+                        <%--var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/workinvoice/workInvoice/getProcessOne?id=" + d.id + "','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";--%>
+                        <%--return xml;--%>
+                        var st = getAuditState(d.status);
+                        if(st.action)
+                            var xml = "<span onclick=\"openDialogListView('流程追踪', '${ctx}/workinvoiceTwo/workinvoiceTwo/getProcessOne?id=" + d.id + "','"+ d.id +"','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        else
+                            var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        return xml;
+                    }}
+                ,{field:'op',align:'center',title:"操作",fixed: 'right',width:130,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="<div class=\"layui-btn-group\">";
+
+						if(d.notifyFlag != undefined && d.notifyFlag !=null && "" != d.notifyFlag && d.notifyFlag == 1)
+						{
+							xml+="<button onclick=\"notifyDialogre('发票审批', '${ctx}/workprojectnotify/workProjectNotify/form?id=" + d.notifyId +"&home=invoice','95%', '95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 审批</button>";
+						}
+                        if(d.canedit1 != undefined && d.canedit1 =="1")
+                        {
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogre('修改发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/form?id=" + d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        }
+                        if(d.canedit2 != undefined && d.canedit2 =="1")
+                        {
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreModify('修改发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/form?id=" + d.id + "&tabId=3','"+ d.id +"','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        }
+                        if(d.canedit3 != undefined && d.canedit3 =="1")
+                        {
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('重新申请发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/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}/workinvoiceTwo/workinvoiceTwo/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该发票记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+                        }
+                        if(d.cancancel != undefined && d.cancancel =="1")
+                        {
+                            xml += "<a href=\"${ctx}/workinvoiceTwo/workinvoiceTwo/cancelInvalidate?id="+ d.id +"\" onclick=\"return confirmx('确认要强制撤回?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 撤回</a>";
+                        }
+                        /*if(d.canalter != undefined && d.canalter =="1")
+                        {
+                            xml += "<a href=\"javascript:void(0)\" onclick=\"contractOpenDialogre('变更发票管理', '${ctx}/workinvoiceTwo/workinvoiceTwo/alterForm?id="+ d.id +"','95%','95%')\" class=\"op-btn op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
+                        }*/
+
+						if(d.financeFlag != undefined && d.financeFlag =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"receiptInvoice('发票收款', '${ctx}/workinvoiceTwo/workinvoiceTwo/receiptForm?id=" + d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs  layui-bg-blue\" > 收款</a>";
+						}
+						if(d.cancellationFlag != undefined && d.cancellationFlag =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('作废发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/cancellationForm?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 作废</a>";
+						}
+						if(d.conditionCanedit != undefined && d.conditionCanedit =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('作废修改发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/cancellationForm?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 修改</a>";
+						}
+						if(d.conditionCanedit3 != undefined && d.conditionCanedit3 =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('重新申请发票', '${ctx}/workinvoiceTwo/workinvoiceTwo/cancellationForm?id=" + d.id + "&tabId=4','95%','95%')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 修改</a>";
+						}
+						if(d.conditionCandelete != undefined && d.conditionCandelete =="1")
+						{
+							xml += "<a href=\"${ctx}/workinvoiceTwo/workinvoiceTwo/cancellationDelete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该发票作废记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+						}
+						if(d.conditionCancancel != undefined && d.conditionCancancel =="1")
+						{
+							xml += "<a href=\"${ctx}/workinvoiceTwo/workinvoiceTwo/conditionCancelInvalidate?id="+ d.id +"\" onclick=\"return confirmx('确认要强制撤回?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 作废撤回</a>";
+						}
+
+						if(d.adminFlag != undefined && d.adminFlag =="1")
+						{
+							xml += "<a href=\"${ctx}/workinvoiceTwo/workinvoiceTwo/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该发票记录吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+						}
+						xml+="</div>"
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="workInvoice" varStatus="index"><c:set var="Srole" scope="session" value="<%= UserUtils.getSelectRole().get(0).getEnname()%>"/>
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${workInvoice.id}"
+                    ,"invoiceNum":"${workInvoice.number}"
+                    ,"chargeType":"${fns:getMainDictLabels(workInvoice.chargeType,',','receipt_type', '')}"
+                    ,"billingContent":"${fns:getMainDictLabels(workInvoice.billingContent,',','billing_content', '')}"
+                    ,"invoiceType":"${workInvoice.invoiceTypeStr}"
+                    ,"projNum":"${workInvoice.project.projectId}"
+                    ,"projectId":"${workInvoice.project.id}"
+                    ,"areaName":"${workInvoice.project.county}"
+                    ,"reportNumber":"${workInvoice.project.reportData.number}"
+                    ,"projName":"${workInvoice.projectName}"
+                    ,"clientName":"${workInvoice.client.name}"
+                    ,"officeName":"${workInvoice.office.name}"
+                    ,"responsibleName":"${workInvoice.createBy.name}"
+                    ,"receiptMoney":"${workInvoice.receiptMoney}"
+                    ,"status":"${workInvoice.invoiceState}"
+					,"notifyFlag":"${workInvoice.notifyFlag}"
+					,"notifyId":"${workInvoice.notifyId}"
+					,"widNumber":"${workInvoice.widNumber}"
+					,"widTotalMoney":"${workInvoice.widTotalMoney}"
+					,"workAccountList":"${workInvoice.workAccountList}"
+					,"workAccountListStr":${fns:toJson(workInvoice.workAccountList)}
+                    ,"money":"<fmt:formatNumber value="${workInvoice.money}" pattern="##0.00"/>"
+                    ,"createDate":"<fmt:formatDate value="${workInvoice.createDate}" pattern="yyyy-MM-dd"/>"
+                    ,"receiptMoneyDate":"<fmt:formatDate value="${workInvoice.receiptMoneyDate}" pattern="yyyy-MM-dd"/>"
+                    <c:if test="${workInvoice.invoiceState == 1 && fns:getUser().id == workInvoice.createBy.id}"><shiro:hasPermission name="workinvoice:workInvoice:edit">,"canedit1":"1"</shiro:hasPermission></c:if><%--暂存-修改--%>
+                    <c:if test="${workInvoice.invoiceState == '4' && fns:getUser().id == workInvoice.createBy.id}">,"canedit2":"1"</c:if><%--驳回--修改--%>
+                    <c:if test="${workInvoice.invoiceState == '9' && fns:getUser().id == workInvoice.createBy.id}">,"conditionCanedit":"1"</c:if><%--驳回--修改--%>
+                    <c:if test="${workInvoice.invoiceState == '11' && fns:getUser().id == workInvoice.createBy.id}">,"conditionCanedit3":"1"</c:if><%--作废撤回--修改--%>
+                    <c:if test="${workInvoice.invoiceState == '3' && fns:getUser().id == workInvoice.createBy.id}">,"canedit3":"1"</c:if><%--撤回--修改--%>
+                    <c:if test="${fns:getUser().id == workInvoice.createBy.id}"><c:if test="${workInvoice.invoiceState == '1' or workInvoice.invoiceState == '3' or workInvoice.invoiceState == '4'}"><shiro:hasPermission name="workinvoice:workInvoice:del">,"candelete":"1"</shiro:hasPermission></c:if></c:if>
+                    <c:if test="${fns:getUser().id == workInvoice.createBy.id}"><c:if test="${workInvoice.invoiceState == '9' || workInvoice.invoiceState == '11' }">,"conditionCandelete":"1"</c:if></c:if>
+                    <c:if test="${workInvoice.invoiceState == '2' && fns:getUser().id == workInvoice.createBy.id}">,"cancancel":"1"</c:if>
+                    <c:if test="${workInvoice.invoiceState == '6' && fns:getUser().id == workInvoice.createBy.id}">,"conditionCancancel":"1"</c:if>
+					<c:if test="${workInvoice.invoiceState == '5' && fns:getUser().id == workInvoice.createBy.id}">,"cancellationFlag":"1"</c:if>
+
+
+					<shiro:hasPermission name="workinvoice:workInvoice:alteredit">
+                    <c:if test="${workInvoice.invoiceState == '5'}">,"canalter":"1"</c:if>
+                    </shiro:hasPermission>
+					,"cancellation":<c:choose>
+							<c:when test="${workInvoice.invoiceState == '7'}">"是"</c:when>
+					<c:otherwise>"否"</c:otherwise>
+					</c:choose>
+					<shiro:hasPermission name="ruralProject:ruralProjectView:workInvoiceView">
+					,"showView":1
+					</shiro:hasPermission>
+<%--					<shiro:hasPermission name="workinvoice:workInvoice:receipt">--%>
+<%--						,"financeFlag":--%>
+<%--							<c:choose>--%>
+<%--								<c:when test="${workInvoice.invoiceState == 5 && workInvoice.receiptMoney == '否'}">"1"</c:when>--%>
+<%--								<c:otherwise>"0"</c:otherwise>--%>
+<%--						</c:choose>--%>
+<%--					</shiro:hasPermission>--%>
+<%--					<shiro:hasPermission name="workinvoice:workInvoice:invalid">--%>
+<%--						,"cancellationFlag":--%>
+<%--							<c:choose>--%>
+<%--								<c:when test="${workInvoice.invoiceState == 5}">"1"</c:when>--%>
+<%--								<c:otherwise>"0"</c:otherwise>--%>
+<%--						</c:choose>--%>
+<%--					</shiro:hasPermission>--%>
+<%--					<shiro:hasPermission name="workinvoice:workInvoice:adminDel">--%>
+<%--						,"adminFlag":--%>
+<%--							<c:choose>--%>
+<%--								<c:when test="${workInvoice.invoiceState == 5}">"1"</c:when>--%>
+<%--								<c:otherwise>"0"</c:otherwise>--%>
+<%--						</c:choose>--%>
+<%--					</shiro:hasPermission>--%>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+            // ,height: 315
+        });
+
+    })
+
+    resizeListTable();/*消除由于有竖向滚动条造成table出现横向滚动条*/
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+
+</body>
+</html>

+ 923 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoModify.jsp

@@ -0,0 +1,923 @@
+<%@ 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 src="${ctxStatic}/common/html/js/script.js"></script>
+	<style>
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+        var validateForm;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            //debugger
+            if(validateForm.form()){
+                if(obj == 2){
+                    $("#flag").val("no");
+                }else{
+					var flags=judgment();
+					var leng=$("#workInvoiceProjectRelationList tr").length;
+					if (leng==0){
+						flags=2;
+					}
+					if (flags==2){
+						parent.layer.msg("先添加项目信息!", {icon: 5});
+						return false;
+					}
+					if (flags){
+						$("#flag").val("yes");
+					}else if (!flags){
+						return flags;
+					}
+                }
+                $("#inputForm").submit();
+                return true;
+            }else {
+				parent.layer.msg("信息未填写完整!", {icon: 5});
+			}
+            return false;
+        }
+        $(document).ready(function() {
+			layui.use(['form', 'layer'], function () {
+				var form = layui.form;
+				form.on("radio(invoiceType)", function(event){
+					var radioVal = $(this).val();
+					//专票必填
+					if(radioVal == 1){
+						$(".invoicetype").show();
+						$("#bank").attr("class","form-control judgment layui-input");
+						$("#bankNumber").attr("class","form-control number judgment layui-input");
+						$("#orUnicode").attr("class","form-control isUscCode judgment layui-input");
+						$("#address").attr("class","form-control judgment layui-input");
+						$("#telephone").attr("class","form-control isTel judgment layui-input");
+					}else if(radioVal == 2){
+						$(".invoicetype").hide();
+						$("#bank").attr("class","form-control layui-input");
+						$("#bankNumber").attr("class","form-control number layui-input");
+						$("#orUnicode").attr("class","form-control isUscCode layui-input");
+						$("#address").attr("class","form-control layui-input");
+						$("#telephone").attr("class","form-control isTel layui-input");
+					}
+				});
+			});
+            /*$('#money').keyup(function(){
+                var c=$(this);
+                if(/[^\d]/.test(c.val())){//替换非数字字符
+                    var temp_amount=c.val().replace(/[^\d]/g,'');
+                    $(this).val(temp_amount);
+                }
+            })*/
+            jQuery.validator.addMethod("isUscCode", function(value, element) {
+                if (this.optional(element)){
+                    return true;
+                }
+                var uscCode = /^((\w{15})|(\w{18})|(\w{20}))$/;
+                return uscCode.test(value);
+            }, "请填写正确的纳税人识别号");
+
+            $("input[name='ext']").on('ifChecked', function(event){
+                var radioVal = $(this).val();
+                if(radioVal == 0){
+                    $("#td1").removeClass("hide");
+                    $("#td2").addClass("hide");
+                    $("#tr1").show()
+                }else{
+                    $("#td1").addClass("hide");
+                    $("#td2").removeClass("hide");
+                    $("#tr1").hide()
+                }
+            });
+            if("${workInvoice.ext}" == "1"){
+                $("#ext1").iCheck('check')
+            }else{
+                $("#ext").iCheck('check')
+            }
+            if("${workInvoice.invoiceType}" == "1"){
+                $("#invoiceType1").iCheck('check');
+                $(".invoicetype").show();
+            }else{
+                $("#invoiceType").iCheck('check');
+                $(".invoicetype").hide();
+            }
+            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);
+                    }
+                }
+            });
+
+            // $("input[name='invoiceType']").on('ifChecked', function(event){
+            //     var radioVal = $(this).val();
+            //     //专票必填
+            //     if(radioVal == 1){
+            //         $(".invoicetype").show();
+            //         $("#bank").attr("class","form-control required layui-input");
+            //         $("#bankNumber").attr("class","form-control number required layui-input");
+            //         $("#orUnicode").attr("class","form-control isUscCode required layui-input");
+            //         $("#address").attr("class","form-control required layui-input");
+            //         $("#telephone").attr("class","form-control isTel required layui-input");
+            //     }else if(radioVal == 2){
+            //         $(".invoicetype").hide();
+            //         $("#bank").attr("class","form-control layui-input");
+            //         $("#bankNumber").attr("class","form-control number layui-input");
+            //         $("#orUnicode").attr("class","form-control isUscCode layui-input");
+            //         $("#address").attr("class","form-control layui-input");
+            //         $("#telephone").attr("class","form-control isTel layui-input");
+            //     }
+            // });
+			$("#attachment_btn").click(function () {
+				$("#attachment_file").click();
+			});
+        });
+        function setValuee(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getWorkClientInfo',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#bank").val(d.bank);
+                    $("#orUnicode").val(d.orUnicode);
+                    $("#bankNumber").val(d.bankNumber);
+                    $("#telephone").val(d.telephone);
+                    $("#address").val(d.adress);
+                    $("#ids").val(d.ids);
+                }
+            })
+        }
+        function setDp(obj){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getUserDp',
+                data:{
+                    "obj":obj
+                },
+                success:function(data){
+                    var d = JSON.parse(data);
+                    $("#dp").val(d.dp);
+                }
+            })
+        }
+		function setPNumber(obj,ids,isProject,details){
+			var idx=ids.split("_")[0]
+			if (isProject==1){
+				$.ajax({
+					type:'post',
+					url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getPNumber',
+					data:{
+						"obj":obj
+					},
+					success:function(data){
+						var d = JSON.parse(data);
+						var workContractName="#"+idx+"_workContractName";
+						var projectNum="#"+idx+"_projectNum";
+						var clientName="#"+idx+"_clientName";
+						var reportDataNum="#"+idx+"_reportDataNum";
+						$(workContractName).val(d.workContractName);
+						$(projectNum).val(d.projectNum);
+						$(clientName).val(d.clientName);
+						$(reportDataNum).val(d.reportDataNum);
+						var areaId = $("#areaId").val();
+						if(undefined ==areaId || null == areaId || '' == areaId){
+							$("#areaId").val(d.areaId);
+							$("#areaName").val(d.areaName);
+						}
+					}
+				})
+			}else if (isProject==2){
+				var workContractName="#"+idx+"_workContractName";
+				var detailsName="#"+idx+"_details";
+				$(workContractName).val(details);
+				$(detailsName).val(details);
+			}
+		}
+
+        function addRow(list, idx, tpl, row){
+            var idx1 = $("#workAccountList tr").length;
+            if(list == '#workAccountList' && idx1 < 100){
+                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");
+                    }
+                }
+            });
+        }
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				// tpl = tpl.replace("workAccountList[0].financialSubjects","workAccountList["+idx1+"].financialSubjects");
+				// tpl = tpl.replace("workAccountList[0].financialSubjectss","workAccountList["+idx1+"].financialSubjectss");
+				/*var ext = $("input[name='ext']:checked").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\"");
+                }*/
+				// 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");
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+		function bornTemplete1(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");
+					}
+				}
+			});
+		}
+
+		function delRow1(obj, prefix) {
+			var id = $(prefix + "_invoiceId");
+			var delFlag = $(prefix + "_delFlag");
+			if (id.val() == "") {
+				$("#del").val("1")
+				$(obj).parent().parent().remove();
+			} else if (delFlag.val() == "0") {
+				delFlag.val("1");
+				$(obj).html("&divide;").attr("title", "撤回删除");
+				$(obj).parent().parent().addClass("error");
+				$(obj).parent().parent().addClass("hide");
+			} else if (delFlag.val() == "1") {
+				delFlag.val("0");
+				$(obj).html("&times;").attr("title", "删除");
+				$(obj).parent().parent().removeClass("error");
+			}
+			// var idx1 = $("#workAccountList tr").length; //tr 总数
+			// for (var i = 0; i < idx1; i++) {
+			//     $("#workAccountList tr").eq(i).find("td").eq(1).html(i + 1);
+			// }
+		}
+        /*function delRow(obj, prefix) {
+            var id = $(prefix + "_id");
+            var delFlag = $(prefix + "_delFlag");
+            if (id.val() == "") {
+                $(obj).parent().parent().remove();
+            } else if (delFlag.val() == "0") {
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            } else if (delFlag.val() == "1") {
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+            // var idx1 = $("#workAccountList tr").length; //tr 总数
+            // for (var i = 0; i < idx1; i++) {
+            //     $("#workAccountList tr").eq(i).find("td").eq(1).html(i + 1);
+            // }
+        }*/
+        function provinceForShort(province){
+            if(province == "北京市")
+                return "京";
+            else if(province == "天津市")
+                return "津";
+            else if(province == "重庆市")
+                return "渝";
+            else if(province == "上海市")
+                return "沪";
+            else if(province == "河北省")
+                return "冀";
+            else if(province == "山西省")
+                return "晋";
+            else if(province == "辽宁省")
+                return "辽";
+            else if(province == "吉林省")
+                return "吉";
+            else if(province == "黑龙江省")
+                return "黑";
+            else if(province == "江苏省")
+                return "苏";
+            else if(province == "浙江省")
+                return "浙";
+            else if(province == "安徽省")
+                return "皖";
+            else if(province == "福建省")
+                return "闽";
+            else if(province == "江西省")
+                return "赣";
+            else if(province == "山东省")
+                return "鲁";
+            else if(province == "河南省")
+                return "豫";
+            else if(province == "湖北省")
+                return "鄂";
+            else if(province == "湖南省")
+                return "湘";
+            else if(province == "广东省")
+                return "粤";
+            else if(province == "海南省")
+                return "琼";
+            else if(province == "四川省")
+                return "川/蜀";
+            else if(province == "贵州省")
+                return "黔/贵";
+            else if(province == "云南省")
+                return "云/滇";
+            else if(province == "陕西省")
+                return "陕/秦";
+            else if(province == "甘肃省")
+                return "甘/陇";
+            else if(province == "青海省")
+                return "青";
+            else if(province == "台湾省")
+                return "台";
+            else if(province == "内蒙古自治区")
+                return "内蒙古";
+            else if(province == "广西壮族自治区")
+                return "桂";
+            else if(province == "宁夏回族自治区")
+                return "宁";
+            else if(province == "新疆维吾尔自治区 ")
+                return "新";
+            else if(province == "西藏自治区")
+                return "藏";
+            else if(province == "香港特别行政区")
+                return "港";
+            else if(province == "澳门特别行政区")
+                return "澳";
+        }
+
+        function setVs(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('allPrice','proportion');
+            var value = obj.value;
+            var p = $("#price").val() || 0;
+            if(!p || p == 0){
+                parent.layer.msg("请先填写造价指标,且不能为零",{icon:5});
+                return;
+            }
+            var num = value/p ;
+            if(!/^\d+(\.\d{1,2})?$/.test( value )){
+                parent.layer.msg("合价必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+            }
+        }
+        function setTaxMoney(obj){
+            var a = $(obj).attr("id");
+            var b = a.replace('tax','taxMoney');
+            var t = a.replace('tax','totalMoney');
+            var tr = a.replace('tax','taxRate');
+            var value = obj.value || 0;
+            console.log("-value----"+value);
+            var tax = 1 + value/100;
+            console.log("-tax----"+tax);
+            var p = $("#" +  t ).val() || 0;//获取开票金额
+            console.log("-----"+p);
+            if(!p || p == 0){
+                parent.layer.msg("请先填写开票金额,且不能为零",{icon:5});
+                return;
+            }
+            var num = p/tax || 0;
+            console.log("-----"+num);
+            if(!/^\d+(\.\d{1,2})?$/.test( tax )){
+                parent.layer.msg("税率必须输入数字",{icon:5});
+            }else{
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+                var taxRate = p - num;
+                $("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+            }
+        }
+
+        /*function setV(obj){
+            var a =  $(obj).attr("id");
+            var b = $("#province").val();
+            var c = provinceForShort(b);//开票单位所在省/直辖市简称
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+			var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }*/
+        function setV(obj){
+            var a =  $(obj).attr("id");
+            var c = "京";
+            var date=new Date;
+            var year=date.getFullYear();
+            var month=date.getMonth()+1;
+            month =(month<10 ? "0"+month:month);
+            var mydate = (year.toString()+month.toString());
+            var timestamp="["+mydate+"]";//获取固定格式年月
+            var number = c+timestamp;
+            $("#" +  a ).val(number);
+        }
+		function insertTitle(tValue){
+			var list = "${workInvoice.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 = "115";
+				console.log(file);
+				var timestamp = new Date().getTime();
+
+				var storeAs = "workInvoice";
+				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 = "${workInvoice.workAttachments}";
+			var size = (list.split('url')).length-1;
+			var files = tValue;
+			for(var i = 0;i<files.length;i++) {
+				var file = files[i];
+				var attachmentId = "";
+				var attachmentFlag = "115";
+				var timestamp = new Date().getTime();
+
+				var storeAs = "workInvoice";
+				var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;
+				/*将这段字符串存到数据库即可*/
+				var divId = "_attachment";
+				$("#addFile" + divId).show();
+				multipartUploadWithStsCollection(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
+			}
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoiceTwo/workinvoiceTwo/saveAudit" method="post" class="form-horizontal layui-form">
+			<form:hidden path="id"/>
+			<form:hidden path="invoiceDate"/>
+			<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"/>
+			<form:hidden path="province" id="province"/>
+			<%--<form:hidden path="invoiceNumber"/>--%>
+
+			<div class="form-group layui-row first lw14">
+				<div class="form-group-label"><h2>基本信息</h2></div>
+				<div class="layui-item nav-btns">
+					<a class="nav-btn nav-btn-add" onclick="addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl);workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+				</div>
+				<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+					<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="200px"><font color="red">*</font>项目名称</th>
+							<th width="200px">合同名称</th>
+							<th width="200px">项目编号</th>
+							<th width="200px">委托方</th>
+							<th width="200px">报告号</th>
+							<th width="100px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_details" name="workInvoiceProjectRelationList[{{idx}}].details" type="hidden" value="{{row.workContractName}}"/>
+                        </td>
+                        <td>
+                            <sys:gridselectcallprojecttss url="${ctx}/workinvoiceTwo/workinvoiceTwo/selectproject" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId"  value="{{row.projectId}}"  title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color: #fff"
+													labelValue="{{row.projectName}}" cssClass="form-control judgment layui-input" fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" isProject="{{row.isProject}}" details="{{row.details}}"></sys:gridselectcallprojecttss>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.workContractName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.clientName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td class="text-center op-td" >
+                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow1(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                        </td>
+                    </tr>//-->
+					</script>
+					<script type="text/javascript">
+						var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+						$(document).ready(function() {
+							var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+							for (var i=0; i<data.length; i++){
+								addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+								workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+							}
+						});
+					</script>
+				</div>
+			</div>
+			<div class="form-group layui-row first lw14">
+				<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">
+						<c:choose>
+							<c:when test="${workInvoice.invoiceState == 4}">
+								<c:choose>
+									<c:when test="${workInvoice.ext ==0}">
+										<input value = "本公司开票" readonly="true" class="form-control layui-input"/>
+									</c:when>
+									<c:otherwise>
+										<input value = "上级公司开票" readonly="true"  class="form-control layui-input"/>
+									</c:otherwise>
+								</c:choose>
+							</c:when>
+							<c:otherwise>
+								<input type="radio" class="i-checks" name="ext" checked id="ext" value="0">
+								<label for="ext">本公司开票</label>
+								<input type="radio" class="i-checks" name="ext" id="ext1" value="1">
+								<label for="ext1">上级公司开票</label>
+							</c:otherwise>
+						</c:choose>
+					</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">
+						<input type="radio" lay-filter="invoiceType" title="专票" name="invoiceType" checked id="invoiceType1" value="1">
+<%--						<label for="invoiceType1">专票</label>--%>
+						<input type="radio" lay-filter="invoiceType" title="普票" name="invoiceType" id="invoiceType" value="2">
+<%--						<label for="invoiceType">普票</label>--%>
+					</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">
+						<sys:gridselect url="${ctx}/workinvoiceTwo/workinvoiceTwo/selectclient" id="client" name="client.id"  value="${workInvoice.client.id}"  title="选择开票单位" labelName="workInvoice.client.name"
+										labelValue="${workInvoice.client.name}" cssClass="form-control judgment layui-input" fieldLabels="单位" fieldKeys="name" searchLabel="客户名称" searchKey="name" ></sys:gridselect>
+						</td>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>纳税人识别号:</label>
+					<div class="layui-input-block">
+						<form:input id="orUnicode" path="orUnicode" placeholder="请输入纳税人识别码" htmlEscape="false"    class="form-control isUscCode layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>地址:</label>
+					<div class="layui-input-block">
+						<form:input id="address" path="address" placeholder="请输入地址" htmlEscape="false"    class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>电话:</label>
+					<div class="layui-input-block">
+						<form:input id="telephone" path="telephone" placeholder="请输入电话" htmlEscape="false"    class="form-control isTel layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>开户银行:</label>
+					<div class="layui-input-block">
+						<form:input id ="bank"  path="bank" htmlEscape="false" placeholder="请输入开户银行"  class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item invoicetype">*</span>银行账号:</label>
+					<div class="layui-input-block">
+						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" placeholder="请输入银行账号"  class="form-control number layui-input"/>
+					</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:select  path="chargeType" class="form-control simple-select judgment">
+							<form:options items="${fns:getMainDictList('receipt_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+						</form:select>
+					</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:select path="billingContent" class="form-control simple-select judgment">
+							<form:options items="${fns:getMainDictList('billing_content')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+						</form:select>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label"><span class="require-item">*</span>开票金额(元):</label>
+					<div class="layui-input-block">
+						<input name="money" htmlEscape="false" placeholder="请输入开票金额"  value="<fmt:formatNumber value="${workInvoice.money}" pattern="#.00#"/>" class="form-control judgment number layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label">开票内容要求:</label>
+					<div class="layui-input-block">
+						<form:textarea path="content" id="contractTypeDoc" placeholder="请输入开票内容" htmlEscape="false" rows="4"    class="form-control"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票人:</label>
+					<div class="layui-input-block">
+						<form:input id=""  path="" htmlEscape="false" readonly="true"  class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">开票时间:</label>
+					<div class="layui-input-block">
+						<form:input id=""  path="" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">领票时间:</label>
+					<div class="layui-input-block">
+						<form:input id=""  path="" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+					</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">
+						<sys:treeselect id="master" name="accountCheckingUserId" value="${workInvoice.accountCheckingUserId}" labelName="accountCheckingUserName" labelValue="${workInvoice.accountCheckingUserName}"
+										cssStyle="background-color: #fff" title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label"><span class="require-item">*</span>对账地区:</label>
+					<div class="layui-input-block  with-icon">
+						<sys:treeselectArae id="area" name="area.id" value="${workInvoice.area.id}" labelName="area.name" labelValue="${workInvoice.area.name}"
+											cssStyle="background-color:#fff" title="区域" url="/sys/area/treeData" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="false" isAll="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label double-line">备注:</label>
+					<div class="layui-input-block">
+						<form:textarea path="remarks" placeholder="" htmlEscape="false" rows="4" class="form-control"/>
+					</div>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<div class="layui-item nav-btns">
+					<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+					<sys:collectSelect  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
+										name="linkman.id"  title="选择资料库"
+										cssClass="form-control judgment" fieldLabels="资料库" fieldKeys="name"
+										searchLabel="资料库" searchKey="fileName"></sys:collectSelect>
+				</div>
+				<div id="addFile_attachment" style="display: none" class="upload-progress">
+					<span id="fileName_attachment" ></span>
+					<b><span id="baifenbi_attachment" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="200px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${workInvoice.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${workInvoice.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}"></td>
+											</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="${workInvoice.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>
+														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+													</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-xs12 form-table-container">
+					<table id="contentTable" class="table table-bordered table-condensed can-edit">
+						<thead>
+						<tr>
+							<th>发票代码</th>
+							<th>发票号</th>
+							<th>开票金额</th>
+							<th>税率</th>
+							<th>金额</th>
+							<th>税额</th>
+							<th>累计登记金额</th>
+<%--							<th width="150px">操作</th>--%>
+						</tr>
+						</thead>
+						<tbody id="workAccountList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workAccountListTpl">//<!--
+                                    <tr id="workAccountList{{idx}}">
+                                        <td class="hide">
+                                            <input id="workAccountList{{idx}}_id" name="workAccountList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                            <input id="workAccountList{{idx}}_delFlag" name="workAccountList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                        </td>
+                                    	<td>
+                                        	<input id="workAccountList{{idx}}_code" name="workAccountList[{{idx}}].code" type="text" value="{{row.code}}" readonly="true" class="form-control "/>
+                                   		 </td>
+                                    	 <td>
+                                        	<input id="workAccountList{{idx}}_number" name="workAccountList[{{idx}}].number" type="text" value="{{row.number}}" readonly="true"   class="form-control"/>
+                                   		 </td>
+                                    	<td>
+                                            <input id="workAccountList{{idx}}_totalMoney"  name="workAccountList[{{idx}}].totalMoney" type="text" value="{{row.totalMoney}}"  readonly="true"   class="form-control"/>
+                                        </td>
+                                        <td>
+                                        <div class="input-group">
+                                            <input id="workAccountList{{idx}}_tax" onblur="setTaxMoney(this)" name="workAccountList[{{idx}}].tax" type="text" value="{{row.tax}}" readonly="true"   class="form-control number "/><span class="input-group-addon" style="background-color:#f1f1f1">%</span>
+                                            </div>
+
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList{{idx}}_taxMoney" name="workAccountList[{{idx}}].taxMoney" type="text" value="{{row.taxMoney}}" readonly="true"   class="form-control "/>
+                                        </td>
+										<td>
+                                            <input id="workAccountList{{idx}}_taxRate" name="workAccountList[{{idx}}].taxRate" type="text" value="{{row.taxRate}}"  readonly="true"  class="form-control "/>
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList{{idx}}_incomeMoney" name="workAccountList[{{idx}}].incomeMoney" type="text" value="0"  readonly="true"  class="form-control "/>
+                                        </td>
+
+                                            <input id="workAccountList{{idx}}_state" name="workAccountList[{{idx}}].state"  type="hidden" value="正常"   class="form-control"/>
+
+                                            <input id="workAccountList{{idx}}_backSign" name="workAccountList[{{idx}}].backSign"  type="hidden" value="正常"  readonly="true"  class="form-control "/>
+
+                                            <input id="workAccountList{{idx}}_backNumber" name="workAccountList[{{idx}}].backNumber"  type="hidden" value=""  readonly="true"  class="form-control "/>
+
+
+<%--                                        <td class="text-center" width="10">--%>
+<%--											{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workAccountList{{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,"");
+                        $(document).ready(function() {
+                            var data = ${fns:toJson(workInvoice.workAccountList)};
+                            for (var i=0; i<data.length; i++){
+                                addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, data[i]);
+                                workAccountListRowIdx = workAccountListRowIdx + 1;
+                            }
+                        });
+					</script></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" >
+					<act:flowChart procInsId="${workInvoice.act.procInsId}"/>
+					<act:histoicFlow procInsId="${workInvoice.act.procInsId}" />
+				</div>
+			</div>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>