Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

user5 3 éve
szülő
commit
b57846ddae
22 módosított fájl, 1230 hozzáadás és 34 törlés
  1. 61 2
      src/main/java/com/jeeplus/modules/projectConstruction/web/ContractController.java
  2. 79 0
      src/main/java/com/jeeplus/modules/projectrecord/service/ProjectImplementEarlyService.java
  3. 7 0
      src/main/java/com/jeeplus/modules/workinvoice/dao/WorkInvoiceDao.java
  4. 1 1
      src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoiceExport.java
  5. 10 0
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java
  6. 2 3
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java
  7. 47 0
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceAllTwoController.java
  8. 1 0
      src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java
  9. 4 0
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementAllService.java
  10. 1 1
      src/main/resources/mappings/modules/bzshbExamin/StandardOpinionDao.xml
  11. 22 0
      src/main/resources/mappings/modules/projectrecord/ProjectRecordsDao.xml
  12. 3 1
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml
  13. 1 1
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  14. 6 1
      src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml
  15. 56 2
      src/main/webapp/webpage/modules/ProjectFollowReport/ProjectFollowReportList.jsp
  16. 30 18
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowForm.jsp
  17. 2 2
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowModify.jsp
  18. 1 1
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowView.jsp
  19. 10 0
      src/main/webapp/webpage/modules/sys/gridinvoiceproject.jsp
  20. 12 1
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllList.jsp
  21. 12 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceAllTwoList.jsp
  22. 862 0
      src/main/webapp/webpage/modules/workinvoice/workInvoiceModifyInfo.jsp

+ 61 - 2
src/main/java/com/jeeplus/modules/projectConstruction/web/ContractController.java

@@ -28,12 +28,15 @@ import com.jeeplus.modules.projectcontentinfo.entity.*;
 import com.jeeplus.modules.projectcontentinfo.service.*;
 import com.jeeplus.modules.projectcontroltable.entity.ProjectControlTable;
 import com.jeeplus.modules.projectcontroltable.service.ProjectControlTableService;
+import com.jeeplus.modules.projectrecord.dao.monthly.MonthlyConsultationReportDao;
 import com.jeeplus.modules.projectrecord.entity.*;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.projectrecord.service.early.ProjectEarlyReviewService;
 import com.jeeplus.modules.projectrecord.service.monthly.MonthlyConsultationReportService;
+import com.jeeplus.modules.projectreportnum.dao.ProjectReportNumDao;
+import com.jeeplus.modules.projectreportnum.entity.ReportNum;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.Role;
@@ -100,6 +103,12 @@ public class ContractController extends BaseController {
     private ActTaskService actTaskService;
     @Autowired
     private UserService userService;
+    @Autowired
+    private MonthlyConsultationReportDao monthlyConsultationReportDao;
+    @Autowired
+    private ProjectReportNumDao projectReportNumDao;
+
+    private static byte[] SYN_BYTE = new byte[0];
 
     /*@ModelAttribute
     public ConstructionContract get(@RequestParam(required=false) String id) {
@@ -577,7 +586,35 @@ public class ContractController extends BaseController {
             }
             return "modules/projectrecord/workContentFromAndView/workFollowForm";
         }
-
+        //获取编号
+        //查询项目报告号前缀
+        String projectNumPrefix = monthlyConsultationReportDao.getProjectNum(projectFollowReport.getProject().getId());
+        projectNumPrefix += "-ZX-";
+
+        //获取最后一个报告号数据信息
+        ReportNum reportNum = new ReportNum();
+        reportNum.setNum(projectNumPrefix);
+        ReportNum lastReportNum = projectReportNumDao.getLastReportNum(reportNum);
+        //判断是否是新的报告号
+        if (null != lastReportNum){
+            //不是
+            lastReportNum.getNum().lastIndexOf("-");
+            //截取最后四位流水号
+            String substring = lastReportNum.getNum().substring(lastReportNum.getNum().lastIndexOf("-")+1, lastReportNum.getNum().length());
+            //转换为数字并递增
+            Integer substringInteger = Integer.parseInt(substring)+1;
+            //生成新的流水号
+            StringBuffer newSerialNum = new StringBuffer();
+            for(int x = 0; x < (4 - substringInteger.toString().length()); x++) {
+                newSerialNum.append("0");
+            }
+            newSerialNum.append(substringInteger);
+            reportNum.setNum(reportNum.getNum()+newSerialNum);
+        }else{
+            //是则在后面添加0001初始报告号
+            reportNum.setNum(reportNum.getNum()+"0001");
+        }
+        projectFollowReport.setProjectFollowId(reportNum.getNum());
         //查询真实总审人员信息
         List<User> auditUserList = userService.getAuditUserListByType("2");
         projectFollowReport.setBzshbUserList(auditUserList);
@@ -626,7 +663,29 @@ public class ContractController extends BaseController {
             projectImplementEarlyService.updateFollow(projectFollowReport);
         } else {
             //进行新增操作
-            projectImplementEarlyService.insertFollow(projectFollowReport);
+            synchronized (SYN_BYTE) {
+                projectImplementEarlyService.insertFollow(projectFollowReport);
+            }
+        }
+        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
+    }
+    /**
+     * 暂存操作
+     * @param projectFollowReport
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping(value = "storFollow")
+    public String storFollow(ProjectFollowReport projectFollowReport, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        //查询项目信息
+        ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
+        //将项目信息放入跟踪咨询报告中
+        projectFollowReport.setProject(records);
+        //进行新增操作
+        synchronized (SYN_BYTE) {
+            projectImplementEarlyService.storFollow(projectFollowReport);
         }
         return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
     }

+ 79 - 0
src/main/java/com/jeeplus/modules/projectrecord/service/ProjectImplementEarlyService.java

@@ -318,6 +318,85 @@ public class ProjectImplementEarlyService extends CrudService<ProjectImplementEa
     }
 
     /**
+     * 暂存跟踪咨询报告信息
+     * @param projectFollowReport
+     * @throws Exception
+     */
+    @Transactional(readOnly = false)
+    public void storFollow(ProjectFollowReport projectFollowReport) throws Exception {
+        projectFollowReport.setStatus(ProjectStatusEnum.TSTORE.getValue());
+        //查询项目报告号前缀
+        String projectNumPrefix = monthlyConsultationReportDao.getProjectNum(projectFollowReport.getProject().getId());
+        projectNumPrefix += "-ZX-";
+
+        //获取最后一个报告号数据信息
+        ReportNum reportNum = new ReportNum();
+        reportNum.setNum(projectNumPrefix);
+        ReportNum lastReportNum = projectReportNumDao.getLastReportNum(reportNum);
+        //判断是否是新的报告号
+        if (null != lastReportNum){
+            //不是
+            lastReportNum.getNum().lastIndexOf("-");
+            //截取最后四位流水号
+            String substring = lastReportNum.getNum().substring(lastReportNum.getNum().lastIndexOf("-")+1, lastReportNum.getNum().length());
+            //转换为数字并递增
+            Integer substringInteger = Integer.parseInt(substring)+1;
+            //生成新的流水号
+            StringBuffer newSerialNum = new StringBuffer();
+            for(int x = 0; x < (4 - substringInteger.toString().length()); x++) {
+                newSerialNum.append("0");
+            }
+            newSerialNum.append(substringInteger);
+            reportNum.setNum(reportNum.getNum()+newSerialNum);
+        }else{
+            //是则在后面添加0001初始报告号
+            reportNum.setNum(reportNum.getNum()+"0001");
+        }
+        reportNum.preInsert();
+        //报告号进行新增操作
+        projectReportNumDao.insert(reportNum);
+        projectFollowReport.setProjectFollowId(reportNum.getNum());
+
+        //跟踪咨询报告信息进行新增操作
+        projectFollowReport.preInsert();
+        projectFollowReportDao.insertFollow(projectFollowReport);
+        //保存月报基本信息
+        ProjectContentData projectContentData = projectFollowReport.getProjectContentData();
+        //保存依据资料信息
+        if(projectContentData.getProjectBasedDataList()!=null&&!projectContentData.getProjectBasedDataList().isEmpty()){
+            for (ProjectBasedData data:projectContentData.getProjectBasedDataList()) {
+                if (data.getDelFlag().equals("0")){
+                    List<ProjectBasedData> projectBasedData = new ArrayList<>();
+                    projectBasedData.add(data);
+                    projectContentDataService.saveBasedData(projectFollowReport.getId(),projectBasedData);
+                }
+            }
+        }
+        if (projectFollowReport.getWorkAttachments()!=null && !projectFollowReport.getWorkAttachments().isEmpty()) {
+            //保存附件信息
+            for (Workattachment workattachment : projectFollowReport.getWorkAttachments()) {
+                if (workattachment.getId() == null) {
+                    continue;
+                }
+                if (workattachment.DEL_FLAG_NORMAL.equals(workattachment.getDelFlag())) {
+                    workattachment.setAttachmentId(projectFollowReport.getId());
+                    workattachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workattachment.getId()) || "null".equals(workattachment.getId())) {
+                        //新增
+                        workattachmentService.insertOnWorkAttachment(workattachment);
+                    } else {
+                        //修改
+                        workattachmentService.updateOnWorkAttachment(workattachment);
+                    }
+                } else {
+                    //删除
+                    workattachmentDao.delete(workattachment);
+                }
+            }
+        }
+    }
+
+    /**
      * 启动审批流程
      *
      * @param projectFollowReport

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

@@ -32,6 +32,13 @@ public interface WorkInvoiceDao extends CrudDao<WorkInvoice> {
 	public int updateProcessInstanceId(WorkInvoice workInvoice);
 
 	/**
+	 * 修改日期信息
+	 * @param workInvoice
+	 * @return
+	 */
+	public int updateDate(WorkInvoice workInvoice);
+
+	/**
 	 * 删除作废操作
 	 * @param workInvoice
 	 */

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

@@ -295,7 +295,6 @@ public class WorkInvoiceExport extends ActEntity<WorkInvoiceExport> {
 		this.projectName = projectName;
 	}
 
-	@ExcelField(title="开票金额", align=2, sort=7)
 	public Double getMoney() {
 		return money;
 	}
@@ -304,6 +303,7 @@ public class WorkInvoiceExport extends ActEntity<WorkInvoiceExport> {
 		this.money = money;
 	}
 
+	@ExcelField(title="开票金额", align=2, sort=7)
 	public String getMoneyStr() {
 		return moneyStr;
 	}

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

@@ -2213,4 +2213,14 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 		}
 		return projectRelationList;
 	}
+
+	/**
+	 * 修改发票信息
+	 * @param workInvoice
+	 */
+	@Transactional(readOnly = false)
+	public void updateDetils(WorkInvoice workInvoice){
+		workInvoiceDao.updateDate(workInvoice);
+		this.updateWorkInvoiceInfo(workInvoice);
+	}
 }

+ 2 - 3
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -207,8 +207,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		for (WorkInvoiceProjectRelation projectRelation:projectRelationList) {
 			if(null!=projectRelation.getIsProject()){
 				if ( projectRelation.getIsProject() == 2) {
-					projectRelation.setProjectName("非项目发票");
-					projectRelation.setWorkContractName(projectRelation.getDetails());
+					projectRelation.setProjectName(projectRelation.getDetails());
 				}
 			}
 		}
@@ -363,7 +362,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 					if(projectNameList.contains("非项目发票")){
 						continue;
 					}
-					projectNameList.add("非项目发票:"+projectRelation.getDetails());
+					projectNameList.add("其它:"+projectRelation.getDetails());
 
 				}
 

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

@@ -323,6 +323,7 @@ public class WorkInvoiceAllTwoController extends BaseController {
 		model.addAttribute("workInvoice", workInvoice);
 		return "modules/workinvoice/" + view;
 	}
+
 	/**
 	 * 查看,增加,编辑开票管理表单页面
 	 */
@@ -682,6 +683,7 @@ public class WorkInvoiceAllTwoController extends BaseController {
 				List<String> projectNameList = Lists.newArrayList();
 				List<String> reportNumber = Lists.newArrayList();
 				List<String> widNumber = Lists.newArrayList();
+				invoice.setMoneyStr(invoice.getMoney().toString());
 				boolean f = false;
 				for (WorkInvoiceProjectRelation info : projectRelation) {
 					if (StringUtils.isNotBlank(info.getReportDataNum())) {
@@ -1356,4 +1358,49 @@ public class WorkInvoiceAllTwoController extends BaseController {
 		return "redirect:"+Global.getAdminPath()+"/workinvoiceAllTwo/workinvoiceAllTwo/?repage";
 	}
 
+	/**
+	 * 管理修改发票明细
+	 * @param workInvoice
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping(value = "modifyDetails")
+	public String modifyDetails(WorkInvoice workInvoice, Model model) {
+		if(StringUtils.isNotBlank(workInvoice.getId())){
+			workInvoiceService.queryDetails(workInvoice);
+		}
+		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("workInvoice", workInvoice);
+		model.addAttribute("view", workInvoice.getHome());
+		return "modules/workinvoice/workInvoiceModifyInfo";
+	}
+
+	/**
+	 * 修改明细
+	 * @param workInvoice
+	 * @return
+	 */
+	@RequestMapping(value = "updateWorkInvoiceInfo")
+	public String updateWorkInvoiceInfo(WorkInvoice workInvoice) {
+		workInvoiceService.updateDetils(workInvoice);
+		if (StringUtils.isNotBlank(workInvoice.getHome()) && workInvoice.getHome().equals("oldInfo")){
+			return "redirect:"+Global.getAdminPath()+"/workinvoiceAll/workInvoiceAll/?repage";
+		}
+		return "redirect:"+Global.getAdminPath()+"/workinvoiceAllTwo/workinvoiceAllTwo/?repage";
+	}
+
+
 }

+ 1 - 0
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceTwoController.java

@@ -687,6 +687,7 @@ public class WorkInvoiceTwoController extends BaseController {
 				List<String> projectNameList = Lists.newArrayList();
 				List<String> reportNumber = Lists.newArrayList();
 				List<String> widNumber = Lists.newArrayList();
+				invoice.setMoneyStr(invoice.getMoney().toString());
 				boolean f = false;
 				for (WorkInvoiceProjectRelation info : projectRelation) {
 					if (StringUtils.isNotBlank(info.getReportDataNum())) {

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

@@ -289,6 +289,10 @@ public class WorkReimbursementAllService extends CrudService<WorkReimbursementDa
                                 if(null != projectReportData){
                                     info.setProjectName(projectReportData.getNumber());
                                 }
+                            }else{
+                                ProjectRecords project = new ProjectRecords();
+                                project.setProjectName(workAccount.getReimburseRemarks());
+                                info.setProject(project);
                             }
                             info.getWorkAccount().setProjectRadio(1);
                         }else{

+ 1 - 1
src/main/resources/mappings/modules/bzshbExamin/StandardOpinionDao.xml

@@ -47,7 +47,7 @@
 				</foreach>
 			</if>
 			<if test="(userId != null and userId != '') or (userName != null and userName != '')">
-				AND (wpu.user_id = #{userId} or su.name like concat('%',#{userName},'%'))
+				AND (wpu.user_id = #{userId} or su.name =#{userName})
 			</if>
 		</where>
 		group by wpu.user_id

+ 22 - 0
src/main/resources/mappings/modules/projectrecord/ProjectRecordsDao.xml

@@ -1027,6 +1027,16 @@
 					AND prd.number like concat(concat('%',#{reportData.number}),'%')
 				</if>
 			</if>
+			<if test="invoiceStatus != null and invoiceStatus != ''">
+				<choose>
+					<when test="invoiceStatus== 5">
+						AND wi.invoice_state = '5'
+					</when>
+					<otherwise>
+						AND wi.invoice_state in (1,2,3,4)
+					</otherwise>
+				</choose>
+			</if>
 			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
 			/*and prd.number is not null*/
 			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
@@ -1059,6 +1069,8 @@
 		<if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
 			LEFT JOIN work_client_info wct on wci.client_id = wct.id
 		</if>
+		left join work_invoice_project_relation wipr on wipr.project_id = a.id
+		left join work_invoice wi on wi.id = wipr.invoice_id
 		<where>
 			<if test="projectId != null and projectId != ''">
 				AND a.project_id like concat('%',#{projectId},'%')
@@ -1119,6 +1131,16 @@
 					AND prd.number like concat(concat('%',#{reportData.number}),'%')
 				</if>
 			</if>
+			<if test="invoiceStatus != null and invoiceStatus != ''">
+				<choose>
+					<when test="invoiceStatus== 5">
+						AND wi.invoice_state = '5'
+					</when>
+					<otherwise>
+						AND wi.invoice_state in (1,2,3,4)
+					</otherwise>
+				</choose>
+			</if>
 			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
 			/*and prd.number is not null*/
 			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">

+ 3 - 1
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -959,6 +959,7 @@ END) as projectScale*/
 			and prd.status = 5
 			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
 			and rprr.report_status is not null
+			and a.reported_state=7
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 					/*B类紧急*/
@@ -1009,7 +1010,8 @@ END) as projectScale*/
 			and prd.status = 5
 			AND  a.status != 7 AND a.del_flag = #{DEL_FLAG_NORMAL}
 			and rprr.report_status is not null
-			and rprr.JingHeJianLv>30
+			and a.reported_state=11
+			AND( rprr.JingHeJianLv > 30 or rprr.JingHeJianLv &lt;=-30)
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 					/*B类紧急*/

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

@@ -1809,7 +1809,7 @@
 		select
 		count(a.id)
 		FROM rural_project_records a
-		where a.project_name=#{projectName}
+		where a.project_name=#{projectName}  and a.`status`!=7
 	</select>
 
     <update id="updateReportDataTwo">

+ 6 - 1
src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml

@@ -1064,7 +1064,12 @@
 			area_parent_id = (select parent_ids from sys_area where id = #{area.id})
 		WHERE id = #{id}
 	</update>
-
+	<update id="updateDate">
+		UPDATE work_invoice SET
+			invoice_date = #{invoiceDate},
+			take_date = #{takeDate}
+		WHERE id = #{id}
+	</update>
 
 	<!--物理删除-->
 	<update id="delete">

+ 56 - 2
src/main/webapp/webpage/modules/ProjectFollowReport/ProjectFollowReportList.jsp

@@ -496,7 +496,7 @@
 					}else if(d.status == 3){
 						return [
 							'<div class=\"layui-btn-group\">'+
-							'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改跟踪咨询报告内容\', \'${ctx}/project/constructionContract/followForm?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs" >编辑</a>',
+							'<a href="javascript:void(0)" onclick="openDialogreModify(\'修改跟踪咨询报告内容\', \'${ctx}/project/constructionContract/followForm?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs" >编辑</a>',
 							'<a href="${ctx}/project/constructionContract/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除</a>',
 
 							+'</div>'
@@ -504,7 +504,7 @@
 					}else if(d.status == 4){
 						return [
 							'<div class=\"layui-btn-group\">'+
-							'<a href="javascript:void(0)" onclick="openDialogreModify(\'修改跟踪咨询报告内容\', \'${ctx}/project/constructionContract/modify?id='+d.id+'&project.id='+d.pid+ '\',\''+d.id+'\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs" > 编辑</a>',
+							'<a href="javascript:void(0)" onclick="openDialogreModify(\'修改跟踪咨询报告内容\', \'${ctx}/project/constructionContract/modify?id='+d.id+'&project.id='+d.pid+ '\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs" > 编辑</a>',
 							'<a href="${ctx}/project/constructionContract/deleteFollow?project.id='+d.pid+'&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该跟踪咨询报告吗?\', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除</a>',
 
 							+'</div>'
@@ -610,6 +610,60 @@
 			skin: 'three-btns',
 			maxmin: true, //开启最大化最小化按钮
 			content: url ,
+			btn: ['提交','暂存','关闭'],
+			btn1: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				if(iframeWin.contentWindow.doSubmit(1) ){
+					top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+			},
+			btn2: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				inputForm.attr("action","${ctx}/project/constructionContract/storFollow")
+				if(iframeWin.contentWindow.doSubmit(2) ){
+					top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+				return false;
+			},
+			btn3: function(index){
+			}
+		});
+	}
+	function openDialogreModify(title,url,width,height,target){
+
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin: 'three-btns',
+			maxmin: true, //开启最大化最小化按钮
+			content: url ,
 			btn: ['提交','关闭'],
 			btn1: function(index, layero){
 				var body = top.layer.getChildFrame('body', index);

+ 30 - 18
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowForm.jsp

@@ -5,6 +5,7 @@
 	<title>跟踪咨询报告详情管理</title>
 	<meta name="decorator" content="default"/>
     <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
     <style>
         #projectContentDataType-error{
             left:0;
@@ -32,26 +33,37 @@
 
         var validateForm;
         var detailFlag =0;
-        function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
             if(validateForm.form()){
-                var bzshbUserId = $("#bzshbUserId").val();
-                if(bzshbUserId == undefined || bzshbUserId ==null || bzshbUserId ==''){
-                    parent.layer.msg("请选择审核人员!", {icon: 5});
-                    return false;
-                }
-                var length = document.getElementById("workBaseDataList");
-                var rows = length.rows.length;
-                var idList = [];
-                for (var i=0;i<rows;i++){
-                    var chooseCondition = $("#workBaseDataList"+i+"_chooseCondition").val();
-                    if(chooseCondition==1){
-                        var fileUrl = $("#workBaseDataList"+i+"_fileUrl").val();
-                        if(fileUrl == null || fileUrl == ''){
-                            layer.msg('请上传依据性资料必填文件', {icon: 5});
-                            return false;
+                if (i==1){
+                    var bzshbUserId = $("#bzshbUserId").val();
+                    if(bzshbUserId == undefined || bzshbUserId ==null || bzshbUserId ==''){
+                        parent.layer.msg("请选择审核人员!", {icon: 5});
+                        return false;
+                    }
+                    var length = document.getElementById("workBaseDataList");
+                    var rows = length.rows.length;
+                    var idList = [];
+                    for (var i=0;i<rows;i++){
+                        var chooseCondition = $("#workBaseDataList"+i+"_chooseCondition").val();
+                        if(chooseCondition==1){
+                            var fileUrl = $("#workBaseDataList"+i+"_fileUrl").val();
+                            if(fileUrl == null || fileUrl == ''){
+                                layer.msg('请上传依据性资料必填文件', {icon: 5});
+                                return false;
+                            }
                         }
                     }
+                    var flags=judgment();
+                    if (!flags){
+                        return flags;
+                    }
+                    $("#inputForm").attr("${ctx}/project/constructionContract/saveFollow?view=content&condition=${flag}");
                 }
+                if (i==2){
+                    $("#inputForm").attr("${ctx}/project/constructionContract/storFollow");
+                }
+
 
                 beforeSubmit();
                 $("#inputForm").submit();
@@ -592,7 +604,7 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label"><span class="require-item">*</span>跟踪咨询名称:</label>
                     <div class="layui-input-block">
-                        <form:input path="projectFollowName" htmlEscape="false" class="form-control required layui-input"/>
+                        <form:input path="projectFollowName" htmlEscape="false" class="form-control judgment layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
@@ -812,7 +824,7 @@
                 }
             </script>
             <div class="form-group layui-row">
-                <div class="form-group-label"><h2>附件信息</h2></div>
+                <div class="form-group-label"><h2>成果文件</h2></div>
                 <div class="layui-item nav-btns">
                     <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
                 </div>

+ 2 - 2
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowModify.jsp

@@ -637,7 +637,7 @@
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>依据性资料明细</h2></div>
                 <div class="layui-item nav-btns">
-                    <%--<a href="javascript:void(0)" onclick="openDialogre('新增依据性资料', '${ctx}/projectcontentinfo/projectcontentinfo/form?view=basedData&dictType=${projectFollowReport.dictType}&id=${projectFollowReport.id}&parentIds=${projectFollowReport.parentIds}&project.id=${projectFollowReport.project.id}','90%','90%','inputForm')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 新增</a>--%>
+                    <a href="javascript:void(0)" onclick="openDialogre('新增依据性资料', '${ctx}/projectcontentinfo/projectcontentinfo/form?view=basedData&dictType=${projectFollowReport.dictType}&id=${projectFollowReport.id}&parentIds=${projectFollowReport.parentIds}&project.id=${projectFollowReport.project.id}','90%','90%','inputForm')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 新增</a>
 
                     <sys:gridselectBaseData url="${ctx}/projectcontentinfo/projectBasedData/selectList" id="baseData" title="选择依据资料"
                                             cssClass="form-control" projectId="${projectFollowReport.project.id}" fieldLabels="" fieldKeys=""  searchLabel="${fns:urlEncode('依据资料名称')}" searchKey="name"></sys:gridselectBaseData>
@@ -820,7 +820,7 @@
                 }
             </script>
             <div class="form-group layui-row">
-                <div class="form-group-label"><h2>附件信息</h2></div>
+                <div class="form-group-label"><h2>成果文件</h2></div>
                 <div class="layui-item nav-btns">
                     <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
                 </div>

+ 1 - 1
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowView.jsp

@@ -786,7 +786,7 @@
                 }
             </script>
             <div class="form-group layui-row">
-                <div class="form-group-label"><h2>附件信息</h2></div>
+                <div class="form-group-label"><h2>成果文件</h2></div>
                 <div id="addFile_attachment" style="display: none" class="upload-progress">
                     <span id="fileName_attachment" ></span>
                     <b><span id="baifenbi_attachment" ></span></b>

+ 10 - 0
src/main/webapp/webpage/modules/sys/gridinvoiceproject.jsp

@@ -141,6 +141,16 @@
 									<form:input path="reportData.number" htmlEscape="false" maxlength="50" class=" form-control layui-input"/>
 								</div>
 							</div>
+							 <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>

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

@@ -718,7 +718,10 @@
                         {
                             xml += "<a href=\"javascript:void(0)\" onclick=\"contractOpenDialogre('变更发票管理', '${ctx}/workinvoiceAll/workInvoiceAll/alterForm?id="+ d.id +"','95%','95%')\" class=\"op-btn op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
                         }*/
-
+						if(d.modifyDetails != undefined && d.modifyDetails =="1" && d.financeFlag =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreModify('修改发票明细', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/modifyDetails?id=" + d.id + " &home=oldInfo ','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" >修改明细</a>";
+						}
 						if(d.adminModify != undefined && d.adminModify =="1")
 						{
 							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreModify('管理员修改发票', '${ctx}/workinvoiceAll/workInvoiceAll/form?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" >管理员修改</a>";
@@ -828,6 +831,14 @@
 					<shiro:hasPermission name="ruralProject:ruralProjectView:workInvoiceAllView">
 					,"showView":1
 					</shiro:hasPermission>
+
+					<shiro:hasPermission name="workinvoice:workInvoice:modifyDetails">
+					,"modifyDetails":
+							<c:choose>
+							<c:when test="${workInvoice.invoiceState == 5}">"1"</c:when>
+					<c:otherwise>"0"</c:otherwise>
+					</c:choose>
+					</shiro:hasPermission>
                 }
                 </c:forEach>
                 </c:if>

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

@@ -785,6 +785,10 @@
                             xml += "<a href=\"javascript:void(0)\" onclick=\"contractOpenDialogre('变更发票管理', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/alterForm?id="+ d.id +"','95%','95%')\" class=\"op-btn op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
                         }*/
 
+						if(d.modifyDetails != undefined && d.modifyDetails =="1"  && d.financeFlag =="1")
+						{
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreModify('修改发票明细', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/modifyDetails?id=" + d.id + " ','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" >修改明细</a>";
+						}
 						if(d.adminModify != undefined && d.adminModify =="1")
 						{
 							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreModify('管理员修改发票', '${ctx}/workinvoiceAllTwo/workinvoiceAllTwo/form?id=" + d.id + "&tabId=3','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" >管理员修改</a>";
@@ -893,9 +897,17 @@
 								<c:otherwise>"0"</c:otherwise>
 						</c:choose>
 					</shiro:hasPermission>
+					<shiro:hasPermission name="workinvoice:workInvoice:modifyDetails">
+					,"modifyDetails":
+								<c:choose>
+									<c:when test="${workInvoice.invoiceState == 5}">"1"</c:when>
+									<c:otherwise>"0"</c:otherwise>
+								</c:choose>
+					</shiro:hasPermission>
 					<shiro:hasPermission name="ruralProject:ruralProjectView:workInvoiceAllView">
 					,"showView":1
 					</shiro:hasPermission>
+
                 }
                 </c:forEach>
                 </c:if>

+ 862 - 0
src/main/webapp/webpage/modules/workinvoice/workInvoiceModifyInfo.jsp

@@ -0,0 +1,862 @@
+<%@ 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()){
+              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}/workinvoiceAllTwo/workinvoiceAllTwo/updateWorkInvoiceInfo" 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}" />
+		<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>
+		<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 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>
+</div>
+</body>
+</html>