<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<%@include file="/views/common.jsp"%>
</head>
<style>
.layui-input {
	width: 135%;
}
.btn_groups{
	position: absolute;
	bottom:-80px;
	right:350px;
}
</style>
<body>
	<div class="big_box">
		<form class="layui-form">
			<input id="id" type="hidden" name="id" />
			<div class="layui-input-block">
				<div class="layui-form-item">
					<label class="layui-form-label">产品品种：</label>
					<div class="layui-input-inline">
						<input type="text" id="proTypeLabel" name="proTypeLabel" class="layui-input" readonly>
					</div>
				</div>
				<br>
				<div class="layui-form-item">
					<label class="layui-form-label">种类1：</label>
					<div class="layui-input-inline">
						<input type="text" id="kindLabel" name="kindLabel" class="layui-input" readonly>
					</div>
				</div>
				<br>
				<div class="layui-form-item">
					<label class="layui-form-label">种类2：</label>
					<div class="layui-input-inline">
						<input type="text" id="kind2Label" name="kind2Label" class="layui-input" readonly>
					</div>
				</div>
				<br>
				<div class="layui-form-item">
					<label class="layui-form-label">产品说明：</label>
					<!-- <textarea rows="5" cols="60" id="remark"></textarea> -->
					<textarea id="remark" name="remark" lay-verify="remark" style="display: none;"></textarea>
				</div>
					<div class="layui-input-block btn_groups">
						<button class="layui-btn" lay-submit="" lay-filter="formSub">立即提交</button>
					</div>
			</div>
		</form>
	</div>
</body>
<script>
	layui.use([ 'form', 'upload', 'layedit' ], function() {
		var form = layui.form, upload = layui.upload; // 只有执行了这一步，部分表单元素才会自动修饰成功
		var layedit = layui.layedit;

		//建立编辑器
		var remark = layedit.build('remark', {
			height : 200, //设置编辑器高度
			width : 300
		});
		form.verify({
			remark : function(value) {
				return layedit.sync(remark);
			}
		});
		layui.form.render();
		//监听提交
		form.on('submit(formSub)', function(data) {
			$.ajax({
				url : '${path}/updateImgUploadRemark',
				dataType : 'json',
				data : {
					'id' 	 : $("#id").val(),
					'remark' : $("#remark").val()
				},
				type : 'post',
				success : function(data) {
					if (data.code == 200) {
						layer.msg('修改成功！', {
							icon : 6,
							offset : "auto",
							time : 1000
						});//提示框
					} else {
						layer.msg('修改失败！', {
							icon : 5,
							offset : "auto",
							time : 1000
						});//提示框
					}
					setTimeout(function() {
						var index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);//关闭弹出层
						parent.layui.table.reload('imgTableAll');//重新加载父页面表格
					}, 1100);
				}
			});
			return false;
		});

	});
</script>
</html>