<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>上传借款单据</title>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<meta name="decorator" content="ani"/>
	<%@ include file="/webpage/include/bootstraptable.jsp"%>
	<%@include file="/webpage/include/treeview.jsp" %>
	<%@include file="economicsDesignChange.js"%>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#agree").click(function () {
				var currentFileValues = $("input[name='pic']").val();
				if (currentFileValues == "" || currentFileValues == null) {
					jp.error("请上传文件");
				} else {
					jp.prompt("审核意见", function (message) {
						jp.post("${ctx}/act/task/loanUploadList",
						{
							"taskId":"${uploadImages.act.taskId}",
							"taskName":"${uploadImages.act.taskName}",
							"taskDefKey":"${uploadImages.act.taskDefKey}",
							"procInsId":"${uploadImages.act.procInsId}",
							"procDefId":"${uploadImages.act.procDefId}",
							"flag":"yes",
							"pic":currentFileValues,
							"comment":window.encodeURI(message)
						},
						function (data) {
							if(data.success){
								jp.success(data.msg);
								jp.go("${ctx}/act/task/todo")
							}
						})
					});
				}
			});
			$("#no").click(function () {
				jp.prompt("审核意见", function (message) {
					jp.post("${ctx}/act/task/loanUploadList",
						{
							"taskId":"${uploadImages.act.taskId}",
							"taskName":"${uploadImages.act.taskName}",
							"taskDefKey":"${uploadImages.act.taskDefKey}",
							"procInsId":"${uploadImages.act.procInsId}",
							"procDefId":"${uploadImages.act.procDefId}",
							"flag":"no",
							"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="panel panel-primary">
	<div class="panel-heading">
		<h3 class="panel-title">上传借款单据</h3>
	</div>
	<div class="panel-body">
	<!-- 表格 -->
	<table id="testPicTable"   data-toolbar="#toolbar"></table>
		<div class="panel-body">
			<form:form id="inputForm" modelAttribute="uploadImages" 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"/>
				<input type="hidden" id="procInsId" name="procInsId" value="${uploadImages.act.procInsId}"/>
				<table class="table table-bordered">
					<tbody>
					<tr>
						<td class="width-15 active"><label class="pull-right"><font color="red">*</font>文件上传：</label></td>
						<td class="width-35">
							<sys:fileUpload  path="pic" fileNumLimit="50" fileSizeLimit="50" value="${testPic.pic}" type="file" uploadPath="/list"></sys:fileUpload>
						</td>
					</tr>
					</tbody>
				</table>
			</form:form>
			<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="no" class="btn  btn-primary btn-lg btn-danger" type="submit" value="驳回" />&nbsp;
					</div>
				</div>
			</div>
			<c:if test="${not empty uploadImages.id}">
				<act:flowChart procInsId="${uploadImages.act.procInsId}"/>
				<act:histoicFlow procInsId="${uploadImages.act.procInsId}" />
			</c:if>
		</div>
    <!-- context menu -->
    <ul id="context-menu" class="dropdown-menu">
    </ul>  
	</div>
	</div>
	</div>
</body>
</html>