<%@ 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>
        $(function(){
            $("#attachment_btn_qiye58").click(function () {
                $("#attachment_file_qiye58").click();
            });
            $("#attachment_btn_qiye59").click(function () {
                $("#attachment_file_qiye59").click();
            });
            var id = "${workFullManage.id}";
            for (var i = 0; i < 2 ;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','html','bmp','pdf','rar','txt' ],
                    }).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 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="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 ">
					<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>
				</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}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=58','80%','80%')" class="btn btn-info btn-xs">查看</a>
								</td>
								<td>
									<div style="display: inline-block">
										<div id="addFile_qiye58" style="display: none">
											<span id="fileName_qiye58" ></span>
											<b><span id="baifenbi_qiye58" ></span></b>
											<div class="progress">
												<div id="jindutiao_qiye58" class="progress-bar" style="width: 0%" aria-valuenow="0">
												</div>
											</div>
										</div>
										<input id="attachment_file_qiye58" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
										<a id="attachment_btn_qiye58" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
										<span id="attachment_title_qiye58"></span>
									</div>
									<%--<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_root0">
												<input type="hidden" id="file_name0">
												<input type="hidden" id="file_type0" value="58">
												<div class="form-group" style="margin-left: 0; margin-right: 0;">
													<input id="file-qiye0" 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}/workfullmanage/workFullManage/queryInfoToFile?id=${workFullManage.id}&attachment=59','80%','80%')" class="btn btn-info btn-xs">查看</a>
								</td>
								<td>
									<div style="display: inline-block">
										<div id="addFile_qiye59" style="display: none">
											<span id="fileName_qiye59" ></span>
											<b><span id="baifenbi_qiye59" ></span></b>
											<div class="progress">
												<div id="jindutiao_qiye59" class="progress-bar" style="width: 0%" aria-valuenow="0">
												</div>
											</div>
										</div>
										<input id="attachment_file_qiye59" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this);"/>
										<a id="attachment_btn_qiye59" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
										<span id="attachment_title_qiye59"></span>
									</div>
									<%--<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_root1">
												<input type="hidden" id="file_name1">
												<input type="hidden" id="file_type1" value="59">
												<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>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>

