Przeglądaj źródła

其他开票信息添加部门主任审批节点,苏州分部签章功能调整

user5 1 rok temu
rodzic
commit
c1c7f787a9
32 zmienionych plików z 6171 dodań i 387 usunięć
  1. 24 20
      src/main/java/com/jeeplus/common/utils/excel/ImportExcelNew.java
  2. 11 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ProjectReportSignatureInfo.java
  3. 7 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java
  4. 4 4
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  5. 4 4
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java
  6. 620 61
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java
  7. 90 2
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllController.java
  8. 43 14
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllTwoController.java
  9. 212 13
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceController.java
  10. 9 3
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java
  11. 65 0
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  12. 514 241
      src/main/resources/freemarker/projectHSSignature.ftl
  13. 4 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageElectronicSealDao.xml
  14. 3 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  15. 4 0
      src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml
  16. 66 0
      src/main/webapp/WEB-INF/tags/sys/gridselectcallnotproject.tag
  17. BIN
      src/main/webapp/dot/上海签章导入数据模板.xlsx
  18. 1 1
      src/main/webapp/static/common/js/common.js
  19. 1 1
      src/main/webapp/webpage/include/head.jsp
  20. 7 0
      src/main/webapp/webpage/modules/ruralprojectrecords/electronicSeal/ruralProjectReportHSSignatureInfoForm.jsp
  21. 1 1
      src/main/webapp/webpage/modules/ruralprojectrecords/electronicSeal/ruralProjectReportSignatureInfoForm.jsp
  22. 443 0
      src/main/webapp/webpage/modules/sys/gridinvoicenotproject.jsp
  23. 13 7
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllForm.jsp
  24. 1 1
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllModify.jsp
  25. 1178 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllNotProjectModify.jsp
  26. 13 7
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoForm.jsp
  27. 2 1
      src/main/webapp/webpage/modules/workinvoice/workInvoiceExamineModify.jsp
  28. 737 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceNotProjectAudit.jsp
  29. 911 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceNotProjectAuditEnd.jsp
  30. 1178 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceNotProjectModify.jsp
  31. 3 2
      src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoForm.jsp
  32. 2 3
      src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoModify.jsp

+ 24 - 20
src/main/java/com/jeeplus/common/utils/excel/ImportExcelNew.java

@@ -214,50 +214,54 @@ public class ImportExcelNew {
 						if(sheet.getRow(7).getCell(i) != null) {
 							projectReportSignatureInfo.setContractDate(sheet.getRow(7).getCell(i).toString());
 						}
-
+						//工程概况
 						if(sheet.getRow(8).getCell(i) != null) {
-							projectReportSignatureInfo.setDescriptionOfDeduction(sheet.getRow(8).getCell(i).toString());
+							projectReportSignatureInfo.setProjectProfile(sheet.getRow(8).getCell(i).toString());
 						}
 
 						if(sheet.getRow(9).getCell(i) != null) {
-							if(sheet.getRow(9).getCell(i).getCellType()==0) {
-								if (HSSFDateUtil.isCellDateFormatted(sheet.getRow(9).getCell(i))) {
-									projectReportSignatureInfo.setStampDate(sheet.getRow(9).getCell(i).getDateCellValue());
-								}
-							}
+							projectReportSignatureInfo.setDescriptionOfDeduction(sheet.getRow(9).getCell(i).toString());
 						}
+
 						if(sheet.getRow(10).getCell(i) != null) {
-							projectReportSignatureInfo.setPrintQuantity(sheet.getRow(10).getCell(i).toString());
-						}
-						if(sheet.getRow(11).getCell(i) != null) {
-							if(sheet.getRow(11).getCell(i).getCellType()==0) {
-								if (HSSFDateUtil.isCellDateFormatted(sheet.getRow(11).getCell(i))) {
-									projectReportSignatureInfo.setAgreedStartDate(sheet.getRow(11).getCell(i).getDateCellValue());
+							if(sheet.getRow(10).getCell(i).getCellType()==0) {
+								if (HSSFDateUtil.isCellDateFormatted(sheet.getRow(10).getCell(i))) {
+									projectReportSignatureInfo.setStampDate(sheet.getRow(10).getCell(i).getDateCellValue());
 								}
 							}
 						}
+						if(sheet.getRow(11).getCell(i) != null) {
+							projectReportSignatureInfo.setPrintQuantity(sheet.getRow(11).getCell(i).toString());
+						}
 						if(sheet.getRow(12).getCell(i) != null) {
 							if(sheet.getRow(12).getCell(i).getCellType()==0) {
 								if (HSSFDateUtil.isCellDateFormatted(sheet.getRow(12).getCell(i))) {
-									projectReportSignatureInfo.setAgreedEndDate(sheet.getRow(12).getCell(i).getDateCellValue());
+									projectReportSignatureInfo.setAgreedStartDate(sheet.getRow(12).getCell(i).getDateCellValue());
 								}
 							}
 						}
-
 						if(sheet.getRow(13).getCell(i) != null) {
-							projectReportSignatureInfo.setConsultant(sheet.getRow(13).getCell(i).toString());
+							if(sheet.getRow(13).getCell(i).getCellType()==0) {
+								if (HSSFDateUtil.isCellDateFormatted(sheet.getRow(13).getCell(i))) {
+									projectReportSignatureInfo.setAgreedEndDate(sheet.getRow(13).getCell(i).getDateCellValue());
+								}
+							}
 						}
+
 						if(sheet.getRow(14).getCell(i) != null) {
-							projectReportSignatureInfo.setSelfCalibrationOpinion(sheet.getRow(14).getCell(i).toString());
+							projectReportSignatureInfo.setConsultant(sheet.getRow(14).getCell(i).toString());
 						}
 						if(sheet.getRow(15).getCell(i) != null) {
-							projectReportSignatureInfo.setReviewOpinion(sheet.getRow(15).getCell(i).toString());
+							projectReportSignatureInfo.setSelfCalibrationOpinion(sheet.getRow(15).getCell(i).toString());
 						}
 						if(sheet.getRow(16).getCell(i) != null) {
-							projectReportSignatureInfo.setSettlementPricingBasisDocument(sheet.getRow(16).getCell(i).toString());
+							projectReportSignatureInfo.setReviewOpinion(sheet.getRow(16).getCell(i).toString());
 						}
 						if(sheet.getRow(17).getCell(i) != null) {
-							projectReportSignatureInfo.setCalculateValuationBasisDocument(sheet.getRow(17).getCell(i).toString());
+							projectReportSignatureInfo.setSettlementPricingBasisDocument(sheet.getRow(17).getCell(i).toString());
+						}
+						if(sheet.getRow(18).getCell(i) != null) {
+							projectReportSignatureInfo.setCalculateValuationBasisDocument(sheet.getRow(18).getCell(i).toString());
 						}
 						projectReportSignatureInfo.setType("2");
 						projectReportSignatureInfo.preInsert();

+ 11 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ProjectReportSignatureInfo.java

@@ -81,6 +81,9 @@ public class ProjectReportSignatureInfo extends ActEntity<ProjectReportSignature
 	private String decreaseInAccountingFee;      //核减额
 
 
+	private String projectProfile;	//工程概况
+
+
 	private String type;	//类型(1:江苏;2:上海;3:内审报告)
 
 
@@ -557,4 +560,12 @@ public class ProjectReportSignatureInfo extends ActEntity<ProjectReportSignature
 	public void setDecreaseInAccountingFee(String decreaseInAccountingFee) {
 		this.decreaseInAccountingFee = decreaseInAccountingFee;
 	}
+
+	public String getProjectProfile() {
+		return projectProfile;
+	}
+
+	public void setProjectProfile(String projectProfile) {
+		this.projectProfile = projectProfile;
+	}
 }

+ 7 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java

@@ -2271,11 +2271,17 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
                 data.put("developmentOrganization","");
             }
             //合同签订日期
-            if(null != projectReportSignatureInfo && null != projectReportSignatureInfo.getContractDate()){
+            if(null != projectReportSignatureInfo.getContractDate()){
                 data.put("contractSignedDate",projectReportSignatureInfo.getContractDate());
             }else{
                 data.put("contractSignedDate","");
             }
+            //工程概况
+            if(StringUtils.isNotBlank(projectReportSignatureInfo.getProjectProfile())){
+                data.put("projectProfile",projectReportSignatureInfo.getProjectProfile());
+            }else{
+                data.put("projectProfile","");
+            }
             //施工单位
             if(StringUtils.isNotBlank(projectReportSignatureInfo.getConstructionUnit())){
                 data.put("constructionUnit",projectReportSignatureInfo.getConstructionUnit());

+ 4 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -272,7 +272,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         List<RuralProjectRecords> recordsList = findList(projectRecords);
 
         //查询所有和当前登陆人有关的项目的审核
-        WorkProjectNotify workProjectNotify = new WorkProjectNotify();
+        /*WorkProjectNotify workProjectNotify = new WorkProjectNotify();
         workProjectNotify.setUser(UserUtils.getUser());
         workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
         workProjectNotify.setRemarks("待审批");
@@ -291,7 +291,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         workProjectNotify.setTypes(types);
         //workProjectNotify.setType("92");
         //查询所有需要当前登录人进行处理的项目信息
-        List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);
+        List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);*/
 
         //添加发票对应编号
         /*workProjectNotify.setType("51");
@@ -488,7 +488,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             records.setLeaderIds(Collections3.extractToString(users, "id", ","));*/
 
             //新增报告展示
-            for (WorkProjectNotify notify: notifyList) {
+            /*for (WorkProjectNotify notify: notifyList) {
                 if(notify.getNotifyId().equals(records.getPrdId()) && "92".equals(notify.getType())){
                     records.setReportNotifyId(notify.getId());
                     if("重新申请".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
@@ -587,7 +587,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     }
                     break;
                 }
-            }
+            }*/
 
             //获取归档批次信息
             //项目归档批次

+ 4 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java

@@ -149,14 +149,14 @@ public class RuralCostProjectRecordsController extends BaseController {
 		Page<RuralProjectRecords> page = projectRecordsService.findPage(new Page<RuralProjectRecords>(request, response), projectRecords);
 
 		//查询所有和当前登陆人有关的项目的审核
-		WorkProjectNotify workProjectNotify = new WorkProjectNotify();
+		/*WorkProjectNotify workProjectNotify = new WorkProjectNotify();
 		workProjectNotify.setUser(UserUtils.getUser());
 		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
 		workProjectNotify.setRemarks("待审批");
 		//添加项目对应编号
 		workProjectNotify.setType("39");
 		//查询所有需要当前登录人进行处理的项目信息
-		List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);
+		List<WorkProjectNotify> notifyList = workProjectNotifyService.findList(workProjectNotify);*/
 
         //无合同状态下,获取委托方的名称
 		List<RuralProjectRecords> list = page.getList();
@@ -191,7 +191,7 @@ public class RuralCostProjectRecordsController extends BaseController {
 
 			//处理需要审批的项目信息
 			records1.setNotifyFlag(null);
-			for (WorkProjectNotify notify: notifyList) {
+			/*for (WorkProjectNotify notify: notifyList) {
 				if(notify.getNotifyId().equals(records1.getId())){
 					records1.setNotifyId(notify.getId());
 					if("待审批".equals(notify.getRemarks()) && !"1".equals(notify.getStatus())){
@@ -199,7 +199,7 @@ public class RuralCostProjectRecordsController extends BaseController {
 					}
 					break;
 				}
-			}
+			}*/
 		}
 		//查询工程类型
 		if (projectRecords.getEngineeringType()!=null){

+ 620 - 61
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -483,21 +483,19 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		if(null != workInvoice.getWorkInvoiceProjectRelationList()){
 			for (WorkInvoiceProjectRelation projectRelation : workInvoice.getWorkInvoiceProjectRelationList()) {
 				//处理开票是非项目还是项目开票
-				if(null==projectRelation.getIsProject() || 1==projectRelation.getIsProject()){
+				if(StringUtils.isNotBlank(projectRelation.getProjectId())){
 					if (WorkInvoiceReceipt.DEL_FLAG_NORMAL.equals(projectRelation.getDelFlag())) {
-						if (StringUtils.isNotBlank(projectRelation.getProjectId())) {
-							ProjectRecords projectRecords = projectRecordsService.getRuralMasters(projectRelation.getProjectId());
-							if (null != projectRecords) {
-								projectNameList.add(projectRecords.getProjectName());
-							}
+						ProjectRecords projectRecords = projectRecordsService.getRuralMasters(projectRelation.getProjectId());
+						if (null != projectRecords) {
+							projectNameList.add(projectRecords.getProjectName());
 						}
+
 					}
-				}else if(projectRelation.getIsProject()==2){
+				}else{
 					if(projectNameList.contains("非项目发票")){
 						continue;
 					}
 					projectNameList.add("其它:"+projectRelation.getDetails().replaceAll("\\r|\\n*",""));
-
 				}
 
 			}
@@ -874,6 +872,178 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					ActUtils.PD_REIMBURSEMENT[0], businessKey, processInstance.getId(), variables});
 		return "";
 	}
+	/**
+	 * 非项目发票流程创建
+	 * @param workInvoice
+	 * @param variables
+	 */
+	@Transactional(readOnly = false)
+	public String saveNotProjectBranch(WorkInvoice workInvoice,Map<String, Object> variables,String processInstanceId) {
+		long s1=System.currentTimeMillis();
+		if (StringUtils.isBlank(workInvoice.getNumber())) {
+			synchronized (SYN_BYTE) {
+				workInvoice.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), WorkInvoice.SERIAL_BIZCODE));
+			}
+		}
+		String officeId = UserUtils.getUser().getOffice().getId();
+		Office office = officeService.get(officeId);
+		workInvoice.setOffice(office);
+		long s2=System.currentTimeMillis();
+			super.save(workInvoice);
+		//保存附件
+		this.saveAttachments(workInvoice);
+		long s3=System.currentTimeMillis();
+		String str = "";
+		//所属部门
+
+		String userName = UserUtils.get(workInvoice.getCreateBy().getId()).getName();
+		//项目名称获取
+		List<String> projectNameList = getProjectNameList(workInvoice);
+		String projectNameStr = String.join(",", projectNameList);
+		//ProjectRecords projectRecords = projectRecordsService.getRuralMasters(workInvoice.getProject().getId());
+		String title = "项目【"+ projectNameStr +"】发票申请待审批";
+		str = "发票金额:" + workInvoice.getMoney() + "(元)。项目【"+ projectNameStr +"】发票申请待审批,发票申请编号:"+workInvoice.getNumber();
+
+		long s4=System.currentTimeMillis();
+		//开票明细处理
+		updateWorkInvoiceInfo(workInvoice);
+		//开票与项目关系处理
+		updateWorkInvoiceProjectRelationInfo(workInvoice);
+		long s5=System.currentTimeMillis();
+			// 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
+			identityService.setAuthenticatedUserId(UserUtils.getUser().getId());
+			// 启动流程
+			String businessKey = workInvoice.getId().toString();
+			WorkActivityMenu workActivityMenu = workActivityMenuService.findByParentAndOffice("ggh3125f1f194c82bdea00005c750905",officeService.get(workInvoice.getOfficeId()));
+			// 启动流程
+			String processType = workActivityMenu.getProcessType();
+			StringBuffer buffer = new StringBuffer();
+			Activity activity = new Activity();
+			WorkProjectNotify workProjectNotify = UtilNotify
+					.saveNotify(workInvoice.getId(),
+							null,
+							workInvoice.getCompanyId(),
+							title,
+							str,
+							"213", //对应之后的判断
+							"0",
+							"待审批",
+							""  //通知角色
+					);
+		long s6=System.currentTimeMillis();
+			List<User> users = new ArrayList<>();
+		//获取部门主任
+			List<User> bmzrs = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"5",workInvoice.getCreateBy());
+		//获取总经理
+			//List<User> zjls = UserUtils.getByRoleActivityEnname("zjl",3,office.getId(),"5",workInvoice.getCreateBy());
+		//财务员工
+		List<User> fpglys = UserUtils.getByRoleActivityEnname("cwygevod",3,office.getId(),"5",workInvoice.getCreateBy());
+		long s7=System.currentTimeMillis();
+			if (StringUtils.isNotBlank(workActivityMenu.getId())) {
+				workProjectNotify.setNotifyRole("");
+				workActivityMenu = workActivityMenuService.get(workActivityMenu.getId());
+				List<Activity> activities = workActivityMenu.getActivities();
+				for (Activity a : activities) {
+					String encount = a.getEncount();
+					String enlist = a.getEnlist();
+					if (a.getRole()!=null && StringUtils.isNotBlank(a.getRole().getEnname())){
+						List enusers = UserUtils.getByRoleActivityEnnames(a.getRole().getEnname(),office.getId(),"5",workInvoice.getCreateBy());
+						if (enusers.size()==0){
+							workInvoice.setInvoiceState("1");//暂存
+							this.save(workInvoice);
+							return "流程审批人不能为空,角色"+a.getRole().getName()+"下无用户,请联系管理员!";
+						}
+						variables.put(enlist, enusers);
+						variables.put(encount, enusers.size());
+					}
+					if (a.getDelFlag().equals("0") && a.getCount() == 1) {
+						activity = a;
+					}
+				}
+				buffer.append(activity.getRole().getEnname());
+				if (activity != null && StringUtils.isNotBlank(activity.getId())) {
+					//角色审批
+					if (StringUtils.isNotBlank(activity.getRole().getEnname())) {
+						users = UserUtils.getByRoleActivityEnnames(activity.getRole().getEnname(),office.getId(),"5",workInvoice.getCreateBy());
+					}
+					//人员审批
+					if (StringUtils.isNotBlank(activity.getUser().getId())) {
+						users.add(activity.getUser());
+					}
+				}
+				workProjectNotify.setId("");
+			} else {
+				//variables.put("fpglyList", fpglys);
+				if (bmzrs.size()==0 ){
+					workInvoice.setInvoiceState("1");//暂存
+					this.save(workInvoice);
+				}
+				if (bmzrs.size()==0){
+					return "流程审批人不能为空,部门主任下无用户,请联系管理员!";
+				}
+				//variables.put("fpglycount",fpglys.size());
+				variables.put("bmzrcount",bmzrs.size());
+				variables.put("bmzrList",bmzrs);
+				processType = "newWorkInvoiceNotProject";
+				users.addAll(bmzrs);
+			}
+			for (User user : users){
+				workProjectNotify.setUser(user);
+				workProjectNotify.setId("");
+				workProjectNotifyService
+						.save(workProjectNotify);
+				Map<String,Object> extras = new HashMap<>();
+				extras.put("type","7002");
+				extras.put("id",workProjectNotify.getId());
+				extras.put("procDefKey","213");
+				UserUtils.pushInfoToApp(title,str,extras,user.getId());
+				UserUtils.pushIm(user.getId(),str);
+			}
+			variables.put("type", processType);
+			variables.put("busId", businessKey);
+			variables.put("title", "发票申请编号:" + workInvoice.getNumber());//设置标题;
+		long s8=System.currentTimeMillis();
+			ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
+			workInvoice.setProcessInstance(processInstance);
+		long s9=System.currentTimeMillis();
+			if (StringUtils.isNotBlank(processInstanceId)) {
+				workActivityProcessService.updateProcessInstanceId(processInstance.getId(),processInstanceId);
+				workActivityProcessService.deleteProcessInstanceId(processInstanceId);
+				workActivityProcessService.deleteProcessIdAuditUsers(processInstanceId);
+			}
+		long s10=System.currentTimeMillis();
+			// 更新流程实例ID
+			workInvoice.setProcessInstanceId(processInstance.getId());
+			workInvoiceDao.updateProcessInstanceId(workInvoice);
+		//通知添加流程实例ID
+		workProjectNotify.setProcessInstanceId(processInstance.getId());
+		workProjectNotify.setWapBeginDate(new Date());
+		workProjectNotifyService.save(workProjectNotify);
+			List<Activity> list = workActivityMenu.getActivities();
+		long s11=System.currentTimeMillis();
+			if (list != null && list.size() != 0) {
+				workActivityProcessService.saveList(list, processInstance.getId());
+			} else {
+				WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+				workActivityProcess.setProcessKey("newWorkInvoiceNotProject");
+				workActivityProcess.setCount(1);
+				workActivityProcess.setProcessInstanceId(processInstance.getId());
+				workActivityProcess.setIsApproval("0");
+				workActivityProcessService.save(workActivityProcess);
+				workActivityProcess.setCount(2);
+				workActivityProcess.setId("");
+				workActivityProcessService.save(workActivityProcess);
+				workActivityProcessService.insertAuditsByType(bmzrs,processInstance.getId(),1,1);
+				workActivityProcessService.insertAuditsByType(fpglys,processInstance.getId(),2,0);
+			}
+		long s12=System.currentTimeMillis();
+		logger.info("发票送审-------生成发票编号:"+(s2-s1)+"  保存发票信息:"+(s3-s2)+"  保存发票明细数据:"+(s5-s4)
+				+"  查询角色人员:"+(s7-s6)+"  流程启动:"+(s9-s8)+"  workActivityProcessService.updateProcessInstanceId:"+(s10-s9)
+				+"  查询角色人员:"+(s12-s11)+"  总时间:"+(s12-s1));
+			logger.debug("start process of {key={}, bkey={}, pid={}, variables={}}", new Object[]{
+					ActUtils.PD_REIMBURSEMENT[0], businessKey, processInstance.getId(), variables});
+		return "";
+	}
 
 
 	/**
@@ -1484,10 +1654,17 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 			String enname = "";
 			List<Activity> activitieList = activityService.getByProcessInstanceId(workInvoice.getProcessInstanceId());
 			WorkActivityMenu workActivityMenu = new WorkActivityMenu();
-			if (activitieList != null && activitieList.size() != 0) {
-				workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
-				workActivityMenu.setActivities(activitieList);
+		if (activitieList != null && activitieList.size() != 0) {
+			Iterator<Activity> iterator = activitieList.iterator();
+			while (iterator.hasNext()){
+				Activity activityInfo = iterator.next();
+				if (!"newWorkInvoiceBranch".equals(activityInfo.getProcessKey())){
+					iterator.remove();
+				}
 			}
+			workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+			workActivityMenu.setActivities(activitieList);
+		}
 
 		//项目名称获取
 		List<String> projectNameList = getProjectNameList(workInvoice);
@@ -1842,6 +2019,13 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		List<Activity> activitieList = activityService.getByProcessInstanceId(workInvoice.getProcessInstanceId());
 		WorkActivityMenu workActivityMenu = new WorkActivityMenu();
 		if (activitieList != null && activitieList.size() != 0) {
+			Iterator<Activity> iterator = activitieList.iterator();
+			while (iterator.hasNext()){
+				Activity activityInfo = iterator.next();
+				if (!"newWorkInvoiceExamine".equals(activityInfo.getProcessKey())){
+					iterator.remove();
+				}
+			}
 			workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
 			workActivityMenu.setActivities(activitieList);
 		}
@@ -2162,66 +2346,434 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		return "保存审核意见成功!";
 	}
 
+
 	/**
-	 * 获取流程详细信息
-	 * @param processInstanceId
-	 */
-	@SuppressWarnings("unchecked")
-	public WorkInvoice getByProcessInstanceId(String processInstanceId) {
-		WorkInvoice workInvoice = dao.getByProcInsId(processInstanceId);
-		if(workInvoice!=null&&!workInvoice.equals("")){
-			if(workInvoice.getCreateBy()!=null&&!workInvoice.getCreateBy().equals("")){
-				if(StringUtils.isNotBlank(workInvoice.getCreateBy().getId())){
-					User u = UserUtils.get(workInvoice.getCreateBy().getId());
-					if(u!=null &&!u.equals("")){
-						workInvoice.setCreateBy(u);
-					}
-				}
-			}
-		}
-		return workInvoice;
-	}
-	@Transactional(readOnly = false)
-	public void update(WorkInvoice workInvoice) {
-		workInvoice.preUpdate();
-		dao.update(workInvoice);
-	}
-	/**
-	 * 作废审核审批保存
+	 * 审核流程
 	 * @param workInvoice
 	 */
 	@Transactional(readOnly = false)
-	public void cancleSave(WorkInvoice workInvoice) {
-		String userId = UserUtils.getUser().getId();
-		actTaskService.claim(workInvoice.getAct().getTaskId(), userId);
-		// 设置意见
-		workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag())?"[同意] ":"[驳回] ")+workInvoice.getAct().getComment());
+	public String saveWorkInvoiceNotProjectAudit(WorkInvoice workInvoice,List<User> auditUsers) {
+		//所属部门
+		Office office = officeService.get(workInvoice.getOffice().getId());
+		String userName = UserUtils.get(workInvoice.getCreateBy().getId()).getName();
+		String  str = "发票申请编号:"+workInvoice.getNumber()+",实际开票单位:"+workInvoice.getClient().getName()+",创建人:"+userName+",所属部门:"+office.getName();
+		String title = "实际开票单位:"+workInvoice.getClient().getName();
 		// 对不同环节的业务逻辑进行操作
 		String taskDefKey = workInvoice.getAct().getTaskDefKey();
-		//业务逻辑对应的条件表达式
-		String exp = "";
-		// 审核环节
-		if ("auditcancle".equals(taskDefKey)) {
-			exp = "pass";
-		}// 未知环节,直接返回
-		else {
-			return;
+		if("fpgly".equals(taskDefKey)){
+			updateWorkInvoiceInfo(workInvoice);
+			actTaskService.claim(workInvoice.getAct().getTaskId(), UserUtils.getUser().getId());
+		}else if (!"modifyApply".equals(taskDefKey)) {
+			actTaskService.claim(workInvoice.getAct().getTaskId(), UserUtils.getUser().getId());
+		}else {
+			workInvoice.getAct().setFlag("yes");
 		}
-		// 提交流程任务
+		String comment = "";
+		if (workInvoice.getInvoiceState().equals("4")){
+			comment = ("yes".equals(workInvoice.getAct().getFlag())?"[重新申请] ":"[已撤销] ");
+		}else {
+			comment = ("yes".equals(workInvoice.getAct().getFlag())?"[同意] ":"[驳回] ")+workInvoice.getAct().getComment();
+		}
+		//yes 的时候状态为审核通过 否则为未通过
+		//2 审核中 4 驳回
+		workInvoice.setInvoiceState(("yes".equals(workInvoice.getAct().getFlag()) ? "2" : "4"));
 		Map<String, Object> vars = Maps.newHashMap();
-		vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
-		System.out.println("vars============" + vars.toString());
-		// 提交流程任务
-		actTaskService.complete(workInvoice.getAct().getTaskId(), workInvoice.getAct().getProcInsId(), workInvoice.getAct().getComment(), vars);
-		boolean state = actTaskService.isProcessEnd(workInvoice.getAct().getProcInsId());
-		if (!state) {
-			if ("yes".equals(workInvoice.getAct().getFlag())) {
-				workInvoice.setInvoiceState("4");
-				workInvoice.preUpdate();
-				this.update(workInvoice);
+		//业务逻辑对应的条件表达式
+		String exp = "";
+		String taskCount = "";
+		String notifyRole = "";
+		int key = 0;
+		String enname = "";
+		List<Activity> activitieList = activityService.getByProcessInstanceId(workInvoice.getProcessInstanceId());
+		WorkActivityMenu workActivityMenu = new WorkActivityMenu();
+		if (activitieList != null && activitieList.size() != 0) {
+			Iterator<Activity> iterator = activitieList.iterator();
+			while (iterator.hasNext()){
+				Activity activityInfo = iterator.next();
+				if (!"newWorkInvoiceNotProject".equals(activityInfo.getProcessKey())){
+					iterator.remove();
+				}
 			}
+			workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
+			workActivityMenu.setActivities(activitieList);
 		}
-	}
+
+		//项目名称获取
+		List<String> projectNameList = getProjectNameList(workInvoice);
+		String projectNameStr = String.join(",", projectNameList);
+		WorkActivityProcess workActivityProcess = new WorkActivityProcess();
+		WorkActivityProcess selectProcess = new WorkActivityProcess();
+		selectProcess.setProcessInstanceId(workInvoice.getProcessInstanceId());
+		List<WorkActivityProcess> workActivityProcesses = workActivityProcessService.findList(selectProcess);
+		List<Activity> activities = workActivityMenu.getActivities();
+		if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("newWorkInvoiceNotProject")) {
+			key = 1;
+			for (int i = 0; i < workActivityProcesses.size(); i++) {
+				WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+				if (taskDefKey.equals(activityProcess.getActivityTask()) && !taskDefKey.equals("modifyApply")) {
+					taskCount = activityProcess.getCount()+"";
+					workActivityProcess = activityProcess;
+					if (!workActivityProcess.getIsApproval().equals("0")) {
+						workActivityProcess.setId("");
+					}
+					exp = "pass";
+					if (!"yes".equals(workInvoice.getAct().getFlag())) {
+						workInvoice.setInvoiceState("4");
+						workActivityProcess.setIsApproval("2");
+						String returnBack = "-1";
+						for (Activity activity : activities) {
+							if (activity.getCount() == activityProcess.getCount()) {
+								notifyRole = activity.getName();
+								returnBack = activity.getReturnBack();
+								break;
+							}
+						}
+						if (returnBack.equals("0")) {
+							workActivityProcess.setId("");
+						}
+
+					} else {
+						workActivityProcess.setIsApproval("1");
+					}
+				}else if(taskDefKey.equals("modifyApply")){
+					taskCount = "0";
+					notifyRole = "调整申请";
+					exp = "pass";
+					workActivityProcess.setId("");
+					workActivityProcess.setCount(0);
+					if (!"yes".equals(workInvoice.getAct().getFlag())) {
+						workInvoice.setInvoiceState("3");
+						workActivityProcess.setIsApproval("2");
+					} else {
+						workActivityProcess.setIsApproval("1");
+					}
+					break;
+				}
+			}
+		} else {
+			workActivityMenu.setProcessType("newWorkInvoiceNotProject");
+			for (int i = 0; i < workActivityProcesses.size(); i++) {
+				WorkActivityProcess activityProcess = workActivityProcesses.get(i);
+				String count = activityProcess.getCount() + "";
+				workActivityProcess = activityProcess;
+				if (!workActivityProcess.getIsApproval().equals("0")) {
+					workActivityProcess.setId("");
+				}
+				// 审核环节
+				if ("bmzr".equals(taskDefKey) && count.contains("1")) {
+					taskCount = "1";
+					exp = "pass";
+					if ("yes".equals(workInvoice.getAct().getFlag()) &&("0").equals(workInvoice.getExt())) {
+						workActivityProcessService.insertAuditsByType(auditUsers,workInvoice.getProcessInstanceId(),2,1);
+						//分公司流程
+						notifyRole = "财务部门审批";
+						//notifyRole = "审批通过";
+						workActivityProcess.setIsApproval("1");
+						enname = "fpgly";
+						vars.put("fpglyList", auditUsers);
+						vars.put("fpglycount",auditUsers.size());
+					}else {
+						notifyRole = "调整申请";
+						workActivityProcess.setIsApproval("2");
+					}
+					break;
+				}
+				if ("fpgly".equals(taskDefKey) && count.contains("2")) {
+					taskCount = "2";
+					exp = "pass";
+					if ("yes".equals(workInvoice.getAct().getFlag()) &&("0").equals(workInvoice.getExt())) {
+						workActivityProcessService.insertAuditsByType(auditUsers,workInvoice.getProcessInstanceId(),2,1);
+						//分公司流程
+						//notifyRole = "财务主任审批";
+						notifyRole = "审批通过";
+						workActivityProcess.setIsApproval("1");
+							/*enname = "fpgly";
+							vars.put("fpglyList", auditUsers);
+							vars.put("fpglycount",auditUsers.size());*/
+					}else {
+						notifyRole = "调整申请";
+						workActivityProcess.setIsApproval("2");
+					}
+					break;
+				}  /*else if ("fpgly".equals(taskDefKey) && count.contains("2")) {
+					taskCount = "2";
+					exp = "pass";
+					if ("yes".equals(workInvoice.getAct().getFlag())) {
+						notifyRole = "审批通过";
+						workActivityProcess.setIsApproval("1");
+					} else {
+						notifyRole = "调整申请";
+						workActivityProcess.setIsApproval("2");
+					}
+					break;
+				}*/  else if ("modifyApply".equals(taskDefKey)&& count.contains("0")) {
+					taskCount = "0";
+					notifyRole = "部门主任审批";
+					exp = "pass";
+					workActivityProcess.setCount(0);
+					enname = "bmzr";
+					if (!"yes".equals(workInvoice.getAct().getFlag())) {
+						workInvoice.setInvoiceState("3");
+					}
+					break;
+				} else if ("apply_end".equals(taskDefKey)) {
+				}
+
+			}
+		}
+		// 设置意见
+		workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag()) ? "[同意] " : "[驳回] ") + workInvoice.getAct().getComment());
+		workInvoice.preUpdate();
+		// 提交流程任务
+		vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
+		vars.put("passs", true);
+		workActivityProcessService.updateProcess(workActivityProcess,workActivityMenu,key,taskCount,workInvoice.getProcessInstanceId(),taskDefKey,"modifyApply",workInvoice.getAct().getFlag(),comment, activities);
+		// 提交流程任务
+		actTaskService.complete(workInvoice.getAct().getTaskId(), workInvoice.getAct().getProcInsId(), workInvoice.getAct().getComment(), vars);
+		boolean state = actTaskService.isProcessEnd(workInvoice.getAct().getProcInsId());
+		List<User> users = new ArrayList<>();
+		List<User> userList = new ArrayList<>();
+		//ProjectRecords projectRecords = projectRecordsService.getRuralMasters(workInvoice.getProject().getId());
+		if (!state) {
+			users.add(workInvoice.getCreateBy());
+			if ("yes".equals(workInvoice.getAct().getFlag())) {
+				title = "项目【"+ projectNameStr +"】发票申请通过";
+				str = "项目【"+ projectNameStr +"】发票申请通过,发票申请编号:"+workInvoice.getNumber();
+				workInvoice.setInvoiceState("5");
+				WorkProjectNotify notify = new WorkProjectNotify();
+				notify.setNotifyId(workInvoice.getId());
+				userList = workProjectNotifyService.readByNotifyId(notify);
+				workProjectNotifyService
+						.save(UtilNotify
+								.saveNotify(workInvoice.getId(),
+										workInvoice.getCreateBy(),
+										workInvoice.getCompanyId(),
+										title,
+										str,
+										"213",
+										"0",
+										"待通知",
+										notifyRole));
+
+			} else {
+				WorkProjectNotify notify = new WorkProjectNotify();
+				notify.setNotifyId(workInvoice.getId());
+				userList = workProjectNotifyService.readByNotifyId(notify);
+				if (StringUtils.isNotBlank(workInvoice.getInvoiceState()) && !workInvoice.getInvoiceState().equals("3")){
+					workInvoice.setInvoiceState("4");
+					workProjectNotifyService
+							.save(UtilNotify
+									.saveNotify(workInvoice.getId(),
+											workInvoice.getCreateBy(),
+											workInvoice.getCompanyId(),
+											title,
+											str,
+											"213",
+											"0",
+											"待通知",
+											notifyRole));
+				}
+			}
+			workActivityProcessService.deleteProcessIdAuditUsers(workInvoice.getProcessInstanceId());
+		} else {
+			if (StringUtils.isNotBlank(workActivityMenu.getProcessType()) && !workActivityMenu.getProcessType().equals("newWorkInvoiceNotProject")) {
+				WorkProjectNotify notify = new WorkProjectNotify();
+				notify.setNotifyId(workInvoice.getId());
+				userList = workProjectNotifyService.readByNotifyId(notify);
+				WorkProjectNotify workProjectNotify = UtilNotify
+						.saveNotify(workInvoice.getId(),
+								new User(),
+								workInvoice.getCompanyId(),
+								title,
+								str,
+								"213",
+								"0",
+								"待审批",
+								notifyRole);
+				List<WorkProjectNotify> workProjectNotifys = activityService.getByFlagAndTaskDefKeyList(
+						activities,
+						workProjectNotify,
+						taskDefKey,
+						workInvoice.getAct().getFlag(),
+						taskCount,
+						workInvoice.getCreateBy(),
+						workInvoice.getOfficeId(),
+						"5");
+				for (WorkProjectNotify workProjectNotify1:workProjectNotifys){
+					users.add(workProjectNotify1.getUser());
+					workProjectNotify1.setId("");
+					workProjectNotify1.setIsNewRecord(false);
+					workProjectNotifyService
+							.save(workProjectNotify1);
+					if (!"modifyApply".equals(taskDefKey)){
+						Map<String,Object> extras = new HashMap<>();
+						if ("fpgly".equals(taskDefKey) ){
+							extras.put("type","7001");
+						}else {
+							extras.put("type","7002");
+						}
+						extras.put("id",workProjectNotify.getId());
+						extras.put("procDefKey","213");
+						UserUtils.pushInfoToApp(title,str,extras,workProjectNotify1.getUser().getId());
+
+					}
+				}
+
+			} else {
+				if (!"yes".equals(workInvoice.getAct().getFlag())) {//驳回待办提醒
+					title = "项目【"+ projectNameStr +"】发票申请被驳回";
+					str = "项目【"+ projectNameStr +"】发票申请被驳回,请选择重新申请或作废";
+					WorkProjectNotify notify = new WorkProjectNotify();
+					notify.setNotifyId(workInvoice.getId());
+					userList = workProjectNotifyService.readByNotifyId(notify);
+					workProjectNotifyService
+							.save(UtilNotify
+									.saveNotify(workInvoice.getId(),
+											workInvoice.getCreateBy(),
+											workInvoice.getCompanyId(),
+											title,
+											str,
+											"213",
+											"0",
+											"重新申请",
+											notifyRole));
+					users.add( workInvoice.getCreateBy());
+				} else {
+					if (StringUtils.isNotBlank(enname)) {//驳回重新申请待办
+						title = "项目【"+ projectNameStr +"】发票申请,待审批";
+						str = "项目【"+ projectNameStr +"】发票申请,待审批,发票申请编号:"+workInvoice.getNumber();;
+						WorkProjectNotify notify = new WorkProjectNotify();
+						notify.setNotifyId(workInvoice.getId());
+						userList = workProjectNotifyService.readByNotifyId(notify);
+						WorkProjectNotify workProjectNotify = UtilNotify
+								.saveNotify(workInvoice.getId(),
+										new User(),
+										workInvoice.getCompanyId(),
+										title,
+										str,
+										"213",
+										"0",
+										"待审批",
+										notifyRole);
+						for (User user1:auditUsers){
+							users.add(user1);
+							workProjectNotify.setUser(user1);
+							workProjectNotify.setId("");
+							workProjectNotify.setIsNewRecord(false);
+							workProjectNotifyService
+									.save(workProjectNotify);
+							if (!"modifyApply".equals(taskDefKey)){
+								Map<String,Object> extras = new HashMap<>();
+								if ("fpgly".equals(taskDefKey)){
+									extras.put("type","7001");
+								}else {
+									extras.put("type","7002");
+								}
+								extras.put("id",workProjectNotify.getId());
+								extras.put("procDefKey","213");
+								UserUtils.pushInfoToApp(title,str,extras,user1.getId());
+
+							}
+						}
+					}else {
+						WorkProjectNotify notify = new WorkProjectNotify();
+						notify.setNotifyId(workInvoice.getId());
+						userList = workProjectNotifyService.readByNotifyId(notify);
+						users.addAll(userList);
+						users.add(workInvoice.getCreateBy());
+						workProjectNotifyService
+								.save(UtilNotify
+										.saveNotify(workInvoice.getId(),
+												workInvoice.getCreateBy(),
+												workInvoice.getCompanyId(),
+												title,
+												str,
+												"213",
+												"0",
+												"重新申请",
+												notifyRole));
+					}
+				}
+			}
+		}
+		if (users!=null && users.size()!=0) {
+			for (User u : users) {
+				UserUtils.pushIm(u.getId(),str);
+			}
+		}
+		if (userList!=null && userList.size()!=0) {
+			for (User u : userList) {
+				UserUtils.pushMeIm(u.getId());
+			}
+		}
+		workInvoiceDao.update(workInvoice);
+		//开票与项目关系处理
+		updateWorkInvoiceProjectRelationInfo(workInvoice);
+		//附件处理
+		this.saveAttachments(workInvoice);
+		return "保存审核意见成功!";
+	}
+
+	/**
+	 * 获取流程详细信息
+	 * @param processInstanceId
+	 */
+	@SuppressWarnings("unchecked")
+	public WorkInvoice getByProcessInstanceId(String processInstanceId) {
+		WorkInvoice workInvoice = dao.getByProcInsId(processInstanceId);
+		if(workInvoice!=null&&!workInvoice.equals("")){
+			if(workInvoice.getCreateBy()!=null&&!workInvoice.getCreateBy().equals("")){
+				if(StringUtils.isNotBlank(workInvoice.getCreateBy().getId())){
+					User u = UserUtils.get(workInvoice.getCreateBy().getId());
+					if(u!=null &&!u.equals("")){
+						workInvoice.setCreateBy(u);
+					}
+				}
+			}
+		}
+		return workInvoice;
+	}
+	@Transactional(readOnly = false)
+	public void update(WorkInvoice workInvoice) {
+		workInvoice.preUpdate();
+		dao.update(workInvoice);
+	}
+	/**
+	 * 作废审核审批保存
+	 * @param workInvoice
+	 */
+	@Transactional(readOnly = false)
+	public void cancleSave(WorkInvoice workInvoice) {
+		String userId = UserUtils.getUser().getId();
+		actTaskService.claim(workInvoice.getAct().getTaskId(), userId);
+		// 设置意见
+		workInvoice.getAct().setComment(("yes".equals(workInvoice.getAct().getFlag())?"[同意] ":"[驳回] ")+workInvoice.getAct().getComment());
+		// 对不同环节的业务逻辑进行操作
+		String taskDefKey = workInvoice.getAct().getTaskDefKey();
+		//业务逻辑对应的条件表达式
+		String exp = "";
+		// 审核环节
+		if ("auditcancle".equals(taskDefKey)) {
+			exp = "pass";
+		}// 未知环节,直接返回
+		else {
+			return;
+		}
+		// 提交流程任务
+		Map<String, Object> vars = Maps.newHashMap();
+		vars.put(exp, "yes".equals(workInvoice.getAct().getFlag()) ? true : false);
+		System.out.println("vars============" + vars.toString());
+		// 提交流程任务
+		actTaskService.complete(workInvoice.getAct().getTaskId(), workInvoice.getAct().getProcInsId(), workInvoice.getAct().getComment(), vars);
+		boolean state = actTaskService.isProcessEnd(workInvoice.getAct().getProcInsId());
+		if (!state) {
+			if ("yes".equals(workInvoice.getAct().getFlag())) {
+				workInvoice.setInvoiceState("4");
+				workInvoice.preUpdate();
+				this.update(workInvoice);
+			}
+		}
+	}
 	@Transactional(readOnly = false)
 	public void saveCancle(WorkInvoice workInvoice,Map<String, Object> variables) {
 
@@ -2576,6 +3128,13 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		List<Activity> activitieList = activityService.getByProcessInstanceId(workInvoice.getProcessInstanceId());
 		WorkActivityMenu workActivityMenu = new WorkActivityMenu();
 		if (activitieList != null && activitieList.size() != 0) {
+			Iterator<Activity> iterator = activitieList.iterator();
+			while (iterator.hasNext()){
+				Activity activityInfo = iterator.next();
+				if (!"newWorkInvoiceBranch".equals(activityInfo.getProcessKey())){
+					iterator.remove();
+				}
+			}
 			workActivityMenu.setProcessType(activitieList.get(0).getProcessKey());
 			workActivityMenu.setActivities(activitieList);
 		}

+ 90 - 2
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllController.java

@@ -21,6 +21,7 @@ import com.jeeplus.modules.act.utils.ActUtils;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
@@ -41,6 +42,7 @@ import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
 import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
 import com.jeeplus.modules.workinvoice.entity.WorkInvoiceExport;
+import com.jeeplus.modules.workinvoice.entity.WorkInvoiceProjectRelation;
 import com.jeeplus.modules.workinvoice.entity.WorkInvoiceReceipt;
 import com.jeeplus.modules.workinvoice.service.WorkInvoiceAllService;
 import com.jeeplus.modules.workinvoice.service.WorkInvoiceService;
@@ -117,6 +119,8 @@ public class WorkInvoiceAllController extends BaseController {
 	private ActivityService activityService;
 	@Autowired
 	private WorkInvoiceService invoiceService;
+	@Autowired
+	protected RuralProjectRecordsService ruralProjectRecordsService;
 
 	@Autowired
 	private HttpServletRequest request;
@@ -283,6 +287,66 @@ public class WorkInvoiceAllController extends BaseController {
 			return "redirect:"+Global.getAdminPath()+"/workinvoiceAll/workInvoiceAll/?repage";
 		}
 	}
+
+	/**
+	 * 发票审批(审定(内))
+	 * @param
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = "saveWorkInvoiceNotProjectAudit")
+	public String saveWorkInvoiceNotProjectAudit(WorkInvoice workInvoice, Model model,
+												 RedirectAttributes redirectAttributes) {
+		try{
+			// 对不同环节的业务逻辑进行操作
+			String taskDefKey = workInvoice.getAct().getTaskDefKey();
+			List<User> users = null;
+			//所属部门
+			Office office = officeService.get(workInvoice.getOffice().getId());
+			if ("bmzr".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwygevod",3,office.getId(),"5",workInvoice.getCreateBy());
+			}else  if ("scbzr".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwzg",1,office.getId(),"5",workInvoice.getCreateBy());
+			}else  if ("zjl".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwygevod",3,office.getId(),"5",workInvoice.getCreateBy());
+			}else  if ("fpgly".equals(taskDefKey)){
+				if(("1").equals(workInvoice.getExt())) {
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 3);
+				}else{
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),1);
+				}
+			}else if ("modifyApply".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 1);
+			}
+			String flag = workInvoice.getAct().getFlag();
+			if ("yes".equals(flag) && (users==null || users.size()==0)){
+				addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+			}else {
+				String str = invoiceService.saveWorkInvoiceNotProjectAudit(workInvoice,users);
+				addMessage(redirectAttributes, str);
+			}
+		}catch (Exception e){
+			addMessage(redirectAttributes, "审批失败:");
+			logger.error("Exception e:"+e);
+		}
+
+		if (StringUtils.isNotBlank(workInvoice.getHome()) && "home".equals(workInvoice.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		}else if (StringUtils.isNotBlank(workInvoice.getHome()) && "notifyList".equals(workInvoice.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+		}else {
+			return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
+		}
+	}
+
+
+
 	/**
 	 * 查看,增加,编辑开票管理表单页面
 	 */
@@ -343,9 +407,29 @@ public class WorkInvoiceAllController extends BaseController {
 				workInvoice.setAct(act);
 				view = "workInvoiceAllModify";
 			}
+			//获取发票项目信息
+			List<WorkInvoiceProjectRelation> workInvoiceProjectRelationList = workInvoice.getWorkInvoiceProjectRelationList();
+			List<String> projectIdList = Lists.newArrayList();
+			//获取项目id并查询所有包含项目id的项目信息
+			for (WorkInvoiceProjectRelation projectInfo: workInvoiceProjectRelationList) {
+				if(StringUtils.isNotBlank(projectInfo.getProjectId())){
+					projectIdList.add(projectInfo.getProjectId());
+				}
+			}
+
+			if(projectIdList.size()>0){
+				//根据项目id查询项目信息中的项目类别
+				String projectSortCostInfo = ruralProjectRecordsService.getProjectSortCostInfo(projectIdList);
+				//如果项目类别中包含审定(内)即 8 则需要进行部门主任审核
+				if(null != projectSortCostInfo && projectSortCostInfo.contains("8")){
+					view = "workInvoiceExamineModify";
+				}
+			}else{
+				view = "workInvoiceNotProjectModify";
+			}
 		}
 		// 环节编号
-		String taskDefKey = workInvoice.getAct().getTaskDefKey();
+		/*String taskDefKey = workInvoice.getAct().getTaskDefKey();
 		if (StringUtils.isNotBlank(taskDefKey) && ("bmzr".equals(taskDefKey) ||
 				"scbzr".equals(taskDefKey))){
 			view = "workInvoiceAudit";
@@ -355,12 +439,15 @@ public class WorkInvoiceAllController extends BaseController {
 			view = "workInvoiceAuditEnd";//发票管理员操作发票明细页面
 		}else if (StringUtils.isNotBlank(taskDefKey) && !taskDefKey.equals("modifyApply")){
 			view = "workInvoiceAudit";
-		}
+		}*/
 
 		if (StringUtils.isBlank(workInvoice.getId())){
 			//workInvoice.setNumber(IdGen.uuid());
 			//workInvoice.setInvoiceNumber( (int)((Math.random()*9+1)*100000));
 			workInvoice.setInvoiceDate(new Date());
+			User user = UserUtils.getUser();
+			workInvoice.setActualDrawerId(user.getId());
+			workInvoice.setActualDrawerName(user.getName());
 		}
 
 		//已收款处理
@@ -392,6 +479,7 @@ public class WorkInvoiceAllController extends BaseController {
 			}
 		}
 
+		model.addAttribute("showFlag", "3");
 		model.addAttribute("workInvoice", workInvoice);
 		return "modules/workinvoice/" + view;
 	}

+ 43 - 14
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllTwoController.java

@@ -21,6 +21,7 @@ import com.jeeplus.modules.act.utils.ActUtils;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
@@ -117,6 +118,8 @@ public class WorkInvoiceAllTwoController extends BaseController {
 	private ActivityService activityService;
 	@Autowired
 	private WorkInvoiceService invoiceService;
+	@Autowired
+	protected RuralProjectRecordsService ruralProjectRecordsService;
 
 	@Autowired
 	private HttpServletRequest request;
@@ -291,24 +294,45 @@ public class WorkInvoiceAllTwoController extends BaseController {
 			}
 			view = "workInvoiceView";
 		}else if("3".equals(tabId)){
-			List<MainDictDetail> billingContentList = DictUtils.getMainDictList("billing_content");
-			for (MainDictDetail dictDetail: billingContentList) {
-				if(workInvoice.getBillingContent().equals(dictDetail.getValue())){
-					workInvoice.setBillingContent(dictDetail.getLabel());
-					break;
+			ProcessInstance processInstance = actTaskService.getProcIns(workInvoice.getProcessInstanceId());
+			if (processInstance!=null) {
+				Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
+				Act act = new Act();
+				act.setTaskId(taskInfok.getId());
+				act.setTaskName(taskInfok.getName());
+				act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
+				act.setProcDefId(taskInfok.getProcessDefinitionId());
+				act.setProcInsId(taskInfok.getProcessInstanceId());
+				act.setTask(taskInfok);
+				workInvoice.setAct(act);
+				view = "workInvoiceTwoModify";
+
+
+				//获取发票项目信息
+				List<WorkInvoiceProjectRelation> workInvoiceProjectRelationList = workInvoice.getWorkInvoiceProjectRelationList();
+				List<String> projectIdList = Lists.newArrayList();
+				//获取项目id并查询所有包含项目id的项目信息
+				for (WorkInvoiceProjectRelation projectInfo: workInvoiceProjectRelationList) {
+					if(StringUtils.isNotBlank(projectInfo.getProjectId())){
+						projectIdList.add(projectInfo.getProjectId());
+					}
 				}
-			}
-			List<MainDictDetail> receiptTypeList = DictUtils.getMainDictList("receipt_type");
-			for (MainDictDetail dictDetail: receiptTypeList) {
-				if(workInvoice.getChargeType().equals(dictDetail.getValue())){
-					workInvoice.setChargeType(dictDetail.getLabel());
-					break;
+
+				if(projectIdList.size()>0){
+					//根据项目id查询项目信息中的项目类别
+					String projectSortCostInfo = ruralProjectRecordsService.getProjectSortCostInfo(projectIdList);
+					//如果项目类别中包含审定(内)即 8 则需要进行部门主任审核
+					if(null != projectSortCostInfo && projectSortCostInfo.contains("8")){
+						view = "workInvoiceExamineModify";
+					}
+				}else{
+					view = "workInvoiceNotProjectModify";
 				}
+
 			}
-			view = "workInvoiceAllTwoModify";
 		}
 		// 环节编号
-		String taskDefKey = workInvoice.getAct().getTaskDefKey();
+		/*String taskDefKey = workInvoice.getAct().getTaskDefKey();
 		if (StringUtils.isNotBlank(taskDefKey) && ("bmzr".equals(taskDefKey) ||
 				"scbzr".equals(taskDefKey))){
 			view = "workInvoiceAudit";
@@ -318,13 +342,18 @@ public class WorkInvoiceAllTwoController extends BaseController {
 			view = "workInvoiceAuditEnd";//发票管理员操作发票明细页面
 		}else if (StringUtils.isNotBlank(taskDefKey) && !taskDefKey.equals("modifyApply")){
 			view = "workInvoiceAudit";
-		}
+		}*/
 
 		if (StringUtils.isBlank(workInvoice.getId())){
 			//workInvoice.setNumber(IdGen.uuid());
 			//workInvoice.setInvoiceNumber( (int)((Math.random()*9+1)*100000));
 			workInvoice.setInvoiceDate(new Date());
+			User user = UserUtils.getUser();
+			workInvoice.setActualDrawerId(user.getId());
+			workInvoice.setActualDrawerName(user.getName());
 		}
+
+		model.addAttribute("showFlag", "2");
 		model.addAttribute("workInvoice", workInvoice);
 		return "modules/workinvoice/" + view;
 	}

+ 212 - 13
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceController.java

@@ -23,6 +23,7 @@ import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
@@ -116,6 +117,8 @@ public class WorkInvoiceController extends BaseController {
 	private ActTaskService actTaskService;
 	@Autowired
 	private ActivityService activityService;
+	@Autowired
+	protected RuralProjectRecordsService ruralProjectRecordsService;
 
 	@Autowired
 	private HttpServletRequest request;
@@ -273,7 +276,7 @@ public class WorkInvoiceController extends BaseController {
 	 * @return
 	 */
 	@RequestMapping(value = "saveExamineAudit")
-	public String saveExamineAudit(WorkInvoice workInvoice, Model model,
+	public String saveExamineAudit(WorkInvoice workInvoice,String showFlag, Model model,
 								   RedirectAttributes redirectAttributes) {
 		try{
 			// 对不同环节的业务逻辑进行操作
@@ -315,7 +318,88 @@ public class WorkInvoiceController extends BaseController {
 		}else if (StringUtils.isNotBlank(workInvoice.getHome()) && "notifyList".equals(workInvoice.getHome())){
 			return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
 		}else {
-			return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
+			switch (showFlag){
+				case "1":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
+
+				case "2":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceAllTwo/workinvoiceAllTwo/?repage";
+
+				case "3":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceAll/workInvoiceAll/?repage";
+
+				default:
+					return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+			}
+		}
+	}
+
+	/**
+	 * 发票审批(审定(内))
+	 * @param
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = "saveWorkInvoiceNotProjectAudit")
+	public String saveWorkInvoiceNotProjectAudit(WorkInvoice workInvoice,String showFlag, Model model,
+								   RedirectAttributes redirectAttributes) {
+		try{
+			// 对不同环节的业务逻辑进行操作
+			String taskDefKey = workInvoice.getAct().getTaskDefKey();
+			List<User> users = null;
+			//所属部门
+			Office office = officeService.get(workInvoice.getOffice().getId());
+			if ("bmzr".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwygevod",3,office.getId(),"5",workInvoice.getCreateBy());
+			}else  if ("scbzr".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwzg",1,office.getId(),"5",workInvoice.getCreateBy());
+			}else  if ("zjl".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),3);
+				if (users==null )
+					users = UserUtils.getByRoleActivityEnname("cwygevod",3,office.getId(),"5",workInvoice.getCreateBy());
+			}else  if ("fpgly".equals(taskDefKey)){
+				if(("1").equals(workInvoice.getExt())) {
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 3);
+				}else{
+					users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(),1);
+				}
+			}else if ("modifyApply".equals(taskDefKey)){
+				users = UserUtils.getByProssType(workInvoice.getProcessInstanceId(), 1);
+			}
+			String flag = workInvoice.getAct().getFlag();
+			if ("yes".equals(flag) && (users==null || users.size()==0)){
+				addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+			}else {
+				String str = workInvoiceService.saveWorkInvoiceNotProjectAudit(workInvoice,users);
+				addMessage(redirectAttributes, str);
+			}
+		}catch (Exception e){
+			addMessage(redirectAttributes, "审批失败:");
+			logger.error("Exception e:"+e);
+		}
+
+		if (StringUtils.isNotBlank(workInvoice.getHome()) && "home".equals(workInvoice.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		}else if (StringUtils.isNotBlank(workInvoice.getHome()) && "notifyList".equals(workInvoice.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+		}else {
+			switch (showFlag){
+				case "1":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
+
+				case "2":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceAllTwo/workinvoiceAllTwo/?repage";
+
+				case "3":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceAll/workInvoiceAll/?repage";
+
+				default:
+					return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+			}
 		}
 	}
 
@@ -421,7 +505,7 @@ public class WorkInvoiceController extends BaseController {
 	 * 保存开票管理
 	 */
 	@RequestMapping(value = "save")
-	public String save(WorkInvoice workInvoice, Model model, RedirectAttributes redirectAttributes) throws Exception{
+	public String save(WorkInvoice workInvoice,String showFlag, Model model, RedirectAttributes redirectAttributes) throws Exception{
 		if (!beanValidator(model, workInvoice)){
 			return form(workInvoice, model);
 		}
@@ -430,7 +514,20 @@ public class WorkInvoiceController extends BaseController {
 		String invoiceState = workInvoice.getInvoiceState();
 		if(user!=null && !UserUtils.getUser().getId().equals(user.getId()) && StringUtils.isNotBlank(user.getId())){
 			addMessage(redirectAttributes, "您不是申请人,无法修改");
-			return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+			switch (showFlag){
+				case "1":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
+
+				case "2":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceAllTwo/workinvoiceAllTwo/?repage";
+
+				case "3":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceAll/workInvoiceAll/?repage";
+
+				default:
+					return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+
+			}
 		}
 		//启动流程
 		workInvoice.setInvoiceState("2");
@@ -449,12 +546,28 @@ public class WorkInvoiceController extends BaseController {
 			String str = "";
 			//默认添加为分公司
 			workInvoice.setExt("0");
+
+			//获取发票项目信息
+			List<WorkInvoiceProjectRelation> workInvoiceProjectRelationList = workInvoice.getWorkInvoiceProjectRelationList();
+			List<String> projectIdList = Lists.newArrayList();
+			//获取项目id并查询所有包含项目id的项目信息
+			for (WorkInvoiceProjectRelation projectInfo: workInvoiceProjectRelationList) {
+				if(StringUtils.isNotBlank(projectInfo.getProjectId())){
+					projectIdList.add(projectInfo.getProjectId());
+				}
+			}
 			//1总公司0分公司
-			if("1".equals(workInvoice.getExt())){
-				//str = workInvoiceService.save(workInvoice, variables,processInstanceId);
-				str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);
-			}else if("0".equals(workInvoice.getExt())){
-				str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);
+			if(projectIdList.size()>0){
+				//根据项目id查询项目信息中的项目类别
+				String projectSortCostInfo = ruralProjectRecordsService.getProjectSortCostInfo(projectIdList);
+				//如果项目类别中包含审定(内)即 8 则需要进行部门主任审核
+				if(null != projectSortCostInfo && projectSortCostInfo.contains("8")){
+					str = workInvoiceService.saveBranchExamine(workInvoice, variables,processInstanceId);
+				}else{
+					str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);
+				}
+			}else{
+				str = workInvoiceService.saveNotProjectBranch(workInvoice, variables,processInstanceId);
 			}
 
 			if(StringUtils.isNotBlank(workInvoice.getExt())){
@@ -471,7 +584,19 @@ public class WorkInvoiceController extends BaseController {
 			addMessage(redirectAttributes, "系统内部错误");
 			logger.error("Exception e:"+e);
 		}
-		return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+		switch (showFlag){
+			case "1":
+				return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
+
+			case "2":
+				return "redirect:"+Global.getAdminPath()+"/workinvoiceAllTwo/workinvoiceAllTwo/?repage";
+
+			case "3":
+				return "redirect:"+Global.getAdminPath()+"/workinvoiceAll/workInvoiceAll/?repage";
+
+			default:
+				return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+		}
 	}
 
 
@@ -642,7 +767,7 @@ public class WorkInvoiceController extends BaseController {
 	 * 保存开票管理
 	 */
 	@RequestMapping(value = "store")
-	public String store(WorkInvoice workInvoice, Model model, RedirectAttributes redirectAttributes) throws Exception{
+	public String store(WorkInvoice workInvoice,String showFlag, Model model, RedirectAttributes redirectAttributes) throws Exception{
 		if (!beanValidator(model, workInvoice)){
 			return form(workInvoice, model);
 		}
@@ -654,7 +779,19 @@ public class WorkInvoiceController extends BaseController {
 		String sta = workInvoice.getInvoiceState();
 		if(!UserUtils.getUser().getId().equals(submitter) && !Strings.isNullOrEmpty(submitter) && sta != null){
 			addMessage(redirectAttributes, "您不是申请人,无法修改");
-			return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+			switch (showFlag){
+				case "1":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
+
+				case "2":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceAllTwo/workinvoiceAllTwo/?repage";
+
+				case "3":
+					return "redirect:"+Global.getAdminPath()+"/workinvoiceAll/workInvoiceAll/?repage";
+
+				default:
+					return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+			}
 		}
 		if(!workInvoice.getIsNewRecord()){//编辑表单保存
 			WorkInvoice t = workInvoiceService.get(workInvoice.getId());//从数据库取出记录的值
@@ -671,7 +808,19 @@ public class WorkInvoiceController extends BaseController {
 			workInvoiceService.save(workInvoice);//保存
 		}
 		addMessage(redirectAttributes, "保存发票成功");
-		return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+		switch (showFlag){
+			case "1":
+				return "redirect:"+Global.getAdminPath()+"/workinvoiceTwo/workinvoiceTwo/?repage";
+
+			case "2":
+				return "redirect:"+Global.getAdminPath()+"/workinvoiceAllTwo/workinvoiceAllTwo/?repage";
+
+			case "3":
+				return "redirect:"+Global.getAdminPath()+"/workinvoiceAll/workInvoiceAll/?repage";
+
+			default:
+				return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+		}
 	}
 
 	/**
@@ -894,6 +1043,56 @@ public class WorkInvoiceController extends BaseController {
 		model.addAttribute("page",page);
 		return "modules/sys/gridinvoiceproject";
 	}
+	/**
+	 * 选择开票项目
+	 */
+	@RequestMapping(value = "selectnotproject")
+	public String selectnotproject(ProjectRecords project, String url, String fieldLabels, String fieldKeys, String searchLabel, String searchKey, String ids,Integer isProject,Integer isProjectFalg,String details, HttpServletRequest request, HttpServletResponse response, Model model) {
+		project.setCompany(UserUtils.getSelectCompany());
+		project.setProjectStatus(ProjectStatusEnum.SIGNED.getValue());//已签状态
+		//project.setLeaderNameStr(UserUtils.getUser().getName());
+		Page<ProjectRecords> page = projectRecordsService.ruralFindPage(new Page<ProjectRecords>(request, response), project);
+		List<ProjectRecords> list = page.getList();
+		for (ProjectRecords info: list) {
+			if("1".equals(info.getInvoiceFlag())){
+				switch (info.getInvoiceStatus()){
+					case "5":
+						info.setInvoiceFlag("已开票");
+						break;
+					case "1":
+					case "2":
+					case "3":
+					case "4":
+						info.setInvoiceFlag("开票中");
+						break;
+					default:
+						info.setInvoiceFlag("");
+				}
+			}
+		}
+		try {
+			fieldLabels = URLDecoder.decode(fieldLabels, "UTF-8");
+			fieldKeys = URLDecoder.decode(fieldKeys, "UTF-8");
+			searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
+			searchKey = URLDecoder.decode(searchKey, "UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+			logger.error("Exception e:"+e);
+		}
+		model.addAttribute("labelNames", fieldLabels.split("\\|"));
+		model.addAttribute("labelValues", fieldKeys.split("\\|"));
+		model.addAttribute("fieldLabels", fieldLabels);
+		model.addAttribute("fieldKeys", fieldKeys);
+		model.addAttribute("url", url);
+		model.addAttribute("searchLabel", searchLabel);
+		model.addAttribute("searchKey", searchKey);
+		project.setDetails(details);
+		model.addAttribute("obj", project);
+		model.addAttribute("isProject", isProject);
+		model.addAttribute("isProjectFalg", isProjectFalg);
+		model.addAttribute("page",page);
+		return "modules/sys/gridinvoicenotproject";
+	}
 
 	/**
 	 * 选择开票项目

+ 9 - 3
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java

@@ -346,12 +346,14 @@ public class WorkInvoiceTwoController extends BaseController {
 					if(null != projectSortCostInfo && projectSortCostInfo.contains("8")){
 						view = "workInvoiceExamineModify";
 					}
+				}else{
+					view = "workInvoiceNotProjectModify";
 				}
 
 			}
 		}
 		// 环节编号
-		String taskDefKey = workInvoice.getAct().getTaskDefKey();
+		/*String taskDefKey = workInvoice.getAct().getTaskDefKey();
 		if (StringUtils.isNotBlank(taskDefKey) && ("bmzr".equals(taskDefKey) ||
 				"scbzr".equals(taskDefKey))){
 			view = "workInvoiceAudit";
@@ -361,12 +363,15 @@ public class WorkInvoiceTwoController extends BaseController {
 			view = "workInvoiceAuditEnd";//发票管理员操作发票明细页面
 		}else if (StringUtils.isNotBlank(taskDefKey) && !taskDefKey.equals("modifyApply")){
 			view = "workInvoiceAudit";
-		}
+		}*/
 
 		if (StringUtils.isBlank(workInvoice.getId())){
 			//workInvoice.setNumber(IdGen.uuid());
 			//workInvoice.setInvoiceNumber( (int)((Math.random()*9+1)*100000));
 			workInvoice.setInvoiceDate(new Date());
+			User user = UserUtils.getUser();
+			workInvoice.setActualDrawerId(user.getId());
+			workInvoice.setActualDrawerName(user.getName());
 		}
 		//可能有问题,是否需要判断vew*
 //		if(StringUtils.isNotBlank(workInvoice.getNewDrawerId()) && workInvoice.getNewDrawerId() != ""){
@@ -375,6 +380,7 @@ public class WorkInvoiceTwoController extends BaseController {
 //			view = "workInvoiceTwoForm2";
 //		}
 
+		model.addAttribute("showFlag", "1");
 		model.addAttribute("workInvoice", workInvoice);
 		return "modules/workinvoice/" + view;
 	}
@@ -476,7 +482,7 @@ public class WorkInvoiceTwoController extends BaseController {
 					str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);
 				}
 			}else{
-				str = workInvoiceService.saveBranch(workInvoice, variables,processInstanceId);
+				str = workInvoiceService.saveNotProjectBranch(workInvoice, variables,processInstanceId);
 			}
 
 			//1总公司0分公司

+ 65 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -2039,6 +2039,71 @@ public class WorkProjectNotifyController extends BaseController {
 					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
 						return "modules/workinvoice/workInvoiceExamineModify";
 					}
+				} else if (workProjectNotify.getType().equals("213")) {    //非项目开票管理
+					WorkInvoice workInvoice = workInvoiceService.get(workProjectNotify.getNotifyId());
+					if (StringUtils.isNotBlank(workInvoice.getId())) {
+						workInvoiceService.queryDetails(workInvoice);
+					}
+					if(StringUtils.isNotBlank(workProjectNotify.getHome())){
+						workInvoice.setHome(workProjectNotify.getHome());
+					}else{
+						workInvoice.setHome("home");
+					}
+					//获取发票开户银行信息
+					String bankName = workInvoiceService.getBankNameByNameOrId(workInvoice.getBank());
+					if(StringUtils.isNotBlank(bankName)){
+						workInvoice.setBank(bankName);
+					}
+					workInvoice.setAct(getByAct(workInvoice.getProcessInstanceId()));
+					String taskDefKey = workInvoice.getAct().getTaskDefKey();
+					model.addAttribute("workInvoice", workInvoice);
+					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+
+						List<MainDictDetail> billingContentList = DictUtils.getMainDictList("billing_content");
+						for (MainDictDetail dictDetail: billingContentList) {
+							if(workInvoice.getBillingContent().equals(dictDetail.getValue())){
+								workInvoice.setBillingContent(dictDetail.getLabel());
+								break;
+							}
+						}
+						List<MainDictDetail> receiptTypeList = DictUtils.getMainDictList("receipt_type");
+						for (MainDictDetail dictDetail: receiptTypeList) {
+							if(workInvoice.getChargeType().equals(dictDetail.getValue())){
+								workInvoice.setChargeType(dictDetail.getLabel());
+								break;
+							}
+						}
+						return "modules/workinvoice/workInvoiceView";
+					} else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
+
+						List<MainDictDetail> billingContentList = DictUtils.getMainDictList("billing_content");
+						for (MainDictDetail dictDetail: billingContentList) {
+							if(workInvoice.getBillingContent().equals(dictDetail.getValue())){
+								workInvoice.setBillingContent(dictDetail.getLabel());
+								break;
+							}
+						}
+						List<MainDictDetail> receiptTypeList = DictUtils.getMainDictList("receipt_type");
+						for (MainDictDetail dictDetail: receiptTypeList) {
+							if(workInvoice.getChargeType().equals(dictDetail.getValue())){
+								workInvoice.setChargeType(dictDetail.getLabel());
+								break;
+							}
+						}
+						model.addAttribute("identification","workinvoice");
+						model.addAttribute("identificationName","发票审核意见");
+						if (StringUtils.isNotBlank(taskDefKey) && ("bmzr".equals(taskDefKey) ||
+								"scbzr".equals(taskDefKey)) || "zjl".equals(taskDefKey)) {
+							return "modules/workinvoice/workInvoiceNotProjectAudit";
+						} else if (StringUtils.isNotBlank(taskDefKey) && "fpgly".equals(taskDefKey)) {
+							workInvoice.setDrawerName(UserUtils.getUser().getName());
+							workInvoice.setInvoiceDate(new Date());
+							model.addAttribute("workInvoice", workInvoice);
+							return "modules/workinvoice/workInvoiceNotProjectAuditEnd";
+						}
+					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						return "modules/workinvoice/workInvoiceNotProjectModify";
+					}
 				} else if (workProjectNotify.getType().equals("211")) {    //开票管理
 					WorkInvoice workInvoice = workInvoiceService.get(workProjectNotify.getNotifyId());
 					if (StringUtils.isNotBlank(workInvoice.getId())) {

Plik diff jest za duży
+ 514 - 241
src/main/resources/freemarker/projectHSSignature.ftl


+ 4 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageElectronicSealDao.xml

@@ -62,6 +62,7 @@
 			a.project_name as "projectName",
 			a.development_organization as "developmentOrganization",
 			a.calculate_valuation_basis_document as "calculateValuationBasisDocument",
+			a.project_profile as "projectProfile",
 			a.type as "type"
 	</sql>
 	<sql id="projectReportInternalAuditColumns">
@@ -168,6 +169,7 @@
 			project_name,
 			development_organization,
 			calculate_valuation_basis_document,
+			project_profile,
 			`type`
 		)values
 		<foreach collection="list" item="item" separator=",">
@@ -230,6 +232,7 @@
 			#{item.projectName},
 			#{item.developmentOrganization},
 			#{item.calculateValuationBasisDocument},
+			#{item.projectProfile},
 			#{item.type}
 			)
 		</foreach>
@@ -720,6 +723,7 @@
 			project_name = #{projectName},
 			development_organization = #{developmentOrganization},
 			calculate_valuation_basis_document = #{calculateValuationBasisDocument},
+			project_profile = #{projectProfile},
 			`type` = #{type}
 			where project_report_id=#{projectReportId}
 	</update>

+ 3 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -431,6 +431,9 @@
 		wct.name AS "workContractInfo.client.name",
 		o.top_company AS "office.name",
 		ifnull(prd.number ,"") as "projectReportNumber"
+
+		,(case when ifnull(prd.number ,"") = '' then '0' when ifnull(prd.number ,"") != '' then '1' else '' end) as reportDataFlag
+
 		,ifnull(prd.status,0) as "projectReportStatus"
 		,ifnull(prd.name,"") as "projectReportName"
 		,a.project_material_storage_status as "projectMaterialStorageStatus"

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

@@ -141,12 +141,16 @@
 		JOIN sys_office s ON s.id = a.company_id
 		LEFT join sys_office so on so.id = a.office_id
 		left join sys_user acu on acu.id = a.account_checking_user_id
+		left join sys_user actu on actu.id = a.actual_drawer_id
 	</sql>
 
 
 	<select id="get" resultType="WorkInvoice" >
 		SELECT
 			<include refid="workInvoiceColumns"/>
+			,
+		acu.name as "accountCheckingUserName"
+		,actu.name as "actualDrawerName"
 		FROM work_invoice a
 		<include refid="workInvoiceJoins"/>
 		WHERE a.id = #{id} and a.del_flag = 0

+ 66 - 0
src/main/webapp/WEB-INF/tags/sys/gridselectcallnotproject.tag

@@ -0,0 +1,66 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
+<%@ attribute name="name" type="java.lang.String" required="true" description="隐藏域名称(ID)"%>
+<%@ attribute name="value" type="java.lang.String" required="true" description="隐藏域值(ID)"%>
+<%@ attribute name="labelName" type="java.lang.String" required="true" description="输入框名称(Name)"%>
+<%@ attribute name="labelValue" type="java.lang.String" required="true" description="输入框值(Name)"%>
+<%@ attribute name="fieldLabels" type="java.lang.String" required="true" description="表格Th里显示的名字"%>
+<%@ attribute name="fieldKeys" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="searchLabel" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="searchKey" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
+<%@ attribute name="url" type="java.lang.String" required="true" description="数据地址"%>
+<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<%@ attribute name="isProject" type="java.lang.String" required="false" description="是否是项目开票"%>
+<%@ attribute name="isProjectFalg" type="java.lang.String" required="false" description="是否是项目开票"%>
+<%@ attribute name="details" type="java.lang.String" required="false" description="非项目开票详情"%>
+
+<script type="text/javascript">
+function searchGrid${id}(){
+	var ids =  $("#ids").val();
+	//alert(ids);
+    //$(" #id").val();
+	top.layer.open({
+	    type: 2,
+	    area: ['90%','90%'],
+	    title:"${title}",
+	    name:'friend',
+		skin:"two-btns",
+	    content: encodeURI("${url}?fieldLabels=${fieldLabels}&fieldKeys=${fieldKeys}&url=${url}&searchLabel=${searchLabel}&searchKey=${searchKey}&isProject=${isProject}&isProjectFalg=${isProjectFalg}&details=${details}&ids="+ids) ,
+	    btn: ['确定', '关闭'],
+	    yes: function(index, layero){
+	    	 var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+	    	 var item = iframeWin.getSelectedItem();
+	    	 if(item == "-1"){
+		    	 return;
+	    	 }
+	    	 var isProject=item.split('_item_')[3];
+	    	 var details=item.split('_item_')[4];
+	    	 var projectFlag=item.split('_item_')[5];
+	    	 if (isProject==1){
+				 var idArray= new Array(); //定义一数组
+				 idArray=item.split('_item_')[0].split(","); //字符分割
+				 $("#${id}Id").val(idArray[0]);
+				 $("#${id}Name").val(item.split('_item_')[1]);
+			 }else{
+				 $("#${id}Id").val("");
+			 }
+	    	 $("#projectFlag").val(projectFlag);
+	    	 console.log(item.split('_item_')[0]);
+			 top.layer.close(index);//关闭对话框。
+			newSetPNumber(item.split('_item_')[0],'${id}',isProject,details);
+		  },
+		  cancel: function(index){
+	       }
+	});
+};
+</script>
+	<input id="${id}Id" name="${name}"  type="hidden" value="${value}"/>
+	<div class="input-group" style="width: 100%">
+		<input id="${id}Name"  onclick="searchGrid${id}()" placeholder="${title}" name="${labelName }" ${allowInput?'':'readonly="readonly"'} type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
+		class="${cssClass}" style="${cssStyle}"/>
+    </div>
+	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>

BIN
src/main/webapp/dot/上海签章导入数据模板.xlsx


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

@@ -157,7 +157,7 @@ function openPreview(url,flag){
     }else if(flag == 2){
         var url = 'https://view.officeapps.live.com/op/view.aspx?src='+encodeURIComponent(url);
     }else if(flag == 3){
-        var url = 'http://ow365.cn/?i=25008&furl='+encodeURIComponent(url);
+        var url = 'https://view.xdocin.com/xdoc?_xdoc='+encodeURIComponent(url);
     }else if(flag == 4){
         var url = url;
     }else{

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

@@ -70,7 +70,7 @@
 <script src="${ctxStatic}/common/mustache.min.js" type="text/javascript"></script>
 <script src="${ctxStatic}/common/content.js" type="text/javascript"></script>
 <link href="${ctxStatic}/common/css/login.css" type="text/css" rel="stylesheet" />
-<script src="${ctxStatic}/common/js/common.js" type="text/javascript"></script>
+<script src="${ctxStatic}/common/js/common.js?1" type="text/javascript"></script>
 <script src="${ctxStatic}/utilJs/custom.js?1" type="text/javascript"></script>
 <script type="text/javascript">var ctx = '${ctx}', ctxStatic='${ctxStatic}',ctxp='${ctxp}';</script>
 

+ 7 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/electronicSeal/ruralProjectReportHSSignatureInfoForm.jsp

@@ -954,6 +954,13 @@
                 </div>
 
                 <div class="layui-item layui-col-sm6 lw6 with-textarea">
+                    <label class="layui-form-label double-line">工程概况:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="projectProfile" htmlEscape="false" rows="4"  maxlength="500"  class="form-control"/>
+                    </div>
+                </div>
+
+                <div class="layui-item layui-col-sm6 lw6 with-textarea">
                     <label class="layui-form-label double-line">核减情况说明:</label>
                     <div class="layui-input-block">
                         <form:textarea path="descriptionOfDeduction" htmlEscape="false" rows="4"  maxlength="255"  class="form-control"/>

+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/electronicSeal/ruralProjectReportSignatureInfoForm.jsp

@@ -1160,7 +1160,7 @@
                 <div class="layui-item layui-col-sm6 lw6 with-textarea">
                     <label class="layui-form-label double-line">工程主要内容:</label>
                     <div class="layui-input-block">
-                        <form:textarea path="mainContentsOfProject" htmlEscape="false" rows="4"  maxlength="255"  class="form-control"/>
+                        <form:textarea path="mainContentsOfProject" htmlEscape="false" rows="4"  maxlength="1000"  class="form-control"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6 with-textarea">

+ 443 - 0
src/main/webapp/webpage/modules/sys/gridinvoicenotproject.jsp

@@ -0,0 +1,443 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<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">
+		$(document).ready(function() {
+			layui.use(['form', 'layer'], function () {
+				var form = layui.form;
+				form.on("radio(isproject)", function(event){
+					var isproject = $(this).val();
+					//专票必填
+					if(isproject == 1){
+						$(".project").show();
+						$("#noProject").hide();
+					}else if(isproject == 2){
+						$(".project").hide();
+						$("#noProject").show();
+					}
+				});
+			})
+			var isProject='${isProject}';
+			if(isProject=="1" || isProject==""){
+				$(".project").show();
+				$("#noProject").hide();
+			}else if(isProject=="2"){
+				$(".project").hide();
+				$("#noProject").show();
+			}
+			var isProjectFalg='${isProjectFalg}';
+			if (isProjectFalg=="1"){
+				parent.layer.msg("第一条为项目后面新增只能选择项目",{icon:6});
+				$("#isProjectFalg").hide();
+				$(".project").show();
+				$("#noProject").hide();
+				$("#projectFlag").val(1);
+			}
+            <%--var val = "<%=request.getAttribute("state")%>";--%>
+            <%--if(val!=null){--%>
+                <%--alert("++++++++++");--%>
+			<%--};--%>
+
+            $('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+			    	  $('#contentTable tbody tr td input.i-checks').iCheck('check');
+			    	});
+
+			    $('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+			    	  $('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
+			    	});
+
+			//搜索框收放
+			$('#moresee').click(function(){
+				if($('#moresees').is(':visible'))
+				{
+					$('#moresees').slideUp(0,resizeListWindow1);
+					$('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+				}else{
+					$('#moresees').slideDown(0,resizeListWindow1);
+					$('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+				}
+			});
+
+			$("#contentTable tr td").each(function(){
+				$(this).attr("title",$(this).text());
+			});
+		});
+
+		function getSelectedItem(){
+			var array = new Array();
+			var isProject=$('input:radio[name="isProject"]:checked').val();
+			if (isProject==1){
+				var size = $("#contentTable tbody tr td input.i-checks:checked").size();
+				var sizeChecked = $("#contentTable tbody tr td input.i-checks:checked");
+
+				for (var i=0;i<size;i++){
+					array.push(sizeChecked[i].id);
+				}
+				if(size == 0 ){
+					top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
+					return "-1";
+				}
+				/*if(size > 1 ){
+                    top.layer.alert('只能选择一条数据!', {icon: 0, title:'警告'});
+                    return "-1";
+                }*/
+				$("#projectFlag").val(1);
+			}else{
+				$("#projectFlag").val(0);
+			}
+			var id =  $("#contentTable tbody tr td input.i-checks:checkbox:checked").attr("id");
+			var label = $("#contentTable tbody tr td input.i-checks:checkbox:checked").parent().parent().parent().find(".codelabel").html();
+			var number = $("#contentTable tbody tr td input.i-checks:checkbox:checked").parent().parent().parent().find(".codenumber").html();
+			var details = $("#details").val();
+			var projectFlag = $("#projectFlag").val();
+			console.log(array.toString())
+			return array.toString()+"_item_"+label+"_item_"+number+"_item_"+isProject+"_item_"+details+"_item_"+projectFlag;
+		}
+		function page(n,s){
+			if(n) $("#pageNo").val(n);
+			if(s) $("#pageSize").val(s);
+			$("#searchForm").attr("action","${url}");
+			$("#searchForm").submit();
+	    	return false;
+	    }
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="layui-row" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="obj" action="${url}" method="post" class="form-inline layui-form">
+					<input type="hidden" name="url" value="${url}"/>
+					<input type="hidden" name="isTotal" value="${isTotal}"/>
+					<input type="hidden" name="fieldLabels" value="${fieldLabels}"/>
+					<input type="hidden" name="fieldKeys" value="${fieldKeys}"/>
+					<input type="hidden" name="searchLabel" value="${searchLabel}"/>
+					<input type="hidden" name="searchKey" value="${searchKey}"/>
+					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+					<input id="projectFlag" name="projectFlag" type="hidden" value=""/>
+					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+					<div class="layui-input-block" id="isProjectFalg">
+						<input type="radio" name="isProject" class="isProject" lay-filter="isproject" title="项目" <c:if test="${isProject ==null || isProject==1 || isProject==3  }">checked</c:if>  id="isproject" value="1">
+						<input type="radio" name="isProject" class="isProject" lay-filter="isproject" title="其它" <c:if test="${isProject==2}">checked</c:if> id="isNoproject" value="2">
+					</div>
+					<div class="project">
+						<div class="commonQuery">
+							<div class="layui-item query athird" style="width: 25%">
+								<span class="layui-form-label">项目名称:</span>
+								<div class="layui-input-block">
+									<form:input path="${searchKey}" htmlEscape="false" maxlength="50" class=" form-control layui-input"/>
+								</div>
+							</div>
+							<div class="layui-item query athird" style="width: 25%">
+								<span class="layui-form-label">项目编号:</span>
+								<div class="layui-input-block">
+									<form:input path="projectId" htmlEscape="false" maxlength="50" class=" form-control layui-input"/>
+								</div>
+							</div>
+							<div class="layui-item query athird" style="width: 25%">
+								<span class="layui-form-label">报告号:</span>
+								<div class="layui-input-block">
+									<form:input path="reportData.number" htmlEscape="false" maxlength="50" class=" form-control layui-input"/>
+								</div>
+							</div>
+							<div class="layui-item athird fr">
+								<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" style="clear:both;display:none;">
+							 <div class="layui-item query athird">
+								<span class="layui-form-label">是否开票:</span>
+								<div class="layui-input-block readOnlyFFF">
+									<form:select path="invoiceStatus">
+										<form:option value="" label=""/>
+										<form:option value="5" label="已开票"/>
+										<form:option value="2" label="开票中"/>
+									</form:select>
+								</div>
+							</div>
+							<div style="clear:both;"></div>
+						</div>
+					</div>
+					<div id="noProject" style="margin: 20px;display: none;">
+						<span class="layui-form-label">开票详情:</span>
+						<div class="layui-input-block">
+							<form:textarea path="details" htmlEscape="false"  colspan="4" rows="6" cssStyle="width: 90%"  maxlength="250" class="form-control "/>
+						</div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl form-group first  project">
+			<div class="layui-item layui-col-xs12 form-table-container">
+				<table id="contentTable" class="table details table-bordered table-condensed">
+					<thead>
+						<tr>
+							<th width="50px"></th>
+							<c:forEach items="${labelNames}" var="projectName"  varStatus="status">
+								<th>项目名称</th>
+								<th width="180px">项目编号</th>
+								<th width="220px">项目报告号</th>
+								<th width="80px">登记人</th>
+								<th width="80px">责任人</th>
+								<th width="250px">委托方</th>
+								<th width="80px">是否开票</th>
+							</c:forEach>
+						</tr>
+					</thead>
+					<tbody><%@ page contentType="text/html;charset=UTF-8" %>
+					<%@ include file="/webpage/include/taglib.jsp"%>
+					<html>
+					<head>
+						<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">
+							$(document).ready(function() {
+								layui.use(['form', 'layer'], function () {
+									var form = layui.form;
+									form.on("radio(isproject)", function(event){
+										var isproject = $(this).val();
+										//专票必填
+										if(isproject == 1){
+											$(".project").show();
+											$("#noProject").hide();
+										}else if(isproject == 2){
+											$(".project").hide();
+											$("#noProject").show();
+										}
+									});
+								})
+								var isProject='${isProject}';
+								if(isProject=="1" || isProject==""){
+									$(".project").show();
+									$("#noProject").hide();
+								}else if(isProject=="2"){
+									$(".project").hide();
+									$("#noProject").show();
+								}
+								var isProjectFalg='${isProjectFalg}';
+								if (isProjectFalg=="1"){
+									parent.layer.msg("第一条为项目后面新增只能选择项目",{icon:6});
+									$("#isProjectFalg").hide();
+									$(".project").show();
+									$("#noProject").hide();
+									$("#projectFlag").val(1);
+								}
+								<%--var val = "<%=request.getAttribute("state")%>";--%>
+								<%--if(val!=null){--%>
+								<%--alert("++++++++++");--%>
+								<%--};--%>
+
+								$('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+									$('#contentTable tbody tr td input.i-checks').iCheck('check');
+								});
+
+								$('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+									$('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
+								});
+
+								//搜索框收放
+								$('#moresee').click(function(){
+									if($('#moresees').is(':visible'))
+									{
+										$('#moresees').slideUp(0,resizeListWindow1);
+										$('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+									}else{
+										$('#moresees').slideDown(0,resizeListWindow1);
+										$('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+									}
+								});
+
+								$("#contentTable tr td").each(function(){
+									$(this).attr("title",$(this).text());
+								});
+							});
+
+							function getSelectedItem(){
+								var array = new Array();
+								var isProject=$('input:radio[name="isProject"]:checked').val();
+								if (isProject==1){
+									var size = $("#contentTable tbody tr td input.i-checks:checked").size();
+									var sizeChecked = $("#contentTable tbody tr td input.i-checks:checked");
+
+									for (var i=0;i<size;i++){
+										array.push(sizeChecked[i].id);
+									}
+									if(size == 0 ){
+										top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
+										return "-1";
+									}
+									/*if(size > 1 ){
+                                        top.layer.alert('只能选择一条数据!', {icon: 0, title:'警告'});
+                                        return "-1";
+                                    }*/
+									$("#projectFlag").val(1);
+								}else{
+									$("#projectFlag").val(0);
+								}
+								var id =  $("#contentTable tbody tr td input.i-checks:checkbox:checked").attr("id");
+								var label = $("#contentTable tbody tr td input.i-checks:checkbox:checked").parent().parent().parent().find(".codelabel").html();
+								var number = $("#contentTable tbody tr td input.i-checks:checkbox:checked").parent().parent().parent().find(".codenumber").html();
+								var details = $("#details").val();
+								var projectFlag = $("#projectFlag").val();
+								console.log(array.toString())
+								return array.toString()+"_item_"+label+"_item_"+number+"_item_"+isProject+"_item_"+details+"_item_"+projectFlag;
+							}
+							function page(n,s){
+								if(n) $("#pageNo").val(n);
+								if(s) $("#pageSize").val(s);
+								$("#searchForm").attr("action","${url}");
+								$("#searchForm").submit();
+								return false;
+							}
+						</script>
+					</head>
+					<body>
+					<div class="wrapper wrapper-content">
+						<div class="layui-row">
+							<div class="full-width fl">
+								<div class="layui-row" id="queryDiv">
+									<form:form id="searchForm" modelAttribute="obj" action="${url}" method="post" class="form-inline layui-form">
+										<input type="hidden" name="url" value="${url}"/>
+										<input type="hidden" name="isTotal" value="${isTotal}"/>
+										<input type="hidden" name="fieldLabels" value="${fieldLabels}"/>
+										<input type="hidden" name="fieldKeys" value="${fieldKeys}"/>
+										<input type="hidden" name="searchLabel" value="${searchLabel}"/>
+										<input type="hidden" name="searchKey" value="${searchKey}"/>
+										<input type="hidden" name="reportNumberKey" value="${reportNumberKey}"/>
+										<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+										<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+										<input id="projectFlag" name="projectFlag" type="hidden" value=""/>
+										<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+										<div class="layui-input-block" id="isProjectFalg">
+											<input type="radio" name="isProject" disabled="true" class="isProject" lay-filter="isproject" title="项目" <c:if test="${isProject ==null || isProject==1 || isProject==3  }">checked</c:if>  id="isproject" value="1">
+											<input type="radio" name="isProject" disabled="true" class="isProject" lay-filter="isproject" title="其它" <c:if test="${isProject==2}">checked</c:if> id="isNoproject" value="2">
+										</div>
+										<div class="project">
+											<div class="commonQuery">
+												<div class="layui-item query athird " style="width: 25%">
+													<span class="layui-form-label">项目名称:</span>
+													<div class="layui-input-block">
+														<form:input path="${searchKey}" htmlEscape="false" maxlength="50" class=" form-control layui-input"/>
+													</div>
+												</div>
+												<div class="layui-item query athird" style="width: 25%">
+													<span class="layui-form-label">项目编号:</span>
+													<div class="layui-input-block">
+														<form:input path="projectId" htmlEscape="false" maxlength="50" class=" form-control layui-input"/>
+													</div>
+												</div>
+												<div class="layui-item query athird" style="width: 25%">
+													<span class="layui-form-label">报告号:</span>
+													<div class="layui-input-block">
+														<form:input path="reportData.number" htmlEscape="false" maxlength="50" class=" form-control layui-input"/>
+													</div>
+												</div>
+												<div class="layui-item athird fr" style="width: 25%">
+													<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" style="clear:both;display:none;">
+												<div class="layui-item query athird">
+													<span class="layui-form-label">是否开票:</span>
+													<div class="layui-input-block readOnlyFFF">
+														<form:select path="invoiceStatus">
+															<form:option value="" label=""/>
+															<form:option value="5" label="已开票"/>
+															<form:option value="2" label="开票中"/>
+														</form:select>
+													</div>
+												</div>
+												<div style="clear:both;"></div>
+											</div>
+										</div>
+										<div id="noProject" style="margin: 20px;display: none;">
+											<span class="layui-form-label">开票详情:</span>
+											<div class="layui-input-block">
+												<form:textarea path="details" htmlEscape="false"  colspan="4" rows="6" cssStyle="width: 90%"  maxlength="250" class="form-control "/>
+											</div>
+										</div>
+									</form:form>
+								</div>
+							</div>
+							<div class="full-width fl form-group first  project">
+								<div class="layui-item layui-col-xs12 form-table-container">
+									<table id="contentTable" class="table details table-bordered table-condensed">
+										<thead>
+										<tr>
+											<th width="50px"></th>
+											<c:forEach items="${labelNames}" var="projectName"  varStatus="status">
+												<th>项目名称</th>
+												<th width="180px">项目编号</th>
+												<th width="220px">项目报告号</th>
+												<th width="80px">登记人</th>
+												<th width="80px">责任人</th>
+												<th width="250px">委托方</th>
+												<th width="80px">是否开票</th>
+											</c:forEach>
+										</tr>
+										</thead>
+										<tbody>
+										<c:choose>
+											<c:when test="${not empty page.list}">
+												<c:forEach items="${page.list}" var="obj">
+													<tr>
+														<td> <input type="checkbox" id="${fns:getValue(obj, 'id')}" class="i-checks"></td>
+														<td class="codelabel">${obj.projectName}</td>
+														<td class="codelabel">${obj.projectId}</td>
+														<td class="codenumber">${obj.reportData.number}</td>
+														<td class="codelabel">${obj.projectRegistrant}</td>
+														<td class="codelabel">${obj.leaderNameStr}</td>
+														<td class="codelabel">${obj.workContractInfo.client.name}</td>
+														<td class="codelabel">${obj.invoiceFlag}</td>
+													</tr>
+												</c:forEach>
+											</c:when>
+											<c:otherwise>
+												<tr>
+													<td colspan="6" align="center">
+														暂无数据
+													</td>
+												</tr>
+											</c:otherwise>
+										</c:choose>
+										</tbody>
+									</table>
+									<table:page page="${page}"></table:page>
+								</div>
+							</div>
+
+						</div>
+					</div>
+					</body>
+					</html>
+					</tbody>
+				</table>
+				<table:page page="${page}"></table:page>
+	</div>
+</div>
+
+	</div>
+</div>
+</body>
+</html>

+ 13 - 7
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllForm.jsp

@@ -78,7 +78,7 @@
 						return false;
 					}
 					if (flag){
-						$("#inputForm").attr("action","${ctx}/workinvoiceAll/workInvoiceAll/save");
+						$("#inputForm").attr("action","${ctx}/workinvoice/workInvoice/save");
 					}else if (!flags){
 						return flag;
 					}
@@ -163,11 +163,12 @@
 					$("#attachment_file").click();
 				});
 				window.bankShow = function (data){
+					console.log('开户行列表')
 					$('#bank').html('<option value="">请选择开户行信息</option>')
 					//对选中开票单位的银行做级联操作
 					for (var info in data){
-						if(data[info].ourBank == '${workInvoice.bank}'){
-							$('#bank').append(new Option(data[info].ourBank,data[info].ourBank,true,true));
+						if(data[info].id == '${workInvoice.bank}'){
+							$('#bank').append(new Option(data[info].ourBank,data[info].id,true,true));
 							$("#bankNumber").val(data[info].bankNumber);
 							if(null != data[info].remarks && undefined != data[info].remarks && '' != data[info].remarks){
 								$('#bankRemarks').html('备注:' + data[info].remarks);
@@ -175,7 +176,7 @@
 								$('#bankRemarks').html('');
 							}
 						}else{
-							$('#bank').append(new Option(data[info].ourBank,data[info].ourBank));
+							$('#bank').append(new Option(data[info].ourBank,data[info].id));
 						}
 					}
 
@@ -270,17 +271,18 @@
 
 		});
 
-		function setValuee(obj){
+		function setValuee (obj){
 			$("#bankNumber").val("");
 			$('#bankRemarks').html('');
 			$.ajax({
 				type:'post',
-				url:'${ctx}/workinvoice/workInvoice/getWorkClientInfo',
+				url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getWorkClientInfo',
 				data:{
 					"obj":obj
 				},
 				success:function(data){
 					var d = JSON.parse(data);
+					//$("#bank").val(d.bank);
 					if(!'${workInvoice.orUnicode}'){
 						$("#orUnicode").val(d.orUnicode);
 					}
@@ -290,6 +292,9 @@
 					if(!'${workInvoice.address}'){
 						$("#address").val(d.registerAddress);
 					}
+					//$("#bankNumber").val(d.bankNumber);
+					// $("#telephone").val(d.telephone);
+					// $("#address").val(d.registerAddress);
 					$("#ids").val(d.ids);
 					window.bankShow(d.bankList);
 				}
@@ -794,6 +799,7 @@
 			<form:hidden path="invoiceDate"/>
 			<form:hidden path="province" id="province"/>
 			<input type="hidden" id="projectFlag" value="${workInvoice.projectFlag}">
+			<input type="hidden" id="showFlag" name="showFlag" value="${showFlag}">
 
 			<div class="form-group layui-row">
 				<div class="form-group-label"><h2>基本信息</h2></div>
@@ -951,7 +957,7 @@
 				<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" readonly="true" placeholder="请输入银行账号"  onkeyup="this.value=this.value.replace(/[^\d-]/g,'')" class="form-control layui-input"/>
+						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" readonly="true" placeholder="请输入银行账号" onkeyup="this.value=this.value.replace(/[^\d-]/g,'')"  class="form-control layui-input"/>
 					</div>
 				</div>
 				</div>

+ 1 - 1
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllModify.jsp

@@ -788,7 +788,7 @@
 							<input id="workInvoiceProjectRelationList{{idx}}_isProject" name="workInvoiceProjectRelationList[{{idx}}].isProject" type="hidden" value="{{row.isProject}}"/>
                         </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"
+                            <sys:gridselectcallprojecttss url="${ctx}/workinvoice/workInvoice/selectnotproject" 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}}" isProjectFalg="{{row.isProjectFalg}}" details="{{row.details}}"></sys:gridselectcallprojecttss>
                         </td>
                         <td>

Plik diff jest za duży
+ 1178 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllNotProjectModify.jsp


+ 13 - 7
src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoForm.jsp

@@ -78,7 +78,7 @@
 						return false;
 					}
 					if (flag){
-						$("#inputForm").attr("action","${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/save");
+						$("#inputForm").attr("action","${ctx}/workinvoice/workInvoice/save");
 					}else if (!flags){
 						return flag;
 					}
@@ -163,11 +163,12 @@
 					$("#attachment_file").click();
 				});
 				window.bankShow = function (data){
+					console.log('开户行列表')
 					$('#bank').html('<option value="">请选择开户行信息</option>')
 					//对选中开票单位的银行做级联操作
 					for (var info in data){
-						if(data[info].ourBank == '${workInvoice.bank}'){
-							$('#bank').append(new Option(data[info].ourBank,data[info].ourBank,true,true));
+						if(data[info].id == '${workInvoice.bank}'){
+							$('#bank').append(new Option(data[info].ourBank,data[info].id,true,true));
 							$("#bankNumber").val(data[info].bankNumber);
 							if(null != data[info].remarks && undefined != data[info].remarks && '' != data[info].remarks){
 								$('#bankRemarks').html('备注:' + data[info].remarks);
@@ -175,7 +176,7 @@
 								$('#bankRemarks').html('');
 							}
 						}else{
-							$('#bank').append(new Option(data[info].ourBank,data[info].ourBank));
+							$('#bank').append(new Option(data[info].ourBank,data[info].id));
 						}
 					}
 
@@ -270,17 +271,18 @@
 
 		});
 
-		function setValuee(obj){
+		function setValuee (obj){
 			$("#bankNumber").val("");
 			$('#bankRemarks').html('');
 			$.ajax({
 				type:'post',
-				url:'${ctx}/workinvoice/workInvoice/getWorkClientInfo',
+				url:'${ctx}/workinvoiceTwo/workinvoiceTwo/getWorkClientInfo',
 				data:{
 					"obj":obj
 				},
 				success:function(data){
 					var d = JSON.parse(data);
+					//$("#bank").val(d.bank);
 					if(!'${workInvoice.orUnicode}'){
 						$("#orUnicode").val(d.orUnicode);
 					}
@@ -290,6 +292,9 @@
 					if(!'${workInvoice.address}'){
 						$("#address").val(d.registerAddress);
 					}
+					//$("#bankNumber").val(d.bankNumber);
+					// $("#telephone").val(d.telephone);
+					// $("#address").val(d.registerAddress);
 					$("#ids").val(d.ids);
 					window.bankShow(d.bankList);
 				}
@@ -765,6 +770,7 @@
 			<form:hidden path="id"/>
 			<form:hidden path="invoiceDate"/>
 			<form:hidden path="province" id="province"/>
+			<input type="hidden" id="showFlag" name="showFlag" value="${showFlag}">
 
 			<div class="form-group layui-row">
 				<div class="form-group-label"><h2>基本信息</h2></div>
@@ -920,7 +926,7 @@
 				<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" readonly="true" placeholder="请输入银行账号" onkeyup="this.value=this.value.replace(/[^\d-]/g,'')" class="form-control layui-input"/>
+						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" readonly="true" placeholder="请输入银行账号" onkeyup="this.value=this.value.replace(/[^\d-]/g,'')"  class="form-control layui-input"/>
 					</div>
 				</div>
 				</div>

+ 2 - 1
src/main/webapp/webpage/modules/workinvoice/workInvoiceExamineModify.jsp

@@ -700,6 +700,7 @@
 			<form:hidden id="flag" path="act.flag"/>
 			<form:hidden path="province" id="province"/>
 			<input type="hidden" id="projectFlag" value="${workInvoice.projectFlag}">
+			<input type="hidden" id="showFlag" name="showFlag" value="${showFlag}">
 			<%--<form:hidden path="invoiceNumber"/>--%>
 
 			<div class="form-group layui-row first lw14">
@@ -834,7 +835,7 @@
 				<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"/>
+						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" placeholder="请输入银行账号"  class="form-control layui-input"/>
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">

+ 737 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceNotProjectAudit.jsp

@@ -0,0 +1,737 @@
+<%@ 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"/>
+	<style>
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		var count = 0;
+		var numcount=0;//验证导入发票号是否重复
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+				$("#opinion").val(ss);
+				if(obj == 1) {
+
+					$("#flag").val("yes");
+				}else {
+					$("#flag").val("no");
+				}
+
+
+				$("#inputForm").submit();
+				return true;
+			}
+			return false;
+		}
+		$(document).ready(function() {
+			layui.use('form', function () {
+				var form = layui.form;
+				form.render();
+			});
+			$("#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: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+				, trigger: 'click'
+			});
+
+			laydate.render({
+				elem: '#takeDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+				, trigger: 'click'
+			});
+			String.prototype.endWith=function(endStr){
+				var d=this.length-endStr.length;
+				return (d>=0&&this.lastIndexOf(endStr)==d)
+			}
+		});
+
+		function addRow(list, idx, tpl, row,flag){
+			var idx1 = $("#workAccountList tr").length;
+			if(list == '#workAccountList' && idx1 < 100){
+				bornTemplete(list, idx, tpl, row, idx1);
+				if($("#invoiceType").val()=="专票"){
+					$("#workAccountList"+idx+"_code").attr("minlength","10");
+					$("#workAccountList"+idx+"_code").attr("maxlength","10");
+				}else if($("#invoiceType").val()=="普票"){
+					$("#workAccountList"+idx+"_code").attr("minlength","12");
+					$("#workAccountList"+idx+"_code").attr("maxlength","12");
+				}
+				if (idx==0 && flag){
+					$("#workAccountList"+idx+"_totalMoney").val(row);
+				}
+				//$("#workAccountList"+idx+"_number").val(("0000000" + 100000000 * Math.random()).match(/(\d{8})(\.|$)/)[1]);
+				// if(idx>0){
+				//     var i = idx-1;
+				//     var code = $("#workAccountList"+i+"_code").val();
+				//     if(code == null || code == undefined || code == ""){
+				// 		i = idx-2;
+				// 		code = $("#workAccountList"+i+"_code").val();
+				//     }
+				//     $("#workAccountList"+idx+"_code").val(code);
+				//
+				// }
+			}
+		}
+		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) {
+			count++;
+			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 isNumber(val){
+			if(val === "" || val ==null){
+				return false;
+			}
+			var regPos = /^\d+(\.\d+)?$/; //非负浮点数
+			var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+			if(regPos.test(val) || regNeg.test(val)){
+				return true;
+			}else{
+				return false;
+			}
+
+		}
+		function 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;
+			if(!value){
+				parent.layer.msg("请正确填写税率",{icon:5});
+				$("#" +  b ).val("");
+				$("#" +  tr ).val("");
+				return;
+			}
+			var m = ${workInvoice.money};
+			var t2 = $("#" +  t ).val();
+			if(!/^\d+(\.\d{1,4})?$/.test( t2 )){
+				parent.layer.msg("请正确填写开票金额",{icon:5});
+				return;
+			}/*else if(t2 > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }*/
+			var tax = 1 + value/100;
+			var p = $("#" +  t ).val() || 0;//获取开票金额
+			if(!p || p == 0){
+				parent.layer.msg("请先填写开票金额,且不能为零",{icon:5});
+				return;
+			}
+			var num = p/tax || 0;
+			$("#" +  b ).val(parseFloat(num.toFixed(2)));
+			var taxRate = p - num;
+			$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+		}
+		function setCheck(obj){
+			var aa = $(obj).attr("id");
+			//金额
+			var b = aa.replace('totalMoney','taxMoney');
+			//税额
+			var tr = aa.replace('totalMoney','taxRate');
+			//开票金额
+			var t = aa.replace('totalMoney','totalMoney');
+			var tm = $("#" +  t ).val();
+			//税率
+			var sl = aa.replace('totalMoney','tax');
+			var sc = $("#" +  sl ).val();
+			//处理百分比税率
+			var tax = 1 + sc/100;
+
+			$("#" +  b ).val("");
+			$("#" +  tr ).val("");
+			var m = ${workInvoice.money};
+			var a = obj.value;
+			/*if(a > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }else{*/
+			var num = tm/tax || 0;
+			$("#" +  b ).val(parseFloat(num.toFixed(2)));
+			var taxRate = tm - num;
+			$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			/*}*/
+		}
+		function getMoney(value,obj){
+			/*var aa = $(obj).attr("id");
+            //金额
+            var b = aa.replace('totalMoney','taxMoney');
+            console.log("b====="+b);
+            //税额
+            var tr = aa.replace('totalMoney','taxRate');
+            //开票金额
+            var t = aa.replace('totalMoney','totalMoney');
+            var tm = $("#" +  t ).val();
+            //税率
+            var sl = aa.replace('totalMoney','tax');
+            var sc = $("#" +  sl ).val();
+            //处理百分比税率
+            var tax = 1 + sc/100;
+
+            var m = ${workInvoice.money};
+            var money = "0.00";
+            //自动计算出结果并填充在相应的输入框中
+            var size = $("#workAccountList tr").length+count;
+            for (var i = 0;i<size;i++){
+                var _totalMoney = $("#workAccountList"+i+"_totalMoney").val();
+
+                var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
+                    if(money==""){
+                        money = parseFloat(_totalMoney).toFixed(2);
+                    }else {
+                        money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
+                    }
+                }
+            }
+            if(money >m){
+                console.log("money--------"+money);
+                $("#" + aa ).val("");
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("发票明细开票金额总值大于主申请发票开票金额",{icon:5});
+                return;
+			}else{
+				var num = tm/tax || 0;
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = tm - 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 checkSame(obj){
+			var value =obj.value;
+			var a = $(obj).attr("id");
+			var idx = a.replace('_number','');
+			var idxx = idx.replace('workAccountList','')
+			var b = a.replace('number','oldNumber');
+			var oldValue = $("#" +  b ).val();
+			var size = $("#workAccountList tr").length+count;
+			for (var i = 0;i<size;i++){
+				var _number = $("#workAccountList"+i+"_number").val();
+				var delFlag = $("#workAccountList"+i+"_delFlag").val();
+				if (_number!=undefined&& delFlag==0 && i!= idxx ){
+					if(_number == value){
+						$("#" +  a ).val("");
+						numcount++;
+						parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+						return;
+					}
+				}
+			}
+			$.ajax({
+				type:'post',
+				url:'${ctx}/workinvoicedetail/workInvoiceDetail/checkSame',
+				data:{
+					"number":value,"oldNumber":oldValue
+				},
+				success:function(data){
+					if("false" == data){
+						$("#" +  a ).val("");
+						numcount++;
+						parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+						return;
+					}
+				}
+			})
+		}
+		function openDialogreExcel(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: 1,
+				area: [500,300],
+				title:"导入数据",
+				skin: 'three-btns with-demo',
+				content:$("#import").html() ,
+				btn: ['导入全部','仅导入当前纳税人识别号', '关闭'],
+				btn1: function(index, layero){
+					var impType='0';
+					importExcel(impType,url)
+					top.layer.close(index);
+				},
+				btn2: function(index, layero){
+					var impType='1';
+					importExcel(impType,url)
+					top.layer.close(index);
+				},
+				btn3: function(index){
+					top.layer.close(index);
+				}
+
+
+			});
+		}
+		function importExcel(impType,url){
+			var orUnicode=$("#orUnicode").val();
+			var invoiceType=$("#invoiceType").val();
+			url=url+"?impType="+encodeURIComponent(impType)+"&orUnicode="+encodeURIComponent(orUnicode)+"&invoiceType="+encodeURIComponent(invoiceType);
+			var formData = new FormData();
+			formData.append("file",top.$("#uploadFile")[0].files[0]);
+			var obj =top.$("#uploadFile")[0].files[0];
+			if(obj==undefined){
+				parent.layer.alert('请选择上传文件',{icon:0,title:'系统提示'});
+				return;
+			}
+			var fileType = obj.name;
+			if(!fileType.endWith("xml")){
+				top.layer.alert('请上传*.xml格式的文件',{icon:0,title:'系统提示'});
+				return;
+			}
+
+			$.ajax({
+				type: 'post',
+				url:url,
+				data: formData,
+				dataType: "json",
+				cache: false,
+				processData: false,
+				contentType: false,
+			}).success(function (data) {
+				for (var i = 0; i < data.data.length; i++) {
+					addExcelRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data.data[i]);
+					if($("#invoiceType").val()=="专票"){
+						$("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","10");
+						$("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","10");
+					}else if($("#invoiceType").val()=="普票"){
+						$("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","12");
+						$("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","12");
+					}
+					workAccountListRowIdx=workAccountListRowIdx+1;
+				}
+				if(numcount>0){
+					top.layer.alert(data.message+" 存在发票号重复数据!",{icon:5});
+				}else{
+					top.layer.alert(data.message,{icon:5});
+				}
+
+			}).error(function () {
+				top.layer.msg("导入文件失败!");
+			});
+		}
+		function addExcelRow(list, idx, tpl, row){
+			var idx1 = $("#workAccountList tr").length;
+			bornTemplete(list, idx, tpl, row, idx1);
+			$("#workAccountList"+idx+"_number").change();
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoice/workInvoice/saveWorkInvoiceNotProjectAudit" method="post" class="form-horizontal layui-form">
+			<form:hidden path="id"/>
+			<form:hidden path="home"/>
+			<form:hidden path="act.taskId"/>
+			<form:hidden path="act.taskName"/>
+			<form:hidden path="act.taskDefKey"/>
+			<form:hidden path="act.procInsId"/>
+			<form:hidden path="act.procDefId"/>
+			<form:hidden id="flag" path="act.flag"/>
+			<c:set var="status" value="${workInvoice.act.status}" />
+			<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">
+			<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>
+								<%--						<th width="100px">操作</th>--%>
+						</tr>
+						</thead>
+						<tbody id="workInvoiceProjectRelationList">
+						<c:forEach items="${workInvoice.workInvoiceProjectRelationList}" var="list">
+							<tr>
+								<td>
+									<input type="text" value="${list.projectName}" readonly="readonly"  class="form-control"/>
+								</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" id="invoiceType"  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" id="orUnicode"   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">收款类型:</label>
+					<div class="layui-input-block">
+						<input id="chargeType" htmlEscape="false" readonly="true"   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"   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 id="kaipiao" 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">
+						<form:input   path="drawerName" 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  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-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 class="form-group layui-row">--%>
+					<%--				<div class="form-group-label"><h2>审批意见</h2></div>--%>
+					<%--				<div class="layui-item layui-col-sm8 lw6 with-textarea">--%>
+					<%--					<div class="layui-input-block" style="margin-left:10px;position: relative">--%>
+					<%--						<form:textarea placeholder="请输入意见:" path="act.comment" id="opinion" class="form-control" rows="4" cssStyle="height: 200px;" maxlength="127" />--%>
+					<%--						<a id="clearOpinon" class="layui-btn" style="position: absolute;bottom: 10px;right: 20px;">清空</a>--%>
+					<%--						<input type="file" name="upload_files" style="display: none;">--%>
+					<%--					</div>--%>
+					<%--				</div>--%>
+					<%--				<div class="layui-item layui-col-sm4 lw6 with-textarea">--%>
+					<%--					<div class="layui-input-block" style="margin-left:10px;">--%>
+					<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="同意" title="同意" style="cursor:pointer" class="apen"/></div>--%>
+					<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="不同意" title="不同意" style="cursor:pointer" class="apen"/></div>--%>
+					<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="请领导审核" title="请领导审核" style="cursor:pointer" class="apen"/></div>--%>
+					<%--						<div style="padding: 5px 0px;">--%>
+					<%--							<form:select path="act.comment" id="auditOpinion" lay-filter="opinion" lay-verify="opinion" class="form-control simple-select">--%>
+					<%--								<form:option value=""/>--%>
+					<%--								<form:options items="${fns:getMainDictListOnProjectAdvent('audit_opinion_template')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
+					<%--							</form:select>--%>
+					<%--						</div>--%>
+					<%--					</div>--%>
+					<%--				</div>--%>
+					<%--			</div>--%>
+					<%--			<div class="layui-item layui-col-sm12 with-textarea">--%>
+					<%--				<label class="layui-form-label">审批意见:</label>--%>
+					<%--				<div class="layui-input-block">--%>
+					<%--					<form:textarea path="act.comment" class="form-control " rows="5" maxlength="20"/>--%>
+					<%--				</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 page-end"></div>
+		</form:form>
+		<div class="form-group-label">
+			<div style="float: right"> <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogre('个人模板列表', '${ctx}/auditTemplate/auditTemplate/templateList?identification=${identification}&name=${identificationName}','80%', '70%','','关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 审核意见模板列表</a></div>
+			<h2>审批意见</h2>
+		</div>
+		<iframe id="iframe" src="${ctx}/auditTemplate/auditTemplate/iframeView?identification=${identification}" name="listresult" frameborder="0" align="left" width="100%" height="300" scrolling="value"></iframe>
+
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>${projectNotifyType}审批流程</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<act:flowChart procInsId="${workInvoice.act.procInsId}"/>
+				<act:histoicFlow procInsId="${workInvoice.act.procInsId}" />
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>

+ 911 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceNotProjectAuditEnd.jsp

@@ -0,0 +1,911 @@
+<%@ 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"/>
+	<style>
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+        var count = 0;
+        var numcount=0;//验证导入发票号是否重复
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  var ss= document.getElementById("iframe").contentWindow.document.getElementById("opinion").value
+			  $("#opinion").val(ss);
+              if(obj == 1) {
+              	//非空验证
+				  var ff=true;
+				  $(".judgment").each(function(){
+					  var zhi=$(this).val();
+					  if (''==zhi || null == zhi){
+						  $(this).css("border","1px solid red")
+						  ff=false;
+					  }else{
+						  $(this).css("border","1px solid #f1f1f1")
+					  }
+				  });
+				  if (!ff){
+					  parent.layer.msg("发票号或开票金额未填写完整!", {icon: 5});
+					  return;
+				  }
+                  $("#flag").val("yes");
+              }else {
+				  $("#flag").val("no");
+              }
+              if(  obj == 1 && $("#workAccountList tr").length==0){
+                  top.layer.alert('请添加发票明细!', {icon: 0});
+                  return;
+              }
+
+              var m = ${workInvoice.money};
+              var money = "0.00";
+              //自动计算出结果并填充在相应的输入框中
+              var size = $("#workAccountList tr").length+count;
+              for (var i = 0;i<size;i++){
+                  var _totalMoney = $("#workAccountList"+i+"_totalMoney").val();
+
+                  var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                  if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
+                      if(money==""){
+                          money = parseFloat(_totalMoney).toFixed(2);
+                      }else {
+                          money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
+                      }
+                  }
+              }
+              if(obj == 1 && money != m ){
+                  top.layer.alert('发票明细总开票金额与主信息开票金额不等,请重新填写!', {icon: 0});
+                  return;
+              }
+
+			  $("#inputForm").submit();
+			  return true;
+		  }
+		  return false;
+		}
+		$(document).ready(function() {
+			layui.use('form', function () {
+				var form = layui.form;
+				form.render();
+			});
+			$("#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: '#invoiceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+
+            laydate.render({
+                elem: '#takeDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            String.prototype.endWith=function(endStr){
+                var d=this.length-endStr.length;
+                return (d>=0&&this.lastIndexOf(endStr)==d)
+            }
+		});
+
+        function addRow(list, idx, tpl, row,flag){
+            var idx1 = $("#workAccountList tr").length;
+            if(list == '#workAccountList' && idx1 < 100){
+                bornTemplete(list, idx, tpl, row, idx1);
+                if($("#invoiceType").val()=="专票"){
+                    $("#workAccountList"+idx+"_code").attr("minlength","10");
+                    $("#workAccountList"+idx+"_code").attr("maxlength","10");
+                }else if($("#invoiceType").val()=="普票"){
+                    $("#workAccountList"+idx+"_code").attr("minlength","12");
+                    $("#workAccountList"+idx+"_code").attr("maxlength","12");
+                }
+                if (idx==0 && flag){
+					$("#workAccountList"+idx+"_totalMoney").val(row);
+				}
+                //$("#workAccountList"+idx+"_number").val(("0000000" + 100000000 * Math.random()).match(/(\d{8})(\.|$)/)[1]);
+                // if(idx>0){
+                //     var i = idx-1;
+                //     var code = $("#workAccountList"+i+"_code").val();
+                //     if(code == null || code == undefined || code == ""){
+				// 		i = idx-2;
+				// 		code = $("#workAccountList"+i+"_code").val();
+                //     }
+                //     $("#workAccountList"+idx+"_code").val(code);
+				//
+				// }
+            }
+        }
+        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) {
+            count++;
+            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 isNumber(val){
+            if(val === "" || val ==null){
+                return false;
+            }
+            var regPos = /^\d+(\.\d+)?$/; //非负浮点数
+            var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+            if(regPos.test(val) || regNeg.test(val)){
+                return true;
+            }else{
+                return false;
+            }
+
+        }
+        function 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;
+            if(!value){
+                parent.layer.msg("请正确填写税率",{icon:5});
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                return;
+			}
+            var m = ${workInvoice.money};
+            var t2 = $("#" +  t ).val();
+            if(!/^\d+(\.\d{1,4})?$/.test( t2 )){
+                parent.layer.msg("请正确填写开票金额",{icon:5});
+                return;
+            }/*else if(t2 > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }*/
+            var tax = 1 + value/100;
+            var p = $("#" +  t ).val() || 0;//获取开票金额
+            if(!p || p == 0){
+                parent.layer.msg("请先填写开票金额,且不能为零",{icon:5});
+                return;
+            }
+            var num = p/tax || 0;
+                $("#" +  b ).val(parseFloat(num.toFixed(2)));
+                var taxRate = p - num;
+                $("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+        }
+        function setCheck(obj){
+            var aa = $(obj).attr("id");
+			//金额
+            var b = aa.replace('totalMoney','taxMoney');
+			//税额
+            var tr = aa.replace('totalMoney','taxRate');
+			//开票金额
+			var t = aa.replace('totalMoney','totalMoney');
+			var tm = $("#" +  t ).val();
+			//税率
+			var sl = aa.replace('totalMoney','tax');
+			var sc = $("#" +  sl ).val();
+			//处理百分比税率
+			var tax = 1 + sc/100;
+
+            $("#" +  b ).val("");
+            $("#" +  tr ).val("");
+            var m = ${workInvoice.money};
+            var a = obj.value;
+            /*if(a > m) {
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("所填值大于发票总开票金额",{icon:5});
+                return;
+            }else{*/
+				var num = tm/tax || 0;
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = tm - num;
+				$("#" +  tr ).val(parseFloat(taxRate.toFixed(2)));
+			/*}*/
+        }
+        function getMoney(value,obj){
+			/*var aa = $(obj).attr("id");
+            //金额
+            var b = aa.replace('totalMoney','taxMoney');
+            console.log("b====="+b);
+            //税额
+            var tr = aa.replace('totalMoney','taxRate');
+            //开票金额
+            var t = aa.replace('totalMoney','totalMoney');
+            var tm = $("#" +  t ).val();
+            //税率
+            var sl = aa.replace('totalMoney','tax');
+            var sc = $("#" +  sl ).val();
+            //处理百分比税率
+            var tax = 1 + sc/100;
+
+            var m = ${workInvoice.money};
+            var money = "0.00";
+            //自动计算出结果并填充在相应的输入框中
+            var size = $("#workAccountList tr").length+count;
+            for (var i = 0;i<size;i++){
+                var _totalMoney = $("#workAccountList"+i+"_totalMoney").val();
+
+                var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
+                    if(money==""){
+                        money = parseFloat(_totalMoney).toFixed(2);
+                    }else {
+                        money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
+                    }
+                }
+            }
+            if(money >m){
+                console.log("money--------"+money);
+                $("#" + aa ).val("");
+                $("#" +  b ).val("");
+                $("#" +  tr ).val("");
+                parent.layer.msg("发票明细开票金额总值大于主申请发票开票金额",{icon:5});
+                return;
+			}else{
+				var num = tm/tax || 0;
+				$("#" +  b ).val(parseFloat(num.toFixed(2)));
+				var taxRate = tm - 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 checkSame(obj){
+            var value =obj.value;
+            var a = $(obj).attr("id");
+            var idx = a.replace('_number','');
+            var idxx = idx.replace('workAccountList','')
+            var b = a.replace('number','oldNumber');
+            var oldValue = $("#" +  b ).val();
+            var size = $("#workAccountList tr").length+count;
+            for (var i = 0;i<size;i++){
+                var _number = $("#workAccountList"+i+"_number").val();
+                var delFlag = $("#workAccountList"+i+"_delFlag").val();
+                if (_number!=undefined&& delFlag==0 && i!= idxx ){
+                    if(_number == value){
+                        $("#" +  a ).val("");
+                        numcount++;
+                        parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+                        return;
+                    }
+                }
+            }
+                $.ajax({
+                    type:'post',
+                    url:'${ctx}/workinvoicedetail/workInvoiceDetail/checkSame',
+                    data:{
+                        "number":value,"oldNumber":oldValue
+                    },
+                    success:function(data){
+                        if("false" == data){
+                            $("#" +  a ).val("");
+                            numcount++;
+                            parent.layer.msg("重复的发票号,请重新输入",{icon:5});
+                            return;
+                        }
+                    }
+                })
+        }
+        function openDialogreExcel(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: 1,
+                area: [500,300],
+                title:"导入数据",
+                skin: 'three-btns with-demo',
+                content:$("#import").html() ,
+                btn: ['导入全部','仅导入当前纳税人识别号', '关闭'],
+                btn1: function(index, layero){
+                    var impType='0';
+                    importExcel(impType,url)
+                    top.layer.close(index);
+                },
+                btn2: function(index, layero){
+                    var impType='1';
+                    importExcel(impType,url)
+                    top.layer.close(index);
+                },
+                btn3: function(index){
+                    top.layer.close(index);
+                }
+
+
+            });
+        }
+        function importExcel(impType,url){
+            var orUnicode=$("#orUnicode").val();
+            var invoiceType=$("#invoiceType").val();
+            url=url+"?impType="+encodeURIComponent(impType)+"&orUnicode="+encodeURIComponent(orUnicode)+"&invoiceType="+encodeURIComponent(invoiceType);
+            var formData = new FormData();
+            formData.append("file",top.$("#uploadFile")[0].files[0]);
+            var obj =top.$("#uploadFile")[0].files[0];
+            if(obj==undefined){
+                parent.layer.alert('请选择上传文件',{icon:0,title:'系统提示'});
+                return;
+            }
+            var fileType = obj.name;
+            if(!fileType.endWith("xml")){
+                top.layer.alert('请上传*.xml格式的文件',{icon:0,title:'系统提示'});
+                return;
+            }
+
+            $.ajax({
+                type: 'post',
+                url:url,
+                data: formData,
+                dataType: "json",
+                cache: false,
+                processData: false,
+                contentType: false,
+            }).success(function (data) {
+                for (var i = 0; i < data.data.length; i++) {
+                    addExcelRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data.data[i]);
+                    if($("#invoiceType").val()=="专票"){
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","10");
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","10");
+					}else if($("#invoiceType").val()=="普票"){
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("minlength","12");
+                        $("#workAccountList"+workAccountListRowIdx+"_code").attr("maxlength","12");
+					}
+                    workAccountListRowIdx=workAccountListRowIdx+1;
+                }
+                if(numcount>0){
+                    top.layer.alert(data.message+" 存在发票号重复数据!",{icon:5});
+				}else{
+                    top.layer.alert(data.message,{icon:5});
+				}
+
+            }).error(function () {
+                top.layer.msg("导入文件失败!");
+            });
+		}
+        function addExcelRow(list, idx, tpl, row){
+            var idx1 = $("#workAccountList tr").length;
+			bornTemplete(list, idx, tpl, row, idx1);
+			$("#workAccountList"+idx+"_number").change();
+        }
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+	<form:form id="inputForm" modelAttribute="workInvoice" action="${ctx}/workinvoice/workInvoice/saveWorkInvoiceNotProjectAudit" method="post" class="form-horizontal layui-form">
+		<form:hidden path="id"/>
+		<form:hidden path="home"/>
+		<form:hidden path="act.taskId"/>
+		<form:hidden path="act.taskName"/>
+		<form:hidden path="act.taskDefKey"/>
+		<form:hidden path="act.procInsId"/>
+		<form:hidden path="act.procDefId"/>
+		<form:hidden id="flag" path="act.flag"/>
+		<c:set var="status" value="${workInvoice.act.status}" />
+		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">
+		<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>
+<%--						<th width="100px">操作</th>--%>
+					</tr>
+					</thead>
+					<tbody id="workInvoiceProjectRelationList">
+						<c:forEach items="${workInvoice.workInvoiceProjectRelationList}" var="list">
+							<tr>
+								<td>
+									<input type="text" value="${list.projectName}" readonly="readonly"  class="form-control"/>
+								</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" id="invoiceType"  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" id="orUnicode"   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">收款类型:</label>
+				<div class="layui-input-block">
+					<input id="chargeType" htmlEscape="false" readonly="true"   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"   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 id="kaipiao" 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">
+					<form:input   path="drawerName" 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">
+					<input class="form-control layer-date laydate-icon layui-input laydate-icondate" id="invoiceDate" name="invoiceDate" 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">
+					<input placeholder="请选择领票时间" class="form-control layer-date laydate-icon layui-input laydate-icondate" id="takeDate" name="takeDate" value="<fmt:formatDate
+							value="${workInvoice.takeDate}" 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-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 class="form-group layui-row">--%>
+<%--				<div class="form-group-label"><h2>审批意见</h2></div>--%>
+<%--				<div class="layui-item layui-col-sm8 lw6 with-textarea">--%>
+<%--					<div class="layui-input-block" style="margin-left:10px;position: relative">--%>
+<%--						<form:textarea placeholder="请输入意见:" path="act.comment" id="opinion" class="form-control" rows="4" cssStyle="height: 200px;" maxlength="127" />--%>
+<%--						<a id="clearOpinon" class="layui-btn" style="position: absolute;bottom: 10px;right: 20px;">清空</a>--%>
+<%--						<input type="file" name="upload_files" style="display: none;">--%>
+<%--					</div>--%>
+<%--				</div>--%>
+<%--				<div class="layui-item layui-col-sm4 lw6 with-textarea">--%>
+<%--					<div class="layui-input-block" style="margin-left:10px;">--%>
+<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="同意" title="同意" style="cursor:pointer" class="apen"/></div>--%>
+<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="不同意" title="不同意" style="cursor:pointer" class="apen"/></div>--%>
+<%--						<div style="padding: 5px 0px;"><input type="checkbox" lay-filter="raopinion" name="sh" value="请领导审核" title="请领导审核" style="cursor:pointer" class="apen"/></div>--%>
+<%--						<div style="padding: 5px 0px;">--%>
+<%--							<form:select path="act.comment" id="auditOpinion" lay-filter="opinion" lay-verify="opinion" class="form-control simple-select">--%>
+<%--								<form:option value=""/>--%>
+<%--								<form:options items="${fns:getMainDictListOnProjectAdvent('audit_opinion_template')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
+<%--							</form:select>--%>
+<%--						</div>--%>
+<%--					</div>--%>
+<%--				</div>--%>
+<%--			</div>--%>
+<%--			<div class="layui-item layui-col-sm12 with-textarea">--%>
+<%--				<label class="layui-form-label">审批意见:</label>--%>
+<%--				<div class="layui-input-block">--%>
+<%--					<form:textarea path="act.comment" class="form-control " rows="5" maxlength="20"/>--%>
+<%--				</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 nav-btns">
+				<a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+				<a href="javascript:void(0)" onclick="openDialogreExcel('导入数据', '${ctx}/workAccount/workAccount/import','90%','90%')" class="nav-btn nav-btn-import" ><i class="fa fa-plus"></i>&nbsp;导入</a>
+				<div id="import" class="hide" style="padding: 5px">
+					<input id="uploadFile" name="file" type="file" style="width:330px"/>导入文件不能超过5M,仅允许导入“xml”格式文件!<br/>  
+						<%--<input type="radio"  name="impType"  checked id="all" value="0">
+						<label for="all">导入全部</label>
+						<input type="radio"  name="impType" id="noAll" value="1">
+						<label for="noAll">仅导入当前纳税人识别号</label>--%>
+
+				</div>
+
+			</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 class="judgment-item"><span class="require-item">*</span>发票号</th>
+						<th class="judgment-item"><span class="require-item">*</span>开票金额</th>
+						<th width="80px">税率</th>
+						<th width="100px">金额</th>
+						<th width="100px">税额</th>
+						<%--<th width="100px">累计登记金额</th>--%>
+						<th width="80px">操作</th>
+						<%--<th><span class="require-item">*</span>发票状态</th>&lt;%&ndash;正常&ndash;%&gt;--%>
+						<%--<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">
+
+					</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 number"/>
+								 </td>
+								 <td>
+									<input id="workAccountList{{idx}}_number" name="workAccountList[{{idx}}].number" onchange="checkSame(this)" type="text" value="{{row.number}}"  minlength="8" maxlength="8"  class="form-control number judgment"/>
+									 <input type="hidden" id="workAccountList{{idx}}_oldNumber" value="{{row.number}}"/>
+								 </td>
+								<td>
+									<input id="workAccountList{{idx}}_totalMoney"  onblur="setCheck(this)"  onchange="getMoney(this.value,this)"  name="workAccountList[{{idx}}].totalMoney" type="text" value="{{row.totalMoney}}"    class="form-control number 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"/><span class="input-group-addon input-height">%</span>
+									</div>
+								</td>
+								<td>
+									<input id="workAccountList{{idx}}_taxMoney" name="workAccountList[{{idx}}].taxMoney" type="text" value="{{row.taxMoney}}"    class="form-control number"/>
+								</td>
+								<td>
+									<input id="workAccountList{{idx}}_taxRate" name="workAccountList[{{idx}}].taxRate" type="text" value="{{row.taxRate}}"    class="form-control number"/>
+								</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 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)};
+						var kaipiao=$("#kaipiao").val();
+						if (data.length==0){
+							addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, kaipiao,"true");
+							workAccountListRowIdx = workAccountListRowIdx + 1;
+						}
+						for (var i=0; i<data.length; i++){
+							addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, data[i]);
+							workAccountListRowIdx = workAccountListRowIdx + 1;
+						}
+					});
+					function f1(row) {
+						// window.parent.document.getElementById('opinion').value = row;
+						$("#opinion").val(row)
+					}
+					function openDialogre(title,url,width,height,target,buttons) {
+						if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+							width = 'auto';
+							height = 'auto';
+						} else {//如果是PC端,根据用户设置的width和height显示。
+						}
+						var split = buttons.split(",");
+						top.layer.open({
+							type: 2,
+							area: [width, height],
+							title: title,
+							maxmin: true, //开启最大化最小化按钮
+							skin: 'three-btns',
+							content: url,
+							btn: split,
+							btn1: function(index, layero){
+								top.layer.close(index)
+								document.getElementById('iframe').contentWindow.location.reload();
+							}
+						});
+					}
+				</script>
+			</div>
+		</div>
+
+
+		<div class="form-group layui-row page-end"></div>
+	</form:form>
+		<div class="form-group-label">
+			<div style="float: right"> <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogre('个人模板列表', '${ctx}/auditTemplate/auditTemplate/templateList?identification=${identification}&name=${identificationName}','80%', '70%','','关闭')" class="nav-btn layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 审核意见模板列表</a></div>
+			<h2>审批意见</h2>
+		</div>
+		<iframe id="iframe" src="${ctx}/auditTemplate/auditTemplate/iframeView?identification=${identification}" name="listresult" frameborder="0" align="left" width="100%" height="300" scrolling="value"></iframe>
+
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>${projectNotifyType}审批流程</h2></div>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<act:flowChart procInsId="${workInvoice.act.procInsId}"/>
+				<act:histoicFlow procInsId="${workInvoice.act.procInsId}" />
+			</div>
+		</div>
+	</div>
+</div>
+</body>
+</html>

Plik diff jest za duży
+ 1178 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceNotProjectModify.jsp


+ 3 - 2
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoForm.jsp

@@ -80,7 +80,7 @@
 					}
 
 					if (flag){
-						$("#inputForm").attr("action","${ctx}/workinvoiceTwo/workinvoiceTwo/save");
+						$("#inputForm").attr("action","${ctx}/workinvoice/workInvoice/save");
 					}else if (!flags){
 						return flag;
 					}
@@ -798,11 +798,12 @@
 <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: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"/>
 			<input type="hidden" id="projectFlag" value="${workInvoice.projectFlag}">
+			<input type="hidden" id="showFlag" name="showFlag" value="${showFlag}">
 
 			<div class="form-group layui-row">
 				<div class="form-group-label"><h2>基本信息</h2></div>

+ 2 - 3
src/main/webapp/webpage/modules/workinvoice/workInvoiceTwoModify.jsp

@@ -127,7 +127,6 @@
 						}
 					}
 
-					layui.form.render("select");
 					form.render();
 				}
 
@@ -799,7 +798,7 @@
 							<input id="workInvoiceProjectRelationList{{idx}}_isProject" name="workInvoiceProjectRelationList[{{idx}}].isProject" type="hidden" value="{{row.isProject}}"/>
                         </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"
+                            <sys:gridselectcallprojecttss url="${ctx}/workinvoice/workInvoice/selectnotproject" 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}}" isProjectFalg="{{row.isProjectFalg}}" details="{{row.details}}"></sys:gridselectcallprojecttss>
                         </td>
                         <td>
@@ -911,7 +910,7 @@
 				<div class="layui-item layui-col-sm6 count1">
 					<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" readonly="true" placeholder="请输入银行账号"  class="form-control number layui-input"/>
+						<form:input id="bankNumber" path="bankNumber" htmlEscape="false" readonly="true" placeholder="请输入银行账号"  class="form-control layui-input"/>
 					</div>
 				</div>
 				<div class="layui-form-item count2">