<%-- Created by IntelliJ IDEA. User: zht Date: 2017/7/18 Time: 20:36 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=utf-8" %> <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib prefix="sino" tagdir="/WEB-INF/tags" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <c:set var="ctx" value="${pageContext.request.contextPath}"/> <!DOCTYPE html> <html> <head> <title>专项评估 > 任务分发</title> <script src="https://www.jb51.net/${ctx}/static/scm/js/commonDialog.js" type="text/javascript"></script> <link href="https://www.jb51.net/${ctx}/static/sinoprof/core/css/menu-dropdown.css" type="text/css"/> <script src="https://www.jb51.net/${ctx}/static/sinoprof/core/js/namespace.js" type="text/javascript"></script> <script src="https://www.jb51.net/${ctx}/static/sinoprof/core/js/lookupDialogRemember.js" type="text/javascript"></script> <script src="https://www.jb51.net/${ctx}/static/scm/js/taskEditExcelData.js" type="text/javascript"></script> <script src="https://www.jb51.net/${ctx}/static/scm/js/bootstrap-filestyle.js" type="text/javascript"></script> <link href="https://www.jb51.net/${ctx}/static/lib/jquery-easyui/themes/default/easyui.css" type="text/css" /> <script src="https://www.jb51.net/${ctx}/static/lib/jquery-easyui/jquery.easyui.min.js" type="text/javascript"></script> <sino:sinoflow ctx="${ctx}" SFActInfo="${SFActInfo}"/> <style type="text/css"> .table tbody td:nth-child(1n) { text-align: center; vertical-align: middle; } .mr15 { margin-right: 15px; } </style> </head> <body> <form:form role="form" action="${ctx}/scm/special/distribute/submit" method="post"> <input type="hidden" /> <input type="hidden"> <input type="hidden" > <input type="hidden" value="C1"> <input type="hidden" value="${flowGroups}"> <input type="hidden" value="${sf_actID}"> <input type="hidden" value="${nextLoginName}"> <div> <input type="hidden" value="${taskId}"> <input type="hidden" value="${taskName}"> <h2>${taskName}</h2> <input type="hidden" value="${taskId}"> <div> <div> <button type="button">任务分发</button> </div> <div> <button type="button">关闭</button> </div> </div> <div> <span>本次评估信息</span> <div data-table="3"> <a data-action="">批量设置评分人</a> <a data-action="">批量清空评分人</a> </div> </div> <div > <div> <table> <thead> <tr> <td><input type="checkbox"/></td> <th>序号</th> <th>协议/合同名称</th> <th>评估供应商</th> <th>评估人</th> <th>评估模板</th> </tr> </thead> <tbody> <c:forEach items="${specialTaskLineList}" var="line" varStatus="status"> <tr> <td><input type="checkbox" value="${line.taskLineSetId}"></td> <th>${status.index+1} <input type="hidden" value="${line.taskLineId}"> <input type="hidden" value="${line.taskLineSetId}"> <input type="hidden" value="${line.objectType}"> </th> <td>${line.contractName}</td> <td>${line.vendorName}</td> <td> <c:if test="${line.userNames !=null}"> <astyle="color:#E69500" > ${line.userNames}</a> <!-- <a>清空</a> --> <input type="hidden" value="${line.userNames}" /> <input type="hidden" value="${line.loginNames}" /> <input type="hidden" value="${line.loginNameDisplayNameStr}" /> <input type="hidden" value="${line.flowGroups}" /> </c:if> <c:if test="${line.userNames ==null}"> <a>设置评估人</a> </c:if> </td> <td> <a href="##">${line.templetName}</a></td> </tr> </c:forEach> </tbody> </table> </div> </div> </div> </form:form> <jsp:include page="/WEB-INF/views/workflow/workbench/userTree.jsp" /> <%-- <%@ include file="../../../../static/scm/userTree.jsp"%> --%> <script type="text/javascript"> $(function () { //全选、取消全选的事件 $("#selectAll").click(function () { $("input[name='chkItem']").prop("checked", this.checked); }); }); function assessorsValidate(){ var flag=true; $(".assessorsTd").each(function(){ var validateMedium=$(this).find("input[name='loginNames']").val(); if(!validateMedium){ flag=false; msgAlert("评估人未设置"); return false; } }); return flag; } function do_Validate_Save() {//流程“暂存”前由流程引擎自动调用,如果该函数返回false,流程引擎中止“暂存”操作 if ($("#appform").valid()&&assessorsValidate()) { return true; }else{ return false; } } //提交数据 function doSubmit() { var companyId = $("#companyId").val(); if(companyId =="00"){ $("#Launch_Code").val("B"); }else { $("#Launch_Code").val("A"); } if (do_Validate_Save()){ var assessors=new Array(); $('.loginNames').each(function(index){ var arrayEach=($(this).val()).split(","); for(var i=0;i<arrayEach.length;i++){ if(assessors.indexOf(arrayEach[i])<0){ assessors.push(arrayEach[i]); } } }); assessors=assessors.join(";"); if($("#nextLoginName").val()){ $("#loginIds").val($("#nextLoginName").val()); }else { $("#loginIds").val(assessors); } if(checkAppraiser()){ do_Div_Complete_Start(); }else { msgAlert("存在指标评估人为空"); } } } function checkAppraiser(){ var flag = true; var taskId = $("#taskId").val(); $.ajax({ url:"${ctx}/scm/special/distribute/checkAppraiser", type:"post", dataType:"json", async:false, data:{"taskId":taskId}, success:function(result){ if(result>0){ flag = false; } } }); return flag; } //选择评估人 function checkAssessors(obj,flag) { if(flag&& $("input[name='chkItem']:checked").length == 0){ msgAlert("请选择要设置的行。"); return; } arr = [];//需要设置为全局变量 var method="dealMethod"; if(!flag){ var taskLineSetId = $(obj).parents("tr").find("input[name='taskLineSetId']").val(); //这里的ModaltaskId为模态框里面的id值,表示需要修改的行,该列表示可以传递的参数 $("#ModaltaskLineId").val(taskLineSetId); //获取评估人信息loginName和displayNameStr(默认值) var loginNameDisplayNameStr = $(obj).parents("tr").find("input[name='loginNameDisplayNameStr']").val(); showTreeDefault(loginNameDisplayNameStr,method,true); } //批量设置评估人 else{ var check = $("input[name='chkItem']:checked"); var taskLineIdStr=""; check.each(function (index) { if(index==0){ taskLineIdStr=$(this).val(); }else{ taskLineIdStr+=","+$(this).val(); } }); $("#ModaltaskLineId").val(taskLineIdStr); showTreeDefault(null,method,false); } } //判断是否是批量设置评估人,如果是批量,循环处理(本方法也是模态框处理方法) function dealMethod(loginNames){ if(loginNames==null){ alert("评估人不能为空,设置失败!"); return ; } var taskLineSetIdStr = $("#ModaltaskLineId").val(); $.commonDialog.showProgress('${ctx}', '正在设置评估人,请稍候...'); saveAppraiser(taskLineSetIdStr,loginNames); } function saveAppraiser(taskLineSetIdStr,loginNames) { $.ajax({ url:"${ctx}/scm/special/distribute/saveAppraiser", type:"post", dataType:"json", async:false, data:{"taskLineSetIdStr":taskLineSetIdStr,"loginNames":loginNames}, success:function(result){ window.location.reload(); } }); } function removeAssessors(obj,flag) { if(flag&& $("input[name='chkItem']:checked").length == 0){ msgAlert("请选择要设置的行。"); return; } msgConfirm("是否确认清空?", function () { $.commonDialog.showProgress('${ctx}', '正在删除,请稍候...'); $("#nextLoginName").val(""); if(flag){ $("input[name='chkItem']:checked").each(function () { removepeople($(this).parents("tr").find("td input[name ='loginNames']")); }); }else { removepeople(obj); } window.location.reload(); // $.commonDialog.hiddenProgress(); } ); } function removepeople(obj) { var taskLineSetId = $(obj).parents("tr").find("th input[name=taskLineSetId]").val(); $.ajax({ url:"${ctx}/scm/special/distribute/delAppraiser", type:"post", dataType:"json", async:false, data:{"taskLineSetId":taskLineSetId}, success:function(result){ // if(result =='Y'){ // $(obj).parent("td") .html("<a>设置评估人</a>"); // } } }); } function showIndicatorsDetail(obj) { var loginNames = $(obj).parents("tr").find("td input[name=loginNames]").val(); var taskLineId = $(obj).parents("tr").find("th input[name=taskLineId]").val(); var objectType = $(obj).parents("tr").find("th input[name=objectType]").val(); var sf_actID = $("#sf_actID").val(); if(loginNames){ window.location.href= "${ctx}/scm/special/distribute/indicatorsEdit?taskLineId="+taskLineId+"&objectType="+objectType+"&sf_actID="+sf_actID; }else { msgAlert("请先设置评估人!"); } } </script> </body> </html>
总结