<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>发起项目竣工</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		.table{
			margin-bottom: 0px;
		}
	</style>
	<script>
        var validateForm;
        $(function(){
            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);
                    }
                }
            });
            var id = "${workProjectCompletionInfo.id}";
            for (var i = 0; i < 12 ;i++){
                var indexLoad;
                var file_type = $("#file_type"+i).val();
                $("#file-qiye"+i).fileinput('refresh',
                    {
                        showUpload: false,
                        uploadAsync:true,
                        dropZoneEnabled:false,
                        uploadUrl : '${ctx}/workprojectcompletion/workProjectCompletion/uploadFile',
                        uploadExtraData:{
                            "id":id,	//项目id
                            "file_type":file_type
                        },
                        showCaption: false,
                        showPreview: false,
                        browseIcon:'',
                        browseClass: "none",
                        browseLabel: "<button class='btn btn-info btn-xs'>上传附件</button>",
                        showRemove : false,
                        showCancel : false,

                        progressUploadThreshold:99,
                        allowedFileExtensions : [ 'doc', 'xls', 'jpg', 'png',
                            'xlsx', 'docx' ],
                    }).on('fileloaded', function(event, numFiles, label) {
                    indexLoad = parent.layer.load(0, {shade: false});
                    $(this).fileinput('upload');
                }).on('filebatchuploadsuccess',function(event, file, previewId, index, reader) {
                    parent.layer.msg("上传成功",{icon:6});
                    parent.layer.close(indexLoad);
                });
            }
            $(".kv-upload-progress").remove();
            var oneSize = $(".oneTab").size();
            for(var i = 0;i < oneSize;i++){
                var hei = $(".twoTab:eq("+i+")").parent().height();
                $(".oneTab:eq("+i+")").css("height",hei)
                    .css("vertical-align","middle")
                    .css("line-height",hei+"px")
                $(".twoTab:eq("+i+")").css("height",hei);
            }
        });
        function doSubmit(obj){
            // 回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            if(validateForm.form()){
                if(obj == 1) {
                    $("#flag").val("yes");
                }else {
                    $("#flag").val("no");
                }
                $("#inputForm").submit();
                return true;
            }
            return false;
        }

	</script>
</head>
<body class="hideScroll">
<div class="wrapper wrapper-content">
	<div class="ibox">
		<div class="ibox-content">
			<div class="col-sm-12">
				<div class="col-sm-2 gray-bg text-center oneTab">
					<label>项目信息</label>
				</div>
				<div class="col-sm-10 ">
				<form:form id="inputForm" modelAttribute="workProjectCompletionInfo" action="${ctx}/workprojectcompletion/workProjectCompletion/saveAudit" method="post" class="form-horizontal">
					<form:hidden path="id"/>
					<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"/>
					<sys:message content="${message}"/>
					<table class="table table-striped table-bordered table-hover table-condensed dataTables-example twoTab">
						<tbody>
						<tr>
							<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目编号：</label></td>
							<td class="width-35">
								${workFullManage.fullProjectNumber}
								<input type="hidden" value="${workFullManage.id}" id = "projectId">
								<input type="hidden" value="${workProjectCompletionInfo.id}" id = "id">
							</td>
							<td class="width-15 active"><label class="pull-right">登记日期：</label></td>
							<td class="width-35">
								<fmt:formatDate value="${workFullManage.createDate}" pattern="yyyy年MM月dd日" type="date" dateStyle="full"/>

							</td>
						</tr>
						<tr>
							<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目名称：</label></td>
							<td class="width-30" colspan="3">
								${workFullManage.fullProjectName}
							</td>
						</tr>
						</tbody>
					</table>
				</form:form>
				</div>
			</div>
			<div class="col-sm-12 m-t-xs">
				<div class="col-sm-2 gray-bg text-center oneTab">
					<label>文件信息</label>
				</div>
				<div class="col-sm-10 " >
					<table class="table table-striped table-bordered table-hover table-condensed dataTables-example twoTab">
						<thead>
							<tr>
								<th >序号</th>
								<th >文件类型</th>
								<th >附件表</th>
								<th>上传附件</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>1</td>
								<td>结算阶段初审</td>
								<td>
									<%--<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workprojectcompletion/workProjectCompletion/queryInfoToFile?id=${workProjectCompletionInfo.id}&attachment=58','80%','80%')" class="btn btn-info btn-xs">查看</a>
									--%><a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=58','80%','80%')" class="btn btn-info btn-xs">查看</a>
								</td>
								<td>
									<div class="table-responsive">
										<div class="kv-main" style="text-align: center;vertical-align: middle;">
											<form enctype="multipart/form-data">
												<input type="hidden" id="file_root7">
												<input type="hidden" id="file_name7">
												<input type="hidden" id="file_type7" value="58">
												<div class="form-group" style="margin-left: 0; margin-right: 0;">
													<input id="file-qiye7" name="myFile" type="file" class="file">
												</div>
											</form>
										</div>
									</div>
								</td>
							</tr>
							<tr>
								<td>1</td>
								<td>送审结算清单</td>
								<td>
									<%--<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workprojectcompletion/workProjectCompletion/queryInfoToFile?id=${workProjectCompletionInfo.id}&attachment=59','80%','80%')" class="btn btn-info btn-xs">查看</a>
									--%><a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=59','80%','80%')" class="btn btn-info btn-xs">查看</a>
								</td>
								<td>
									<div class="table-responsive" style="text-align: center;vertical-align: middle;">
										<div class="kv-main">
											<form enctype="multipart/form-data">
												<input type="hidden" id="file_root8">
												<input type="hidden" id="file_name8">
												<input type="hidden" id="file_type8" value="59">
												<div class="form-group" style="margin-left: 0; margin-right: 0;">
													<input id="file-qiye8" name="myFile" type="file" class="file">
												</div>
											</form>
										</div>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>

