<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <meta name="decorator" content="base"/>
  <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/style/formSelects-v4.css" media="all">
  <link rel="stylesheet" href="${ctxPlugin}/static/css/reset.css" media="all">


  <style>
    html{
      background-color: #fff;
    }
    .layui-form-select dl{
      max-height:200px;
      width: 80%;
    }
  </style>
</head>
<body>
<div class="aaa layui-form" id="LAY_app">
  <div class="layui-card">
    <div class="layui-col-xs12 mt-10 pr-30">
      <label class="layui-form-label w-130">资方：</label>
      <div class="layui-input-block ml-130">
        <div class="layui-col-xs12 pr-20">
          <select id="partnerId" name="partnerId" lay-search="" xm-select="partnerId" xm-select-type="1" xm-select-height="25px" xm-select-show-count="6" >
            <option value="">请选择</option>
            <c:forEach items="${partnerList}" var="pro">
              <option value="${pro.columns.id}">${pro.columns.name}</option>
            </c:forEach>
          </select>
        </div>
      </div>
    </div>
  </div>
  <div class="operate-footer">
    <input type="button" lay-submit lay-filter="confirm" id="confirm" class="layui-btn " value="保存">
    <input type="button" value="取消" class="layui-btn layui-btn-primary " onclick="closeDiv();">
  </div>
</div>

<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/lib/formSelects-v4.js"></script>
<script type="text/javascript">
  //初始数据
  var $form;
  var form;
  var upload;
  var $;
  var formSelects;
  layui.use(['form', 'table', 'upload','laydate', 'jquery','formSelects'], function () {
    $ = layui.jquery;
    form = layui.form;
    upload = layui.upload;
    laydate = layui.laydate;
    $form = $('form');
    formSelects = layui.formSelects;
    formSelects.render();

    form.on('submit(confirm)', function (data) {
      let partnerIds = formSelects.value("partnerId","valStr");
       if(isBlank(partnerIds)){
          layer.msg("请选择资方");
          return false;
       }
      parent.addPartnerHtml(partnerIds);
      closeDiv();
    });

  })

  function  closeDiv() {
    let index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
    parent.layer.close(index);
  }

  function isBlank(val) {
    if (val == null || val == '' || val == undefined) {
      return true;
    }
    return false;
  }


</script>
</body>
</html>
