<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>项目经理交底页面</title>
	<meta name="decorator" content="ani"/>
	<!-- SUMMERNOTE -->
	<%@include file="/webpage/include/summernote.jsp" %>
	<%@include file="divideForm.js"%>
	<script type="text/javascript">
		$(document).ready(function () {
			$("#agree").click(function () {
				var cValue ="";//定义一个数组
				var useflag = false;//代表是否选择了设计变更/行政政处/农村民事政处的状态，false为未选择，true为选择
				var flag2 = false;//代表是否选择了项目关闭的状态，false为未选择，true为选择
				var flag8 = false;//代表无问题
				var flag81 = false;//记录选择无问题的同时，有没有选择其它问题类型
				var nValue = $('input[name="favorite"]:checked');
				$('input[name="favorite"]:checked').each(function(){//遍历每一个名字为interest的复选框，其中选中的执行函数
					console.log($(this).val());
					//判断选取的值如果时pass2，flag2为true，代表选择了项目关闭，选取的值不为pass2，flag1为true代表其它类型被选择
					if ("pass8" == $(this).val()){
						flag8 = true;
					}else {
						flag81 = true;
					}
					if ("pass2" == $(this).val()) {
						flag2 = true;
					}else {
						useflag = true;
					}
					cValue=cValue+";"+($(this).val());//将选中的值添加到数组chk_value中
				});
				console.log(cValue);
				if (nValue == null || nValue.size() <= 0) {
					jp.error("请选择问题类型");
				} else if (flag8 == true&&flag81==true) {
					jp.error("无问题与其它类型问题不可同时发起");
				} else if (flag2 == true&&useflag==true) {
					jp.error("项目关闭与其它类型问题不可同时发起");
				} else {
					jp.prompt(" 审批意见", function (message) {
						jp.post("${ctx}/act/task/divideForm",
								{
									"taskId": "${construction.act.taskId}",
									"taskName": "${construction.act.taskName}",
									"taskDefKey": "${construction.act.taskDefKey}",
									"procInsId": "${construction.act.procInsId}",
									"procDefId": "${construction.act.procDefId}",
									"flag": cValue,
									"projectName": "${fns:unescapeHtml(construction.projectName)}",
									"comment": window.encodeURI(message)
								},
								function (data) {
									if (data.success) {
										jp.success(data.msg);
										jp.go("${ctx}/act/task/todo")
									}
								})
					});
				}
			});
		})
	</script>
</head>
<body>
<div class="wrapper wrapper-content">
	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<h3 class="panel-title">
						<a class="panelButton"  href="#"  onclick="history.go(-1)"><i class="ti-angle-left"></i> 返回</a>
					</h3>
				</div>
				<div class="panel-body">
					<button id="importConclusion" class="btn btn-info">
						<i class="fa fa-folder-open-o"></i> 导入交地结论
					</button>
					<button id="edit" class="btn btn-danger">
						<i class="fa fa-folder-open-o"></i> 修改交底结论
					</button>
					<form:form id="inputForm" modelAttribute="construction" action="${ctx}/managementcenter/divide/save" method="post" class="form-horizontal">
					<form:hidden path="id"/>
						<input id="procInsId" type="hidden" value="${fns:unescapeHtml(construction.procInsId)}">
						<input id="projectName" type="hidden" value="${fns:unescapeHtml(construction.projectName)}">
						<input type="hidden" value="${fns:unescapeHtml(construction.id)}">
						<table class="table table-bordered">
							<tbody>
							<tr>
								<td class="width-15 active"><label class="pull-right">问题类型：</label></td>
								<td class="width-35">
									<input type="checkbox" name="favorite" value="pass8"  <c:if test="${pass_construction7=='0'}">checked="checked"</c:if> onclick="<c:if test="${pass_construction6!='0'}">return false</c:if>"> 无问题 &nbsp;
									<input type="checkbox" name="favorite" value="pass1" <c:if test="${pass_construction2=='0'}">checked="checked"</c:if> onclick="<c:if test="${pass_construction6!='0'}">return false</c:if>"> 设计变更 &nbsp;
									<input type="checkbox" name="favorite" value="pass2" <c:if test="${pass_construction1=='0'}">checked="checked"</c:if> onclick="<c:if test="${pass_construction6!='0'}">return false</c:if>"> 项目关闭 &nbsp;
									<input type="checkbox" name="favorite" value="pass3"  <c:if test="${pass_construction5=='0'}">checked="checked"</c:if> onclick="<c:if test="${pass_construction6!='0'}">return false</c:if>"> 行政政处（城区道路）
									<input type="checkbox" name="favorite" value="pass5"  <c:if test="${pass_construction3=='0'}">checked="checked"</c:if> onclick="<c:if test="${pass_construction6!='0'}">return false</c:if>"> 农村政处
									<input type="checkbox" name="favorite" value="pass6"  <c:if test="${pass_construction4=='0'}">checked="checked"</c:if> onclick="<c:if test="${pass_construction6!='0'}">return false</c:if>"> 民事政处/行政政处（公路/水利）
<%--									<input type="checkbox" name="favorite" value="pass7"  <c:if test="${pass_construction6=='0'}">checked="checked"</c:if> onclick="<c:if test="${pass_construction6!='0'}">return false</c:if>"> 人工判断--%>
								</td>
								<td class="width-15 active"><label class="pull-right">项目号：</label></td>
								<td class="width-35">
										${fns:unescapeHtml(construction.projectId)}
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">项目名称：</label></td>
								<td class="width-35">
										${fns:unescapeHtml(construction.projectName)}
								</td>
								<td class="width-15 active"><label class="pull-right">接收图纸时间：</label></td>
								<td class="width-35">
									<fmt:formatDate value="${construction.acceptDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">施工通道：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='channel'  name="channel" class="form-control required"  value="${construction.disclose.channel}"/>
								</td>
								<td class="width-15 active"><label class="pull-right"> 设备基础是否可以扩容：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.capacity}">
											<input type='text' readonly="readonly" id='capacity'  name="capacity" class="form-control required"  value="${construction.disclose.capacity}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='capacity'  name="capacity" class="form-control required"  value="否"/>
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">现场设备尺寸：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='sceneSize'  name="sceneSize" class="form-control required"  value="${construction.disclose.sceneSize}"/>
								</td>
								<td class="width-15 active"><label class="pull-right"> 最多可扩容尺寸：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='capacitySize'  name="capacitySize" class="form-control required"  value="${construction.disclose.capacitySize}"/>
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">方案安全隐患：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.hiddenDanger}">
											<input type='text' readonly="readonly" id='hiddenDanger'  name="hiddenDanger" class="form-control required"  value="${construction.disclose.hiddenDanger}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='hiddenDanger'  name="hiddenDanger" class="form-control required"  value="无"/>
										</c:otherwise>
									</c:choose>
								</td>
								<td class="width-15 active"><label class="pull-right"> 是否存在低压或通信线等影响施工：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.influenceConstruction}">
											<input type='text' readonly="readonly" id='influenceConstruction'  name="influenceConstruction" class="form-control required"  value="${construction.disclose.influenceConstruction}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='influenceConstruction'  name="influenceConstruction" class="form-control required"  value="否"/>
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">立项重复：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.projectRepetition}">
											<input type='text' readonly="readonly" id='projectRepetition'  name="projectRepetition" class="form-control required"  value="${construction.disclose.projectRepetition}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='projectRepetition'  name="projectRepetition" class="form-control required"  value="否"/>
										</c:otherwise>
									</c:choose>
								</td>
								<td class="width-15 active"><label class="pull-right"> 是否已实施：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.implemented}">
											<input type='text' readonly="readonly" id='implemented'  name="implemented" class="form-control required"  value="${construction.disclose.implemented}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='implemented'  name="implemented" class="form-control required"  value="否"/>
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">变压器无负荷：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.transformer}">
											<input type='text' readonly="readonly" id='transformer'  name="transformer" class="form-control required"  value="${construction.disclose.transformer}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='transformer'  name="transformer" class="form-control required"  value="有"/>
										</c:otherwise>
									</c:choose>
								</td>
								<td class="width-15 active"><label class="pull-right">项目实施必要性描述</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='explanationOfNecessity'  name="needReplace" class="form-control required"  value="${construction.disclose.explanationOfNecessity}"/>
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right"> 线路名称一致性：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.lineName}">
											<input type='text' readonly="readonly" id='lineName'  name="lineName" class="form-control required"  value="${construction.disclose.lineName}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='lineName'  name="lineName" class="form-control required"  value="一致"/>
										</c:otherwise>
									</c:choose>

								</td>
								<td class="width-15 active"><label class="pull-right">工程量是否一致：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.quantities}">
											<input type='text' readonly="readonly" id='quantities'  name="quantities" class="form-control required"  value="${construction.disclose.quantities}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='quantities'  name="quantities" class="form-control required"  value="是"/>
										</c:otherwise>
									</c:choose>
								</td>

							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right"> 设备、开关、杆号一致性：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.rodNumber}">
											<input type='text' readonly="readonly" id='rodNumber'  name="rodNumber" class="form-control required"  value="${construction.disclose.rodNumber}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='rodNumber'  name="rodNumber" class="form-control required"  value="一致"/>
										</c:otherwise>
									</c:choose>
								</td>
								<td class="width-15 active"><label class="pull-right"> 图纸现场不一致描述：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='inconsistentDescription'  name="overallTransformation" class="form-control required"  value="${construction.disclose.inconsistentDescription}"/>
								</td>

							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">政处类型：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.administrationType}">
											<input type='text' readonly="readonly" id='administrationType'  name="administrationType" class="form-control required"  value="${construction.disclose.administrationType}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='administrationType'  name="administrationType" class="form-control required"  value="4.无"/>
										</c:otherwise>
									</c:choose>
								</td>
								<td class="width-15 active"><label class="pull-right">前置条件：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='precondition'  name="precondition" class="form-control required"  value="${construction.disclose.precondition}"/>
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">政策处理描述：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='policyHandlingInstructions'  name="needReplace" class="form-control required"  value="${construction.disclose.policyHandlingInstructions}"/>
								</td>
								<td class="width-15 active"><label class="pull-right"> DTU安放方式核查：</label></td>
								<td class="width-35">
									<c:choose>
										<c:when test="${not empty construction.disclose.placementMode}">
											<input type='text' readonly="readonly" id='placementMode'  name="placementMode" class="form-control required"  value="${construction.disclose.placementMode}"/>
										</c:when>
										<c:otherwise>
											<input type='text' readonly="readonly" id='placementMode'  name="placementMode" class="form-control required"  value="无"/>
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">核查环网柜生产日期：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='productionDate'  name="productionDate" class="form-control required"  value="${construction.disclose.productionDate}"/>
								</td>
								<td class="width-15 active"><label class="pull-right"> 二次是否是集成模块：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='IntegrateModule'  name="IntegrateModule" class="form-control required"  value="${construction.disclose.integrateModule}"/>
								</td>

							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">PT是否需要更换：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='needReplace'  name="needReplace" class="form-control required"  value="${construction.disclose.needReplace}"/>
								</td>
								<td class="width-15 active"><label class="pull-right"> 设备是否有整体改造的必要：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='overallTransformation'  name="overallTransformation" class="form-control required"  value="${construction.disclose.overallTransformation}"/>
								</td>
							</tr>
							<tr>
								<td class="width-15 active"><label class="pull-right">其它问题类型：</label></td>
								<td class="width-35">
									<input type='text' readonly="readonly" id='otherProblem'  name="otherProblem" class="form-control required"  value="${construction.disclose.otherProblem}"/>
								</td>
							</tr>
							</tbody>
						</table>
					</form:form>



					<%--<c:if test="${construction.act.taskDefKey != '' && !construction.act.finishTask && construction.act.isNextGatewaty}">--%>
						<div class="row">
							<div class="col-sm-3"></div>
							<div class="col-sm-6">
								<div class="form-group text-center">
									<input id="agree" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="审核" />&nbsp;
<%--									<input id="reject" class="btn  btn-primary btn-lg btn-parsley" type="submit" value="存在问题" />--%>
								</div>
							</div>
						</div>
					<%--</c:if>--%>

					<c:if test="${not empty construction.id}">
						<act:flowChart procInsId="${construction.act.procInsId}"/>
						<act:histoicFlow procInsId="${construction.act.procInsId}" />
					</c:if>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>