<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>项目立项</title>
	<meta name="decorator" content="default"/>
	<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>
	<style type="text/css">
		.table{
			margin-bottom: 0px;
		}
		.workfull>.form-horizontal{
			margin: 0;
			padding: 0;
		}
	</style>
	<script type="text/javascript">
        $(function(){
            $("#attachment_btn_qiye50").click(function () {
                $("#attachment_file_qiye50").click();
            });
            $("#attachment_btn_qiye51").click(function () {
                $("#attachment_file_qiye51").click();
            });
            $("#attachment_btn_qiye52").click(function () {
                $("#attachment_file_qiye52").click();
            });
            $("#attachment_btn_qiye53").click(function () {
                $("#attachment_file_qiye53").click();
            });
            $("#attachment_btn_qiye54").click(function () {
                $("#attachment_file_qiye54").click();
            });
            $("#attachment_btn_qiye55").click(function () {
                $("#attachment_file_qiye55").click();
            });
            $("#attachment_btn_qiye56").click(function () {
                $("#attachment_file_qiye56").click();
            });
            $("#attachment_btn_qiye57").click(function () {
                $("#attachment_file_qiye57").click();
            });
            var oneSize = $(".oneTab").size();
            for(var i = 0;i < oneSize;i++){
                var hei = $(".oneTab:eq("+i+")").parent().height();
                $(".oneTab:eq("+i+")").css("height",hei)
                    .css("vertical-align","middle")
                    .css("line-height",hei+"px")
            }
        })
        var validateForm;
        function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            if(validateForm.form()){
                $("#inputForm").submit();
                return true;
            }
            return false;
        }
        $(document).ready(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);
                    }
                }
            });
        });
        function insertTitle(tValue){
            var fileId = $(tValue).attr("id");
            var divId = fileId.replace("attachment_file","");
            var attachmentFlag = divId.replace("_qiye","");
            var files = $("#attachment_file"+divId)[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
            var attachmentId = "${workFullManage.id}";
            var timestamp=new Date().getTime();

            var storeAs = "attachment-file/workFullManage/"+timestamp+"/"+file['name'];
            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
            $("#addFile"+divId).show();
            multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,"0");}
        }

	</script>
</head>
<body class="hideScroll">
<div class="row">
	<div class="col-sm-12 m-t-md m-l-sm">
		<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">
				<tbody>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目编号：</label></td>
					<td class="width-25">
						${workFullManage.fullProjectNumber}
					</td>
					<td class="width-15 active"><label class="pull-right">创建日期：</label></td>
					<td class="width-25">
						<fmt:formatDate value="${workFullManage.createDate}" pattern="yyyy-MM-dd HH:mm:ss" />
					</td>
					<%--<td>--%>
					<%--<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=7','80%','80%')" class="btn btn-info btn-xs">查看</a>--%>
					<%--</td>--%>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项目名称：</label></td>
					<td class="width-25" colspan="3">
						${workFullManage.fullProjectName}
					</td>
					<%--<td>--%>
					<%--<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=8','80%','80%')" class="btn btn-info btn-xs">查看</a>--%>
					<%--</td>--%>
				</tr>
				</tbody>
			</table>
		</div>
	</div>
	<div class="col-sm-12 m-t-xs m-l-sm">
		<div class="col-sm-2 gray-bg text-center oneTab">
			<label>归档资料</label>
		</div>
		<div class="col-sm-10 " >
			<p></p>
			<label>工程咨询结果</label>
			<table class="table table-striped table-bordered table-hover table-condensed dataTables-example">
				<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}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=50','80%','80%')" class="btn btn-info btn-xs">查看</a>
					</td>
					<td>
						<div class="table-responsive">
							<div style="display: inline-block">
								<div id="addFile_qiye50" style="display: none">
									<span id="fileName_qiye50" ></span>
									<b><span id="baifenbi_qiye50" ></span></b>
									<div class="progress">
										<div id="jindutiao_qiye50" class="progress-bar" style="width: 0%" aria-valuenow="0">
										</div>
									</div>
								</div>
								<input id="attachment_file_qiye50" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
								<a id="attachment_btn_qiye50" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
								<span id="attachment_title_qiye50"></span>
							</div>
							<%--<div class="kv-main">
								<form enctype="multipart/form-data">
									<input type="hidden" id="file_root1">
									<input type="hidden" id="file_name1">
									<input type="hidden" id="file_type1" value="50">
									<div class="form-group" style="margin-left: 0; margin-right: 0;">
										<input id="file-qiye1" name="myFile" type="file" class="file">
									</div>
								</form>
							</div>--%>
						</div>
					</td>

				</tr>
				<tr>
					<td>2</td>
					<td>审计方案</td>
					<td>
						<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=51','80%','80%')" class="btn btn-info btn-xs">查看</a>
					</td>
					<td>
						<div class="table-responsive">
							<div style="display: inline-block">
								<div id="addFile_qiye51" style="display: none">
									<span id="fileName_qiye51" ></span>
									<b><span id="baifenbi_qiye51" ></span></b>
									<div class="progress">
										<div id="jindutiao_qiye51" class="progress-bar" style="width: 0%" aria-valuenow="0">
										</div>
									</div>
								</div>
								<input id="attachment_file_qiye51" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
								<a id="attachment_btn_qiye51" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
								<span id="attachment_title_qiye51"></span>
							</div>
							<%--<div class="kv-main">
								<form enctype="multipart/form-data">
									<input type="hidden" id="file_root2">
									<input type="hidden" id="file_name2">
									<input type="hidden" id="file_type2" value="51">
									<div class="form-group" style="margin-left: 0; margin-right: 0;">
										<input id="file-qiye2" name="myFile" type="file" class="file">
									</div>
								</form>
							</div>--%>
						</div>
					</td>

				</tr>
				<tr>
					<td>3</td>
					<td>审计管理建议</td>
					<td>
						<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=52','80%','80%')" class="btn btn-info btn-xs">查看</a>
					</td>
					<td>
						<div style="display: inline-block">
							<div id="addFile_qiye52" style="display: none">
								<span id="fileName_qiye52" ></span>
								<b><span id="baifenbi_qiye52" ></span></b>
								<div class="progress">
									<div id="jindutiao_qiye52" class="progress-bar" style="width: 0%" aria-valuenow="0">
									</div>
								</div>
							</div>
							<input id="attachment_file_qiye52" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
							<a id="attachment_btn_qiye52" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
							<span id="attachment_title_qiye52"></span>
						</div>
						<%--<div class="table-responsive">
							<div class="kv-main">
								<form enctype="multipart/form-data">
									<input type="hidden" id="file_root3">
									<input type="hidden" id="file_name3">
									<input type="hidden" id="file_type3" value="52">
									<div class="form-group" style="margin-left: 0; margin-right: 0;">
										<input id="file-qiye3" name="myFile" type="file" class="file">
									</div>
								</form>
							</div>
						</div>--%>
					</td>

				</tr>
				<tr>
					<td>4</td>
					<td>审计周报</td>
					<td>
						<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=53','80%','80%')" class="btn btn-info btn-xs">查看</a>
					</td>
					<td>
						<div style="display: inline-block">
							<div id="addFile_qiye53" style="display: none">
								<span id="fileName_qiye53" ></span>
								<b><span id="baifenbi_qiye53" ></span></b>
								<div class="progress">
									<div id="jindutiao_qiye53" class="progress-bar" style="width: 0%" aria-valuenow="0">
									</div>
								</div>
							</div>
							<input id="attachment_file_qiye53" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
							<a id="attachment_btn_qiye53" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
							<span id="attachment_title_qiye53"></span>
						</div>
						<%--<div class="table-responsive">
							<div class="kv-main">
								<form enctype="multipart/form-data">
									<input type="hidden" id="file_root4">
									<input type="hidden" id="file_name4">
									<input type="hidden" id="file_type4" value="53">
									<div class="form-group" style="margin-left: 0; margin-right: 0;">
										<input id="file-qiye4" name="myFile" type="file" class="file">
									</div>
								</form>
							</div>
						</div>--%>
					</td>

				</tr>
				<tr>
					<td>5</td>
					<td>审计月报</td>
					<td>
						<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=54','80%','80%')" class="btn btn-info btn-xs">查看</a>
					</td>
					<td>
						<div style="display: inline-block">
							<div id="addFile_qiye54" style="display: none">
								<span id="fileName_qiye54" ></span>
								<b><span id="baifenbi_qiye54" ></span></b>
								<div class="progress">
									<div id="jindutiao_qiye54" class="progress-bar" style="width: 0%" aria-valuenow="0">
									</div>
								</div>
							</div>
							<input id="attachment_file_qiye54" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
							<a id="attachment_btn_qiye54" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
							<span id="attachment_title_qiye54"></span>
						</div>
						<%--<div class="table-responsive">
							<div class="kv-main">
								<form enctype="multipart/form-data">
									<input type="hidden" id="file_root5">
									<input type="hidden" id="file_name5">
									<input type="hidden" id="file_type5" value="54">
									<div class="form-group" style="margin-left: 0; margin-right: 0;">
										<input id="file-qiye5" name="myFile" type="file" class="file">
									</div>
								</form>
							</div>
						</div>--%>
					</td>

				</tr>
				<tr>
					<td>6</td>
					<td>审计汇总表</td>
					<td>
						<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=55','80%','80%')" class="btn btn-info btn-xs">查看</a>
					</td>
					<td>
						<div style="display: inline-block">
							<div id="addFile_qiye55" style="display: none">
								<span id="fileName_qiye55" ></span>
								<b><span id="baifenbi_qiye55" ></span></b>
								<div class="progress">
									<div id="jindutiao_qiye55" class="progress-bar" style="width: 0%" aria-valuenow="0">
									</div>
								</div>
							</div>
							<input id="attachment_file_qiye55" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
							<a id="attachment_btn_qiye55" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
							<span id="attachment_title_qiye55"></span>
						</div>
						<%--<div class="table-responsive">
							<div class="kv-main">
								<form enctype="multipart/form-data">
									<input type="hidden" id="file_root6">
									<input type="hidden" id="file_name6">
									<input type="hidden" id="file_type6" value="55">
									<div class="form-group" style="margin-left: 0; margin-right: 0;">
										<input id="file-qiye6" name="myFile" type="file" class="file">
									</div>
								</form>
							</div>
						</div>--%>
					</td>
				</tr>
				<tr>
					<td>7</td>
					<td>总结</td>
					<td>
						<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=56','80%','80%')" class="btn btn-info btn-xs">查看</a>
					</td>
					<td>
						<div style="display: inline-block">
							<div id="addFile_qiye56" style="display: none">
								<span id="fileName_qiye56" ></span>
								<b><span id="baifenbi_qiye56" ></span></b>
								<div class="progress">
									<div id="jindutiao_qiye56" class="progress-bar" style="width: 0%" aria-valuenow="0">
									</div>
								</div>
							</div>
							<input id="attachment_file_qiye56" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
							<a id="attachment_btn_qiye56" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
							<span id="attachment_title_qiye56"></span>
						</div>
						<%--<div class="table-responsive">
							<div class="kv-main">
								<form enctype="multipart/form-data">
									<input type="hidden" id="file_root7">
									<input type="hidden" id="file_name7">
									<input type="hidden" id="file_type7" value="56">
									<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>8</td>
					<td>其他</td>
					<td>
						<a href="javascript:void(0)" onclick="openDialogView('附件信息','${ctx}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=57','80%','80%')" class="btn btn-info btn-xs">查看</a>
					</td>
					<td>
						<div style="display: inline-block">
							<div id="addFile_qiye57" style="display: none">
								<span id="fileName_qiye57" ></span>
								<b><span id="baifenbi_qiye57" ></span></b>
								<div class="progress">
									<div id="jindutiao_qiye57" class="progress-bar" style="width: 0%" aria-valuenow="0">
									</div>
								</div>
							</div>
							<input id="attachment_file_qiye57" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
							<a id="attachment_btn_qiye57" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
							<span id="attachment_title_qiye57"></span>
						</div>
						<%--<div class="table-responsive">
							<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="57">
									<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>
			<input type="hidden" value="${workFullManage.id}" id="workFullId">
			<input type="hidden" value="2" id="status">
			<script>
                $(function(){
                    var id = "${workFullManage.id}";
                    for (var i = 1; i < 9 ;i++){
                        var indexLoad;
                        var file_type = $("#file_type"+i).val();
                        $("#file-qiye"+i).fileinput('refresh',
                            {
                                showUpload: false,
                                uploadAsync:true,
                                dropZoneEnabled:false,
                                uploadUrl : '${ctx}/workfullmanage/workFullManage/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','rar','pdf','txt','html' ],
                            }).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();
                });
			</script>
		</div>
	</div>
</div>
</body>
</html>