<%@ 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}/static/css/reset.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.css" media="all">
    <style>
        .layui-form-select dl{
            max-height:200px;
            width: 80%;
        }
        .w-130{width: 130px}
        .ml120 .layui-input-block{margin-left: 130px}
        .ml-130{margin-left:  130px}
        .border-grey{border: 1px solid #DDD; border-radius: 10px;}
        .table-input{width: 90%; border: none; text-align: center; height: 30px; line-height: 30px}
        .layui-elem-field legend{font-size: 16px}
        .img-80{display: flex; justify-content: center;}
        .img-80 .bj-img{margin-right: 0}
        tbody .layui-table-cell{
            padding: 0;
        }
        tbody .table-input{
            width: 100%;
        }
        .layui-table td{
            text-align: center;
        }
        .layui-table th{
            text-align: center;
        }
    </style>
</head>
<body>
<div class="layui-form" id="LAY_app">
    <div class="layui-card mt-10">

        <div class="layui-tab layui-tab-brief over pt-20 pb-40 h-350" lay-filter="docDemoTabBrief" id="detailSet">
            <ul class="layui-tab-title">
                <li class="layui-this">表单信息</li>
               <%-- <li>流程路径</li>--%>
                <li>审批过程</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <blockquote class="layui-elem-quote">项目信息</blockquote>
                    <div class="layui-row ml120 mt-20">
                        <div class="layui-col-xs9">
                            <div class="layui-col-xs12 mb-15 pr-30">
                                <label class="layui-form-label w-130"><i class="red">*</i>代理商名称：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="name" disabled autocomplete="off" placeholder="请输入代理商名称" class="layui-input" value="${trader.name}">
                                </div>
                            </div>
                            <c:if test="${empty trader.traderId}">
                                <div class="layui-col-xs12 mb-10 pr-30">
                                    <div class="layui-inline layui-col-xs6">
                                        <label class="layui-form-label w-130"><i class="red">*</i>登录账号：</label>
                                        <div class="layui-input-block ">
                                            <input type="text"  name="loginName" disabled autocomplete="off" placeholder="请输入登录账号" class="layui-input" value="${trader.loginName}">
                                        </div>
                                    </div>
                                    <div class="layui-inline layui-col-xs6">
                                        <label class="layui-form-label w-130"><i class="red">*</i>登录密码：</label>
                                        <div class="layui-input-block w-200" >
                                            <input type="password" name="password" disabled autocomplete="new-password" placeholder="请输入登录密码" class="layui-input" <c:if test="${trader.password eq null}">value=""</c:if>value="default">
                                        </div>
                                    </div>
                                </div>
                            </c:if>
                            <div class="layui-col-xs12 mb-10 pr-30">
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>法定代表人：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="contacts" disabled autocomplete="off" placeholder="请输入法定代表人" class="layui-input" value="${trader.contacts}">
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>联系电话：</label>
                                    <div class="layui-input-block w-200" >
                                        <input type="text" name="mobile" disabled autocomplete="off" placeholder="请填写联系电话" class="layui-input" value="${trader.mobile}">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-xs12 mb-10 pr-30">
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>实控人：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="actualContacts" disabled autocomplete="off" placeholder="请输入实控人" class="layui-input" value="${trader.actualContacts}">
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>联系电话：</label>
                                    <div class="layui-input-block w-200" >
                                        <input type="text" name="telephone" disabled autocomplete="off" placeholder="请填写实控人电话" class="layui-input" value="${trader.telephone}">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-xs12 mb-10 pr-30">
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>统一信用代码：</label>
                                    <div class="layui-input-block w-200" >
                                        <input type="text" name="taxNumber" disabled autocomplete="off" placeholder="请填写统一信用代码" class="layui-input" value="${trader.taxNumber}">
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>实控人身份证号：</label>
                                    <div class="layui-input-block w-200" >
                                        <input type="text" name="actualIdCode" disabled autocomplete="off" placeholder="请填写实控人身份证号" class="layui-input" value="${trader.actualIdCode}">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-xs12 mb-10 pr-30">
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>开户银行：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="bankName" disabled autocomplete="off" placeholder="请输入开户银行" class="layui-input" value="${trader.bankName}">
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>银行账号：</label>
                                    <div class="layui-input-block w-200" >
                                        <input type="text" name="bankCode" disabled autocomplete="off" placeholder="请填写银行账号" class="layui-input" value="${trader.bankCode}">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-xs12 mb-10 pr-30">


                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>保证金额度：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="bondLimit" disabled  autocomplete="off" placeholder="请输入保证金额度" class="layui-input" value="${trader.bondLimit}">
                                        <span class="pos-a h-32 lh-32 layui-span-unit">元</span>
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>打款保证金 ：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="bond" disabled autocomplete="off" placeholder="请输入打款保证金 " class="layui-input" value="${trader.bond}">
                                        <span class="pos-a h-32 lh-32 layui-span-unit">元</span>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-xs12 mt-10 pr-30">
                                <label class="layui-form-label w-130"><i class="red">*</i>代理商地址：</label>
                                <div class="layui-input-block ml-130">
                                    <div class="layui-col-xs4 pr-20">
                                        <select class="province" id="province" name="province" disabled>
                                            <option value="trader.province">${trader.province}</option>
                                        </select>
                                    </div>
                                    <div class="layui-col-xs4 pr-20">
                                        <select class="city" name="city" id="city"disabled >
                                            <option value="${trader.city}">${trader.city}</option>

                                        </select>
                                    </div>
                                    <div class="layui-col-xs4">
                                        <select class="area" name="area" id="area" disabled>
                                            <option value="${trader.area}">${trader.area}</option>

                                        </select>
                                    </div>
                                    <div class="layui-col-xs12 mt-20">
                                        <input type="text" id="address" name="address" disabled class="layui-input layui-col-lg2"
                                               value="${trader.address}">
                                    </div>

                                </div>
                            </div>
                            <div class="layui-col-xs12 mt-15 pr-30">
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>仓库接收人：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="warehouseTake" disabled  class="layui-input" value="${trader.warehouseTake}">
                                    </div>
                                </div>
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="red">*</i>联系电话：</label>
                                    <div class="layui-input-block w-200" >
                                        <input type="text"  name="warehouseTakeMobile" disabled class="layui-input" value="${trader.warehouseTakeMobile}">

                                    </div>
                                </div>
                            </div>

                            <div class="layui-col-xs12 mt-20 pr-30">
                                <label class="layui-form-label w-130"><i class="red">*</i>仓库地址：</label>
                                <div class="layui-input-block ml-130">
                                    <div class="layui-col-xs4 pr-20">
                                        <select class="province" id="takeDeliveryProvince" name="takeDeliveryProvince" disabled >
                                            <option value="${trader.takeDeliveryProvince}">${trader.takeDeliveryProvince}</option>

                                        </select>
                                    </div>
                                    <div class="layui-col-xs4 pr-20">
                                        <select class="city" name="takeDeliveryCity" id="takeDeliveryCity" disabled >
                                            <option value="${trader.takeDeliveryCity}">${trader.takeDeliveryCity}</option>

                                        </select>
                                    </div>
                                    <div class="layui-col-xs4">
                                        <select class="area" name="takeDeliveryArea" id="takeDeliveryArea" disabled >
                                            <option value="${trader.takeDeliveryArea}">${trader.takeDeliveryArea}</option>

                                        </select>
                                    </div>
                                    <div class="layui-col-xs12 mt-20">
                                        <input type="text" id="takeDeliveryAddress" name="takeDeliveryArea" lay-verify="takeDeliveryArea" class="layui-input layui-col-lg2"
                                               value="${trader.takeDeliveryAddress}" disabled >
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-xs12 mt-20 pr-30">
                                <%--<div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="mark">*</i>外部编码：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="qqCompanyCode" readonly class="layui-input layui-bg-gray" value="${trader.qqCompanyCode}">
                                    </div>
                                </div>--%>
                                <div class="layui-inline layui-col-xs6">
                                    <label class="layui-form-label w-130"><i class="mark">*</i>编码：</label>
                                    <div class="layui-input-block w-200" >
                                        <input type="text" name="qqProjectCode" readonly class="layui-input layui-bg-gray" value="${trader.qqProjectName}">
                                    </div>
                                </div>
                            </div>
                            <%--<div class="layui-col-xs12 mt-20 pr-30">
                                <label class="layui-form-label w-130">备注：</label>
                                <div class="layui-input-block ml-130">
                                    <input type="text" name="remarks" readonly placeholder="" class="layui-input" value="${trader.remarks}">
                                </div>
                            </div>--%>
                        </div>
                        <div class="layui-col-xs3">
                            <div class="layui-input-block" style="margin-left: 50px">
                                <div id="imgsDiv" class="img-80">
                                    <div class="bj-img imgSpan">
                                        <img src="${commonStaticImgPath}${trader.licenseImg}"
                                             data-img="${commonStaticImgPath}${trader.licenseImg}" height="700" width="1200"/>
                                        <input type="hidden" class="imgPicker" value="${trader.licenseImg}"/> </div>
                                </div>
                                <div class="upload-container hide" id="uploader" style="margin: 0 auto;">
                                    <img src="" alt="img placeholder" id="imgsAdd">
                                </div>
                                <div style="width: 100%; text-align: center; color: #144856"><i class="mark">*</i>营业执照</div>
                            </div>
                            <%--<div class="layui-input-block" style="margin-left: 50px">
                                <div id="IdFrontimgsDiv" class="img-80">
                                    <div class="bj-img imgSpan">
                                        <img src="${commonStaticImgPath}${trader.idFrontImg}"
                                             data-img="${commonStaticImgPath}${trader.idFrontImg}" height="700" width="1200"/>
                                        <input type="hidden" class="imgPicker" value="${trader.idFrontImg}"/> </div>
                                </div>
                                <div class="upload-container hide" id="IdFrontimgsuploader" style="margin: 0 auto;">
                                    <img src="" alt="img placeholder" id="IdFrontimgsAdd">
                                </div>
                                <div style="width: 100%; text-align: center; color: #144856"><i class="mark">*</i>实控人身份证正面</div>
                            </div>
                            <div class="layui-input-block" style="margin-left: 50px">
                                <div id="idOppositeImgDiv" class="img-80">
                                    <div class="bj-img imgSpan">
                                        <img src="${commonStaticImgPath}${trader.idOppositeImg}"
                                             data-img="${commonStaticImgPath}${trader.idOppositeImg}" height="700" width="1200"/>
                                        <input type="hidden" class="imgPicker" value="${trader.idOppositeImg}"/> </div>
                                </div>
                                <div class="upload-container hide" id="idOppositeImguploader" style="margin: 0 auto;">
                                    <img src="" alt="img placeholder" id="idOppositeImgAdd">
                                </div>
                                <div style="width: 100%; text-align: center; color: #144856"><i class="mark">*</i>实控人身份证反面</div>
                            </div>--%>
                            <div class="layui-input-block" style="margin-left: 50px">
                                <div id="qqjyglwtsImgDiv" class="img-80">
                                    <c:if test="${not empty trader.qqjyglwtsImg }">
                                        <div class="bj-img imgSpan">
                                            <img src="${commonStaticImgPath}${trader.qqjyglwtsImg}"
                                                 data-img="${commonStaticImgPath}${trader.qqjyglwtsImg}" height="700" width="1200"/>
                                            <input type="hidden" class="imgPicker" value="${trader.qqjyglwtsImg}"/>
                                        </div>
                                    </c:if>
                                </div>
                                <div class="upload-container <c:if test="${not empty trader.qqjyglwtsImg}">hide</c:if> " id="qqjyglwtsImguploader" style="margin: 0 auto;">
                                    <img src="" alt="img placeholder" id="qqjyglwtsImgAdd">
                                </div>
                                <div style="width: 100%; text-align: center; color: #144856">全权经营管理委托书</div>
                            </div>
                            <%--<div class="layui-input-block" style="margin-left: 50px">
                                <div id="bzjdkpzImgDiv" class="img-80">
                                    <div class="bj-img imgSpan">
                                        <img src="${commonStaticImgPath}${trader.bzjdkpzImg}"
                                             data-img="${commonStaticImgPath}${trader.bzjdkpzImg}" height="700" width="1200"/>
                                        <input type="hidden" class="imgPicker" value="${trader.bzjdkpzImg}"/> </div>
                                </div>
                                <div class="upload-container hide" id="bzjdkpzImguploader" style="margin: 0 auto;">
                                    <img src="" alt="img placeholder" id="bzjdkpzImgAdd">
                                </div>
                                <div style="width: 100%; text-align: center; color: #144856"><i class="mark">*</i>保证金打款凭证</div>
                            </div>--%>

                            <div class="layui-input-block" style="margin-left: 50px">
                                <div id="sfzfmfyjImgDiv" class="img-80">
                                    <div class="bj-img imgSpan">
                                        <img src="${commonStaticImgPath}${trader.sfzfmfyjImg}"
                                             data-img="${commonStaticImgPath}${trader.sfzfmfyjImg}" height="700" width="1200"/>
                                        <input type="hidden" class="imgPicker" value="${trader.sfzfmfyjImg}"/> </div>
                                </div>
                                <div class="upload-container hide" id="sfzfmfyjImguploader" style="margin: 0 auto;">
                                    <img src="" alt="img placeholder" id="sfzfmfyjImgAdd">
                                </div>
                                <div style="width: 100%; text-align: center; color: #144856"><i class="mark">*</i>法定代表人身份证正反面<p>复印件(加盖公章)</p></div>
                            </div>

                            <div class="layui-input-block" style="margin-left: 50px">
                                <div id="sfzzmfyjImgDiv" class="img-80">
                                    <div class="bj-img imgSpan">
                                        <img src="${commonStaticImgPath}${trader.sfzzmfyjImg}"
                                             data-img="${commonStaticImgPath}${trader.sfzzmfyjImg}" height="700" width="1200"/>
                                        <input type="hidden" class="imgPicker" value="${trader.sfzzmfyjImg}"/> </div>
                                </div>
                                <div class="upload-container hide" id="sfzzmfyjImguploader" style="margin: 0 auto;">
                                    <img src="" alt="img placeholder" id="sfzzmfyjImgAdd">
                                </div>
                                <div style="width: 100%; text-align: center; color: #144856"><i class="mark">*</i>实控人身份证正反面<p>复印件(加盖公章)</p></div>
                            </div>
                            <div class="layui-input-block" style="margin-left: 50px">
                                <div id="dlszrsqbImgDiv" class="img-80">
                                    <c:if test="${not empty trader.dlszrsqbImg}">
                                        <div class="bj-img imgSpan">
                                            <img src="${commonStaticImgPath}${trader.dlszrsqbImg}"
                                                 data-img="${commonStaticImgPath}${trader.dlszrsqbImg}" height="700" width="1200"/>
                                            <input type="hidden" class="imgPicker" value="${trader.dlszrsqbImg}"/>
                                        </div>
                                    </c:if>
                                </div>
                                <div class="upload-container <c:if test="${not empty trader.dlszrsqbImg}">hide </c:if> " id="dlszrsqbImguploader" style="margin: 0 auto;">
                                    <img src="" alt="img placeholder" id="dlszrsqbImgAdd">
                                </div>
                                <div style="width: 100%; text-align: center; color: #144856">代理商准入申请表</div>
                            </div>
                        </div>
                    </div>

                  <%--<div class="layui-col-xs12 mb-20 pr-30 mt-20" id="tb_table">


                    </div>--%>
                    <%--<div class="layui-col-xs12 mb-15 pr-30 ">
                        <label class="layui-form-label w-100">备注：</label>
                        <div class="layui-input-block">
                            <c:choose>
                                <c:when test="${from eq 'audit'}">
                                    <input type="text" name="content" id="auditRemarks" autocomplete="off" placeholder="" class="layui-input" value="">
                                </c:when>
                                <c:otherwise>
                                    <input type="text" autocomplete="off" placeholder="" class="layui-input layui-bg-gray" disabled value="${apply.content}">
                                </c:otherwise>
                            </c:choose>
                       </div>
                    </div>--%>
                    <c:if test="${from ne 'audit'}">
                        <div class="layui-row ml120 ">
                            <div class="layui-col-xs12 mb-15 pr-30 mt-10">
                                <label class="layui-form-label w-130">备注：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="content" disabled   autocomplete="off" placeholder="" class="layui-input" value="${trader.remarks}">
                                </div>
                            </div>
                        </div>
                    </c:if>

                    <c:if test="${from eq 'audit'}">
                        <div class="layui-row ml120 ">
                            <div class="layui-col-xs12 mb-15 pr-30 mt-10">
                                <label class="layui-form-label w-130">备注：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="content" id="auditRemarks" autocomplete="off" placeholder="" class="layui-input" value="">
                                </div>
                            </div>
                        </div>
                    </c:if>



            </div>
           <%-- <div class="layui-tab-item licheng">
                <ul class="layui-timeline" id="licheng"></ul>
            </div>--%>

            <div class="layui-tab-item guocheng">
                <ul class="layui-timeline">
                    <c:forEach items="${infos}" var="info">
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis"></i>
                            <div class="layui-timeline-content layui-text">
                                <div class="layui-timeline-title"><fmt:formatDate value="${info.operateTime}" pattern="yyyy-MM-dd HH:mm:ss"/>&nbsp;&nbsp;&nbsp;${info.detail}</div>
                            </div>
                        </li>
                    </c:forEach>

                </ul>
            </div>
            </div>
        </div>
            <div  class="openDivBottom">
                <div class="layui-col-xs4">
                    提交人：${trader.creator}
                </div>
                <div class="layui-col-xs4">
                    所属部门：${trader.departmentName}
                </div>
                <div class="layui-col-xs4">
                    申请时间：<fmt:formatDate value="${trader.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                </div>
            </div>
            <div style="height: 20px"></div>


            <input type="hidden" name="id" id="id" value="${trader.id}">
            <input type="hidden" name="licenseImg" id="licenseImg" value="${trader.licenseImg}">
            <%--<input type="hidden" name="idFrontImg" id="idFrontImg" value="${trader.idFrontImg}">
            <input type="hidden" name="idOppositeImg" id="idOppositeImg" value="${trader.idOppositeImg}">--%>
            <input type="hidden" name="qqjyglwtsImg" id="qqjyglwtsImg" value="${trader.qqjyglwtsImg}" lay-verify="imgsLs">
            <input type="hidden" name="bzjdkpzImg" id="bzjdkpzImg" value="${trader.bzjdkpzImg}" lay-verify="imgsLs">
            <input type="hidden" name="sfzzmfyjImg" id="sfzzmfyjImg" value="${trader.sfzzmfyjImg}" lay-verify="imgsLs">
            <input type="hidden" name="sfzfmfyjImg" id="sfzfmfyjImg" value="${trader.sfzfmfyjImg}" lay-verify="imgsLs">
            <input type="hidden" name="dlszrsqbImg" id="dlszrsqbImg" value="${trader.dlszrsqbImg}" lay-verify="imgsLs">
            <input type="hidden" name="taskId" id="taskId" value="${trader.taskId}">
            <input type="hidden" id="processInstanceId" value="${trader.processInstanceId}">
            <input type="hidden" id="status" value="${trader.status}">
            <div class="layui-col-xs12 mb-20 pr-30 mt-20">
            </div>

        <div class="layui-form-item operate-footer" style="text-align: center;">
            <c:if test="${from eq 'audit'}">
                <input type="button"  id="approve" class="layui-btn " value="同意">
                <input type="button"  id="back" class="layui-btn " value="驳回">
            </c:if>
            <input type="button"   value="取消" class="layui-btn layui-btn-primary " onclick="closeDiv();" >
        </div>
    </div>
</div>
<div id="lookImg" class="hide pos-r">
    <div style="position:relative;width:90%;height:450px;">
        <div class="w-500 h-450 lookImg">
            <img src="" width="80%" id="image">
        </div>
    </div>
</div>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/data.js"></script>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.js"></script>
<script type="text/javascript">
    var viewer = new Viewer(document.getElementById('LAY_app'));
    //初始数据
    var $form;
    var form;
    var upload;
    var $;
    var imgs='';
    var myreg=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;
    var reg = /^(\d{2})(\d{4})(\d{4})(\d{2})(\d{2})\d{2}(\d)(\d|X)$/;
    var shuzi = /^\d+(\.\d+)?$/;
    layui.use(['form', 'table', 'upload', 'jquery','element'], function () {
        $ = layui.jquery;
        form = layui.form;
        upload = layui.upload;
        $form = $('form');
        var table = layui.table;
        var element = layui.element;
        element.on('tab(docDemoTabBrief)', function (data) {
            console.log(data);
            $('.layui-tab-content').eq(data.index).removeClass('layui-hide').siblings('.layui-tab-content').addClass('layui-hide');
            /*if(data.index==1){
                var htsks = $("#licheng").html();
                if(!isBlank(htsks)){
                    return ;
                }
                var len=$("#licheng li").length;
                console.log("leng"+len);
                if(len==0){
                    var processInstanceId=$("#processInstanceId").val();
                    var status=$("#status").val();
                    $.ajax({
                        type:"POST",
                        url:"${ctx}/set/process/getBpmnModel",
                        data:{
                            processInstanceId:processInstanceId,
                            status:status,
                        },
                        success:function(res){
                            if(res.code=="200"){
                                var str=res.data;
                                var ht='';
                                for(var i=0;i<str.length;i++){
                                    var taski = str[i];
                                    console.log(taski);
                                    ht+='<li class="layui-timeline-item">';
                                    ht+='<i class="layui-icon layui-timeline-axis">&#xe63f;</i>';
                                    ht+='<div class="layui-timeline-content layui-text">';
                                    if(taski.status=='3'){
                                        ht+='<h3 class="layui-timeline-title fontColor1">'+taski.taskName+'</h3>'
                                        ht+='<p class="fontColor1">'+taski.approveUserName+'</p>';
                                    }else{
                                        ht+='<h3 class="layui-timeline-title">'+taski.taskName+'</h3>'
                                        ht+='<p>'+taski.approveUserName+'</p>';
                                    }
                                    ht+='</div>'
                                    ht+='</li>';
                                }

                                $("#licheng").html(ht);
                            }
                        },
                    }) ;
                }
            }*/

        });

        table.init('parse-table-demo',{
            height: 75
        })

        //通过
        $("#approve").click(function (){

            var index= layer.load(2, {shade: [0.5,'#fff'], content:''});

            var id=$("#id").val();
            var taskId=$("#taskId").val();
            var content=$("#auditRemarks").val();
            // if(isBlank(content)){
            //     layer.msg("请输入审核意见",{icon:2});
            //     return false
            // }
            $("#approve").attr("disabled","true");
            $.ajax({
                type:"POST",
                url:"${ctx}/flowpath/traderApply/examineTraderApply",
                data:{
                    id:id,
                    taskId:taskId,
                    content:content
                },
                success:function(res){
                    console.log(res+'----');
                    if(res.code=="200"){
                        parent.layer.msg("审核成功",{time:2000});
                        closeDiv();
                        parent.table.reload('test');
                    } else{
                        layer.msg(res.errMsg,{time:2000});
                        $("#approve").removeAttr("disabled");
                    }
                },
                complete: function () {
                    layer.close(index);
                },
                error:function (data) {
                }
            }) ;
        })

        //驳回
        $("#back").click(function (){
            var id=$("#id").val();
            var taskId=$("#taskId").val();
            var content=$("#auditRemarks").val();
            if(isBlank(content)){
                layer.msg("请输入备注！",{icon:"2"});
                return ;
            }
            $("#back").attr("disabled","true");
            $.ajax({
                type:"POST",
                url:"${ctx}/flowpath/traderApply/rejectTask",
                data:{
                    id:id,
                    taskId:taskId,
                    content:content
                },
                success:function(res){
                    console.log(res+'++++++');
                    if(res.code=="200"){
                        parent.layer.msg("驳回成功",{time:2000});
                        closeDiv();
                        parent.table.reload('test');
                    } else{
                        layer.msg(res.errMsg,{time:2000});
                        $("#back").removeAttr("disabled");
                    }
                },
                error:function (data) {
                }
            }) ;
        })

    })





    function  closeDiv() {
        var 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>
