<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
    <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">
    <style>
        html {
            background-color: #fff;
        }
    </style>
</head>
<body class="">
<div class="layui-fluid layui-form" lay-filter="component-form-group" id="orderForm">
    <div class="layui-card pl-10 pr-30 pt-10 over">
        <div class="layui-card-body layui-col-xs11">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <div class="layui-card">
                    <input type="hidden" name="id" id="orderId" value="${order.id}">
                    <input type="hidden" name="fittingFlag" id="fittingFlag" value="${order.fittingFlag}">
                    <input type="hidden" name="status" id="status" value="${order.siteStatus}">
                    <%--<div class="site-demo-button siteOrderButten">
                        <button type="button" class="layui-btn  ">基本信息</button>
                        <button type="button" class="layui-btn layui-btn-primary">过程信息</button>
                    </div>--%>
                </div>
                <ul class="layui-tab-title">
                    <li class="layui-this">基本信息</li>
                    <li>过程信息</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-card jibenxinxi">
                            <div class="layui-card-body ">
                                <div class="layui-row layui-col-space12 layui-form-item">
                                    <div class="layui-col-lg2 layui-col-sm4">
                                        <label class="layui-form-label">工单编号：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="number" id="number" lay-verify="required" placeholder=""
                                                   autocomplete="off" class="layui-input layui-bg-gray" value="${order.number}" disabled>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg2 layui-col-sm3" lay-filter="component-form-element">
                                        <label class="layui-form-label"><i class="mark">*</i>信息来源：</label>
                                        <div class="layui-input-block">
                                            <select name="orderType" id="orderType" lay-verify="required" class=" layui-bg-gray" disabled>
                                                <option value="">请选择</option>
                                                <option value="1" <c:if test="${order.orderType eq 1}">selected</c:if>>用户</option>
                                                <option value="2" <c:if test="${order.orderType eq 2}">selected</c:if>>平台录入</option>
                                                <option value="4" <c:if test="${order.orderType eq 4}">selected</c:if>>电子商务</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="layui-col-lg2 layui-col-sm3">
                                        <label class="layui-form-label">服务类型：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="serviceType" id="serviceType" lay-verify="required" placeholder=""
                                                   autocomplete="off" class="layui-input layui-bg-gray" value="${order.serviceType}" disabled>
                                        </div>
                                    </div>
                                    <c:if test="${order.serviceType eq '安装'}">
                                        <div class="layui-col-lg2 layui-col-sm4">
                                            <label class="layui-form-label"><i class="mark">*</i>容量：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="applianceCapacity" id="applianceCapacity" lay-verify="required" placeholder=""
                                                       autocomplete="off" class="layui-input layui-bg-gray" value="${order.applianceCapacity}" disabled>   <span class="pos-a h-32 lh-32 layui-span-unit" >KW</span>
                                            </div>
                                        </div>
                                    </c:if>
                                    <div class="layui-col-lg2 layui-col-sm3">
                                        <label class="layui-form-label"><i class="mark">*</i> 服务措施：</label>
                                        <div class="layui-input-block">
                                            <select name="serviceMeasures" id="serviceMeasures" class="layui-bg-gray" lay-filter="aihao" lay-search disabled>
                                                <option value="">请选择</option>
                                                <c:forEach items="${serviceMeasures}" var="measures">
                                                    <option value="${measures.columns.service_measures}" <c:if test="${measures.columns.service_measures eq order.serviceMeasures}">selected</c:if>> ${measures.columns.service_measures}</option>
                                                </c:forEach>
                                            </select>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <div class="layui-card jibenxinxi ">
                            <div class="layui-card-header pt-10">
                                <h1 class="title">用户信息</h1>
                            </div>
                            <div class="layui-card-body ">
                                <div class="layui-form" action="" lay-filter="component-form-element">
                                    <div class="layui-row layui-col-space12 layui-form-item">

                                        <div class="layui-col-lg3 layui-col-sm4">
                                            <label class="layui-form-label"><i class="mark">*</i>用户姓名：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="customerName" id="customerName" lay-verify="required"
                                                       placeholder=""
                                                       autocomplete="off" class="layui-input layui-bg-gray"
                                                       value="${order.customerName}" disabled>
                                            </div>
                                        </div>

                                        <div class="layui-col-lg3 layui-col-sm4">
                                            <label class="layui-form-label"><i class="mark">*</i>联系方式1：</label>
                                            <div class="layui-input-block pr-30">
                                                <input type="text" name="customerMobile" lay-verify="required"
                                                       class="layui-input layui-bg-gray" value="${order.customerMobile}"
                                                       disabled>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3 layui-col-sm4">
                                            <label class="layui-form-label">联系方式2：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="customerTelephone" id="customerTelephone"
                                                       placeholder=""
                                                       autocomplete="off" class="layui-input layui-bg-gray"
                                                       value="${order.customerTelephone}" disabled>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg8">
                                            <div class="layui-col-xs12 layui-form-item">
                                                <label class="layui-form-label"><i class="mark">*</i>用户地址：</label>
                                                <div class="layui-input-block">
                                                    <div class="layui-col-lg3 layui-col-sm3 pr-30">
                                                        <select name="province" id="province" lay-verify="required"
                                                                lay-filter="province" disabled lay-search>
                                                            <option value=""></option>
                                                            <c:forEach items="${pros}" var="pro">
                                                                <option value="${pro.columns.ProvinceName}"
                                                                        <c:if test="${order.province eq pro.columns.ProvinceName}">selected</c:if>
                                                                        title="${pro.columns.ProvinceID }">${pro.columns.ProvinceName}</option>
                                                            </c:forEach>
                                                        </select>
                                                    </div>
                                                    <div class="layui-col-lg2 layui-col-sm3 pr-30">
                                                        <select name="city" id="city" lay-verify="required" lay-filter="city"
                                                                disabled lay-search>
                                                            <option value="">请选择</option>
                                                            <c:forEach items="${faccitys}" var="city">
                                                                <option value="${city.columns.CityName}"
                                                                        <c:if test="${order.city eq city.columns.CityName}">selected</c:if>
                                                                        title="${city.columns.CityID}">${city.columns.CityName}</option>
                                                            </c:forEach>
                                                        </select>
                                                    </div>
                                                    <div class="layui-col-lg2 layui-col-sm3 pr-30">
                                                        <select name="area" id="area" lay-verify="required" lay-filter="aihao"
                                                                disabled lay-search>
                                                            <option value="">请选择</option>
                                                            <c:forEach items="${areas}" var="area">
                                                                <option value="${area.columns.DistrictName}"
                                                                        <c:if test="${order.area eq area.columns.DistrictName}">selected</c:if>
                                                                        title="${area.columns.DistrictID}">${area.columns.DistrictName}</option>
                                                            </c:forEach>
                                                        </select>
                                                    </div>
                                                    <div class="layui-col-lg6 layui-col-sm3">
                                                        <input type="text" name="customerAddress" lay-verify="required"
                                                               placeholder=""
                                                               autocomplete="off"
                                                               class="layui-input layui-col-lg2 layui-bg-gray"
                                                               value="${order.customerAddress}" disabled>
                                                    </div>
                                                </div>

                                            </div>

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

                        </div>
                        <div class="layui-card jibenxinxi">
                            <div class="layui-card-header pt-10">
                                <h1 class="title">服务信息</h1>
                            </div>
                            <div class="layui-card-body">
                                <div class="layui-form" action="" lay-filter="component-form-element">
                                    <div class="layui-row layui-col-space12 layui-form-item">

                                        <div class="layui-col-lg3 layui-col-sm4">
                                            <label class="layui-form-label"><i class="mark">*</i> 电站名称：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="powerStationName" id="powerStationName"  placeholder=""
                                                       autocomplete="off" class="layui-input layui-bg-gray" value="${order.powerStationName}" disabled>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg2 layui-col-sm3">
                                            <label class="layui-form-label"><c:if test="${order.serviceType eq '维修'}"><i class="mark">*</i></c:if>设备类型：</label>
                                            <div class="layui-input-block">
                                                <select name="applianceCategory" class="layui-bg-gray" id="applianceCategory" disabled>
                                                    <option value="">请选择</option>
                                                    <option value="光伏组件" <c:if test="${order.applianceCategory eq '光伏组件'}">selected</c:if>>光伏组件</option>
                                                    <option value="逆变器" <c:if test="${order.applianceCategory eq '逆变器'}">selected</c:if>>逆变器</option>
                                                    <option value="通讯模块"  <c:if test="${order.applianceCategory eq '通讯模块'}">selected</c:if>>通讯模块</option>
                                                    <option value="并网箱"  <c:if test="${order.applianceCategory eq '并网箱'}">selected</c:if>>并网箱</option>
                                                    <option value="线缆"  <c:if test="${order.applianceCategory eq '线缆'}">selected</c:if>>线缆</option>
                                                    <option value="配件"  <c:if test="${order.applianceCategory eq '配件'}">selected</c:if>>配件</option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="layui-col-lg3 layui-col-sm4">
                                            <label class="layui-form-label"><c:if test="${order.serviceType eq '维修'}"><i class="mark">*</i></c:if>设备型号：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="applianceModel" id="applianceModel"  placeholder=""
                                                       autocomplete="off" class="layui-input layui-bg-gray" value="${order.applianceModel}" disabled >
                                            </div>
                                        </div>

                                        <div class="layui-col-lg2 layui-col-sm3">
                                            <label class="layui-form-label">投运时间：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="applianceBuyTime" id="applianceBuyTime" placeholder=""
                                                       disabled
                                                       autocomplete="off" class="layui-input layui-bg-gray"
                                                       value="<fmt:formatDate value="${order.applianceBuyTime}" pattern="yyyy-MM-dd" />">
                                            </div>
                                        </div>
                                        <div class="layui-col-lg2 layui-col-sm3">
                                            <label class="layui-form-label">设备品牌：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="applianceBrand" id="applianceBrand"  placeholder=""
                                                       autocomplete="off" class="layui-input layui-bg-gray" value="${order.applianceBrand}" disabled>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg2 layui-col-sm3">
                                            <label class="layui-form-label"><c:if test="${order.serviceType eq '维修'}"><i class="mark">*</i></c:if>设备序列号：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="applianceMachineCode" id="applianceMachineCode"   placeholder="" disabled
                                                       autocomplete="off" class="layui-input layui-bg-gray" value="${order.applianceMachineCode}">
                                            </div>
                                        </div>
                                        <div class="layui-col-lg3 layui-col-sm3 layui-form" lay-filter="component-form-element">
                                            <label class="layui-form-label"><i class="mark">*</i>保修类型：</label>
                                            <div class="layui-input-block">
                                                <select name="warrantyType" id="warrantyType" lay-filter="aihao"
                                                        class="layui-bg-gray" disabled>
                                                    <option value="">请选择</option>
                                                    <option value="1"
                                                            <c:if test="${order.warrantyType eq 1}">selected</c:if> >保内
                                                    </option>
                                                    <option value="2"
                                                            <c:if test="${order.warrantyType eq 2}">selected</c:if> >保外
                                                    </option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg2 layui-col-sm3">
                                            <label class="layui-form-label">预约时间：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="promiseTime"  id="promiseTime"  placeholder="" disabled
                                                       autocomplete="off" class="layui-input layui-bg-gray" value="<fmt:formatDate value="${order.promiseTime}" pattern="yyyy-MM-dd" />">
                                            </div>
                                        </div>
                                        <div class="layui-col-lg2 layui-col-sm3">
                                            <label class="layui-form-label">时间要求：</label>
                                            <div class="layui-input-block">
                                                <select  name="promiseLimit" id="promiseLimit"  lay-filter="aihao" class="layui-bg-gray" disabled>
                                                    <option value="">请选择</option>
                                                    <c:forEach items="${promiseLimit}" var="timeList">
                                                        <option value="${timeList}" <c:if test="${timeList == order.promiseLimit}">selected</c:if>>${timeList}</option>
                                                    </c:forEach>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg2 layui-col-sm3">
                                            <label class="layui-form-label"><c:if test="${order.serviceType eq '安装'}"><i class="mark">*</i></c:if>销售商：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="pleaseReferMall" id="pleaseReferMall"  placeholder=""
                                                       autocomplete="off" class="layui-input layui-bg-gray" disabled value="${order.pleaseReferMall}" >
                                            </div>
                                        </div>
                                        <div class="layui-col-lg2 layui-col-sm3">
                                            <label class="layui-form-label">发票号码：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="invoice"  id="invoice"  placeholder=""
                                                       autocomplete="off" class="layui-input layui-bg-gray" disabled value="${order.invoice}">
                                            </div>
                                        </div>

                                        <div class="layui-col-lg3 layui-col-sm3">
                                            <label class="layui-form-label">重要程度：</label>
                                            <div class="layui-input-block">
                                                <select  name="level" id="level" class="layui-bg-gray" disabled>
                                                    <option value="">请选择</option>
                                                    <option value="1" <c:if test="${1 == order.level}">selected</c:if>>紧急</option>
                                                    <option value="2" <c:if test="${2 == order.level}">selected</c:if>>一般</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-lg2 layui-col-sm4">
                                            <label class="layui-form-label"><i class="red">*</i>报单时间：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="repairTime"  id="repairTime"  placeholder=""
                                                       autocomplete="off" class="layui-input layui-bg-gray" disabled value="<fmt:formatDate value="${order.repairTime}" pattern="yyyy-MM-dd HH:mm:ss" />">
                                            </div>
                                        </div>

                                        <div class="layui-col-xs12">
                                            <c:choose>
                                                <c:when test="${order.serviceType eq '安装'}">
                                                    <label class="layui-form-label">现场描述：</label>
                                                </c:when>
                                                <c:otherwise>
                                                    <label class="layui-form-label">故障描述：</label>
                                                </c:otherwise>
                                            </c:choose>
                                            <div class="layui-input-block">
                                        <textarea name="remarks" id="remarks" placeholder=""
                                                  class="layui-textarea layui-bg-gray" lay-verify="required"
                                                  disabled>${order.remarks}</textarea>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs12 layui-form-item">
                                            <c:choose>
                                                <c:when test="${order.serviceType eq '安装'}">
                                                    <label class="layui-form-label">附图：</label>
                                                </c:when>
                                                <c:otherwise>
                                                    <label class="layui-form-label">故障图片：</label>
                                                </c:otherwise>
                                            </c:choose>
                                            <div class="layui-input-block">
                                                <div id="imgsDiv">
                                                    <c:forEach var="image" items="${images}">
                                                        <div  class="bj-img imgSpan">
                                                            <span class="layui-icon-close layui-icon  layui-hide" onclick="delImg(this)"></span>
                                                            <img src="${commonStaticImgPath}${image}"  data-img="${commonStaticImgPath}${image}"  height="700" width="1200"/>
                                                            <input type="hidden" class="imgPicker" value="${image}">
                                                        </div>
                                                    </c:forEach>
                                                </div>
                                                <div class="upload-container layui-hide" id="uploader">
                                                    <img src="" alt="img placeholder" id="imgsAdd">
                                                </div>
                                            </div>

                                        </div>
                                        <div class="layui-col-xs12 layui-form-item layui-hide tishi">
                                            <label class="layui-form-label"></label>
                                            <div class="layui-input-block" style="color: #cc2a2c">
                                                提示：最多可上传4张照片
                                            </div>
                                        </div>
                                    </div>

                                </div>

                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item guoChen">

                    </div>
                </div>
            </div>
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <ul class="layui-tab-title">
                    <li class="layui-this">服务反馈</li>
                    <li>备件信息</li>
                    <li>评价记录</li>
                    <c:if test="${order.status ne 3}">
                        <li>回访信息</li>
                    </c:if>
                    <c:if test="${order.status eq 5 || order.status eq 6}">
                        <li>结算信息</li>
                    </c:if>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-card-body fuwufankui">
                            <div class="layui-form" action="" lay-filter="component-form-element">
                                <div class="layui-row layui-col-space12 layui-form-item">
                                    <div class="layui-col-lg2 layui-col-sm3">
                                        <label class="layui-form-label">工单状态：</label>
                                        <div class="layui-input-block">
                                            <c:if test="${order.status eq 1}">
                                                <input type="text" class="layui-input layui-bg-gray layui-disabled" disabled value="待派工">
                                            </c:if>
                                            <c:if test="${order.status eq 2}">
                                                <input type="text" class="layui-input layui-bg-gray layui-disabled" disabled value="服务中">
                                            </c:if>
                                            <c:if test="${order.status eq 3}">
                                                <c:choose>
                                                    <c:when test="${order.callbackResult eq 2}">
                                                        <input type="text" class="layui-input layui-bg-gray layui-disabled" disabled value="服务中">
                                                    </c:when>
                                                    <c:otherwise>
                                                        <input type="text" class="layui-input layui-bg-gray layui-disabled" disabled value="待回访">
                                                    </c:otherwise>
                                                </c:choose>
                                            </c:if>
                                            <c:if test="${order.status eq 4}">
                                                <input type="text" class="layui-input layui-bg-gray layui-disabled" disabled value="待结算">
                                            </c:if>
                                            <c:if test="${order.status eq 5}">
                                                <input type="text" class="layui-input layui-bg-gray layui-disabled" disabled value="已完成">
                                            </c:if>
                                            <c:if test="${order.status eq 6}">
                                                <input type="text" class="layui-input layui-bg-gray layui-disabled" disabled value="无效工单">
                                            </c:if>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg2 layui-col-sm4">
                                        <label class="layui-form-label">服务商：</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="" autocomplete="off" class="layui-input layui-bg-gray" value="${order.siteName}" disabled>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg2 layui-col-sm3">
                                        <label class="layui-form-label">服务工程师：</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="" autocomplete="off" class="layui-input layui-bg-gray" value="${order.employeName}" disabled>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg2 layui-col-sm4">
                                        <label class="layui-form-label">收款金额：</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="" autocomplete="off" class="layui-input layui-bg-gray" value="${order.totalCollections}" disabled>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg2 layui-col-sm3">
                                        <label class="layui-form-label" style="color: blue" id="showImage">收款凭证</label>
                                    </div>
                                    <div class="layui-col-xs12">
                                        <label class="layui-form-label">反馈内容：</label>
                                        <div class="layui-input-block">
                                            <c:forEach var="fbItems" items="${feedbackInfo.feedbackResults}">
                                                <p class="processItem">
                                                    <span class="time">${fbItems.feedbackTime} </span>
                                                    <span>${fbItems.feedbackName }：${fbItems.feedbackResults }</span>
                                                </p>
                                            </c:forEach>
                                        </div>
                                    </div>
                                    <c:if test="${order.serviceType eq '维修'}">
                                        <div class="layui-col-xs12">
                                            <label class="layui-form-label">过程图片：</label>
                                            <div class="layui-input-block">
                                                <c:forEach var="fbImgItems" items="${feedbackInfo.feedbackImgs}">
                                                    <c:if test="${not empty fbImgItems.fbImgPath }">
                                                        <c:forEach var="fbImgItem" items="${fbImgItems.fbImgPath}">
                                                            <div class="imgWrap1 f-l" id="img${da.index}">
                                                                <div class="imgWrap f-l mr-10 text-c">
                                                                    <img src="${commonStaticImgPath}${fbImgItem}" data-img="${commonStaticImgPath}${fbImgItem}" class="w-80 h-80 selectImg" style="width:150px;">
                                                                    <p class="hei">${fbImgItems.fbImgTime}</p>
                                                                </div>
                                                            </div>
                                                        </c:forEach>
                                                    </c:if>
                                                </c:forEach>
                                            </div>
                                        </div>
                                    </c:if>
                                    <c:if test="${order.serviceType eq '安装'}">
                                        <c:if test="${not empty feedbackInfo.imgFlag.fbImgPathFlag}">
                                            <div class="layui-col-xs12">
                                                <label class="layui-form-label">主要设备照片：</label>
                                                <div class="layui-input-block">
                                                    <c:forEach var="fbImgItems" items="${feedbackInfo.feedbackImgs}">
                                                        <c:if test="${not empty fbImgItems.fbImgPath }">
                                                            <c:forEach var="fbImgItem" items="${fbImgItems.fbImgPath}">
                                                                <div class="imgWrap1 f-l" id="img${da.index}">
                                                                    <div class="imgWrap f-l mr-10 text-c">
                                                                        <img src="${commonStaticImgPath}${fbImgItem}" data-img="${commonStaticImgPath}${fbImgItem}" class="w-80 h-80 selectImg" style="width:150px;">
                                                                        <p class="hei">${fbImgItems.fbImgTime}</p>
                                                                    </div>
                                                                </div>
                                                            </c:forEach>
                                                        </c:if>
                                                    </c:forEach>
                                                </div>
                                            </div>
                                        </c:if>

                                        <c:if test="${not empty feedbackInfo.imgFlag.steelStructureImgFlag}">
                                            <div class="layui-col-xs12">
                                                <label class="layui-form-label">钢结构照片：</label>
                                                <div class="layui-input-block">
                                                    <c:forEach var="fbImgItems" items="${feedbackInfo.feedbackImgs}">
                                                        <c:if test="${not empty fbImgItems.steelStructureImg }">
                                                            <c:forEach var="fbImgItem" items="${fbImgItems.steelStructureImg}">
                                                                <div class="imgWrap1 f-l" id="img${da.index}">
                                                                    <div class="imgWrap f-l mr-10 text-c">
                                                                        <img src="${commonStaticImgPath}${fbImgItem}" data-img="${commonStaticImgPath}${fbImgItem}" class="w-80 h-80 selectImg" style="width:150px;">
                                                                        <p class="hei">${fbImgItems.fbImgTime}</p>
                                                                    </div>
                                                                </div>
                                                            </c:forEach>
                                                        </c:if>
                                                    </c:forEach>
                                                </div>
                                            </div>
                                        </c:if>

                                        <c:if test="${not empty feedbackInfo.imgFlag.bracketImgFlag}">
                                            <div class="layui-col-xs12">
                                                <label class="layui-form-label">支架照片：</label>
                                                <div class="layui-input-block">
                                                    <c:forEach var="fbImgItems" items="${feedbackInfo.feedbackImgs}">
                                                        <c:if test="${not empty fbImgItems.bracketImg }">
                                                            <c:forEach var="fbImgItem" items="${fbImgItems.bracketImg}">
                                                                <div class="imgWrap1 f-l" id="img${da.index}">
                                                                    <div class="imgWrap f-l mr-10 text-c">
                                                                        <img src="${commonStaticImgPath}${fbImgItem}" data-img="${commonStaticImgPath}${fbImgItem}" class="w-80 h-80 selectImg" style="width:150px;">
                                                                        <p class="hei">${fbImgItems.fbImgTime}</p>
                                                                    </div>
                                                                </div>
                                                            </c:forEach>
                                                        </c:if>
                                                    </c:forEach>
                                                </div>
                                            </div>
                                        </c:if>


                                        <c:if test="${not empty feedbackInfo.imgFlag.assemblyImgFlag}">
                                            <div class="layui-col-xs12">
                                                <label class="layui-form-label">组件照片：</label>
                                                <div class="layui-input-block">
                                                    <c:forEach var="fbImgItems" items="${feedbackInfo.feedbackImgs}">
                                                        <c:if test="${not empty fbImgItems.assemblyImg }">
                                                            <c:forEach var="fbImgItem" items="${fbImgItems.assemblyImg}">
                                                                <div class="imgWrap1 f-l" id="img${da.index}">
                                                                    <div class="imgWrap f-l mr-10 text-c">
                                                                        <img src="${commonStaticImgPath}${fbImgItem}" data-img="${commonStaticImgPath}${fbImgItem}" class="w-80 h-80 selectImg" style="width:150px;">
                                                                        <p class="hei">${fbImgItems.fbImgTime}</p>
                                                                    </div>
                                                                </div>
                                                            </c:forEach>
                                                        </c:if>
                                                    </c:forEach>
                                                </div>
                                            </div>
                                        </c:if>

                                        <c:if test="${not empty feedbackInfo.imgFlag.deviceImgFlag}">
                                            <div class="layui-col-xs12">
                                                <label class="layui-form-label">设备接线照片：</label>
                                                <div class="layui-input-block">
                                                    <c:forEach var="fbImgItems" items="${feedbackInfo.feedbackImgs}">
                                                        <c:if test="${not empty fbImgItems.deviceImg}">
                                                            <c:forEach var="fbImgItem" items="${fbImgItems.deviceImg}">
                                                                <div class="imgWrap1 f-l" id="img${da.index}">
                                                                    <div class="imgWrap f-l mr-10 text-c">
                                                                        <img src="${commonStaticImgPath}${fbImgItem}" data-img="${commonStaticImgPath}${fbImgItem}" class="w-80 h-80 selectImg" style="width:150px;">
                                                                        <p class="hei">${fbImgItems.fbImgTime}</p>
                                                                    </div>
                                                                </div>
                                                            </c:forEach>
                                                        </c:if>
                                                    </c:forEach>
                                                </div>
                                            </div>
                                        </c:if>
                                        <c:if test="${not empty feedbackInfo.imgFlag.shelterImgFlag}">
                                            <div class="layui-col-xs12">
                                                <label class="layui-form-label">有无遮挡照片：</label>
                                                <div class="layui-input-block">
                                                    <c:forEach var="fbImgItems" items="${feedbackInfo.feedbackImgs}">
                                                        <c:if test="${not empty fbImgItems.shelterImg}">
                                                            <c:forEach var="fbImgItem" items="${fbImgItems.shelterImg}">
                                                                <div class="imgWrap1 f-l" id="img${da.index}">
                                                                    <div class="imgWrap f-l mr-10 text-c">
                                                                        <img src="${commonStaticImgPath}${fbImgItem}" data-img="${commonStaticImgPath}${fbImgItem}" class="w-80 h-80 selectImg" style="width:150px;">
                                                                        <p class="hei">${fbImgItems.fbImgTime}</p>
                                                                    </div>
                                                                </div>
                                                            </c:forEach>
                                                        </c:if>
                                                    </c:forEach>
                                                </div>
                                            </div>
                                        </c:if>
                                        <c:if test="${not empty feedbackInfo.imgFlag.panoramaImgFlag}">
                                            <div class="layui-col-xs12">
                                                <label class="layui-form-label">全景照片：</label>
                                                <div class="layui-input-block">
                                                    <c:forEach var="fbImgItems" items="${feedbackInfo.feedbackImgs}">
                                                        <c:if test="${not empty fbImgItems.panoramaImg}">
                                                            <c:forEach var="fbImgItem" items="${fbImgItems.panoramaImg}">
                                                                <div class="imgWrap1 f-l" id="img${da.index}">
                                                                    <div class="imgWrap f-l mr-10 text-c">
                                                                        <img src="${commonStaticImgPath}${fbImgItem}" data-img="${commonStaticImgPath}${fbImgItem}" class="w-80 h-80 selectImg" style="width:150px;">
                                                                        <p class="hei">${fbImgItems.fbImgTime}</p>
                                                                    </div>
                                                                </div>
                                                            </c:forEach>
                                                        </c:if>
                                                    </c:forEach>
                                                </div>
                                            </div>
                                        </c:if>
                                    </c:if>
                                </div>

                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-card beijianxinxi">
                            <table class="layui-table  " style="table-layout:fixed;">
                                <thead>
                                <tr>
                                    <th width="8%">序号</th>
                                    <th width="12%">物料号</th>
                                    <th width="12%">备件名称</th>
                                    <th width="12%">备件型号</th>
                                    <th width="12%">零售价格</th>
                                    <th width="12%">使用数量</th>
                                    <th width="12%">状态</th>
                                    <th width="12%">旧件状态</th>
                                </tr>
                                </thead>
                                <tbody class="bodyContent">


                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-card-body orderRelation">
                            <div class="layui-form" action="" lay-filter="component-form-element">
                                <div class="layui-row layui-col-space12 layui-form-item">
                                    <div class="layui-col-lg2 layui-col-sm3">
                                        <label class="layui-form-label">服务态度：</label>
                                        <div class="layui-input-block">
                                            <%--  <input type="text" class="layui-input layui-bg-gray layui-disabled" disabled value="${call.serviceAttitude}">--%>
                                            <c:if test="${call.serviceAttitude == 5}">
                                                <input type="text"   class="layui-input layui-bg-gray" value="十分满意" disabled>
                                            </c:if>
                                            <c:if test="${call.serviceAttitude == 4}">
                                                <input type="text"   class="layui-input layui-bg-gray" value="满意" disabled>
                                            </c:if>
                                            <c:if  test="${call.serviceAttitude == 3}">
                                                <input type="text"   class="layui-input layui-bg-gray" value="一般" disabled>
                                            </c:if>
                                            <c:if  test="${call.serviceAttitude == 2}">
                                                <input type="text"   class="layui-input layui-bg-gray" value="不满意" disabled>
                                            </c:if>
                                            <c:if  test="${call.serviceAttitude == 1}">
                                                <input type="text"   class="layui-input layui-bg-gray" value="十分不满意" disabled>
                                            </c:if>
                                            <c:if  test="${call.serviceAttitude == 6}">
                                                <input type="text"   class="layui-input layui-bg-gray" value="无效回访" disabled>
                                            </c:if>
                                            <c:if  test="${call.serviceAttitude == 7}">
                                                <input type="text"   class="layui-input layui-bg-gray" value="回访未成功" disabled>
                                            </c:if>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg2 layui-col-sm3">
                                        <label class="layui-form-label">多次上门：</label>
                                        <div class="layui-input-block">
                                            <%-- <input type="text" placeholder="" autocomplete="off" class="layui-input layui-bg-gray" value="${call.visitMany}" disabled>--%>
                                            <c:if test="${call.visitMany == 0}">
                                                <input type="text"  class="layui-input layui-bg-gray" value="否" disabled>
                                            </c:if>
                                            <c:if test="${call.visitMany == 1}">
                                                <input type="text"  class="layui-input layui-bg-gray" value="是" disabled>
                                            </c:if>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg2 layui-col-sm3">
                                        <label class="layui-form-label">收款总额：</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="" autocomplete="off" class="layui-input layui-bg-gray" value="${payment}" disabled>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg2 layui-col-sm4">
                                        <label class="layui-form-label">回访总额：</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="" autocomplete="off" class="layui-input layui-bg-gray" value="${call.visitTotal}" disabled>
                                        </div>
                                    </div>
                                    <div class="layui-col-lg2 layui-col-sm4">
                                        <label class="layui-form-label">回访结果：</label>
                                        <div class="layui-input-block">
                                            <%--  <input type="text" placeholder="" autocomplete="off" class="layui-input layui-bg-gray" value="${call.result}" disabled>--%>
                                            <c:if test="${call.result == 1}">
                                                <input type="text"  class="layui-input layui-bg-gray" value="已回访" disabled>
                                            </c:if>
                                            <c:if test="${call.result == 2}">
                                                <input type="text"  class="layui-input layui-bg-gray" value="仍需上门" disabled>
                                            </c:if>
                                            <c:if test="${call.result == 3}">
                                                <input type="text"  class="layui-input layui-bg-gray" value="无人接听" disabled>
                                            </c:if>
                                            <c:if test="${call.result == 4}">
                                                <input type="text"  class="layui-input layui-bg-gray" value="回访驳回" disabled>
                                            </c:if>
                                            <c:if test="${call.result == 5}">
                                                <input type="text"  class="layui-input layui-bg-gray" value="多次回访" disabled>
                                            </c:if>
                                        </div>
                                    </div>
                                    <div class="layui-col-xs10">
                                        <label class="layui-form-label">回访内容：</label>
                                        <div class="layui-input-block">
                                            <textarea class="layui-textarea layui-bg-gray " value="${call.remarks}"  disabled>${call.remarks}</textarea>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-card-body settleMent">
                            <table class="layui-table " align="center">
                                <colgroup>
                                    <col width="100">
                                    <col width="200">
                                    <col>
                                </colgroup>
                                <thead align="center">
                                <tr>
                                    <td style="">结算方案</td>
                                    <td style="background-color: white">${serrds.columns.service_step}</td>
                                </tr>
                                </thead>
                                <tbody class="orderCost" align="center">
                                <tr>
                                    <td style="background-color:#eee">费用类型</td>
                                    <td style="background-color:#eee">结算金额</td>
                                </tr>
                                <tr>
                                    <td>服务费</td>
                                    <td>${serrds.columns.service_costs}</td>
                                </tr>
                                <tr>
                                    <td>里程费</td>
                                    <td>${serrds.columns.mileage_cost}</td>
                                </tr>
                                <tr>
                                    <td>奖励费</td>
                                    <td>${serrds.columns.reward_costs}</td>
                                </tr>
                                <tr>
                                    <td>其他费</td>
                                    <td>${serrds.columns.other_cost}</td>
                                </tr>
                                <tr>
                                    <td>合计</td>
                                    <td class="orderTd">${serrds.columns.service_costs+serrds.columns.reward_costs+serrds.columns.other_cost+serrds.columns.mileage_cost}</td>
                                </tr>
                                <tr>
                                    <td>结算备注</td>
                                    <td>${serrds.columns.remarks}</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-card-body serviceComment">
                            <div class="layui-col-lg2 layui-col-sm3">
                                <label class="layui-form-label">是否收款：</label>
                                <div class="layui-input-block mt-5">
                                    <c:if test="${comment.columns.if_charge eq 1}">是</c:if>
                                    <c:if test="${comment.columns.if_charge eq 2}">否</c:if>
                                </div>
                            </div>
                            <c:if test="${comment.columns.if_charge eq 1}">
                                <div class="layui-col-lg2 layui-col-sm3">
                                    <label class="layui-form-label">收款金额：</label>
                                    <div class="layui-input-block mt-5">
                                            ${comment.columns.charge_money}元
                                    </div>
                                </div>
                            </c:if>
                            <table class="layui-table " align="center">
                                <colgroup>
                                    <col width="30">
                                    <col width="120">
                                    <col width="30">
                                    <col>
                                </colgroup>
                                <thead align="center">
                                <tr>
                                    <td style="">序号</td>
                                    <td style="">评价内容</td>
                                    <td style="">评价状态</td>
                                </tr>
                                </thead>
                                <tbody class="orderCost" align="center">
                                <tr>
                                    <td>1</td>
                                    <td>是否及时上门服务</td>
                                    <td><c:if test="${fn:contains(comment.columns.supervise_id,'1')}">√</c:if></td>
                                </tr>
                                <tr>
                                    <td>2</td>
                                    <td>出示上岗证，穿工作服，戴安全帽</td>
                                    <td><c:if test="${fn:contains(comment.columns.supervise_id,'2')}">√</c:if></td>
                                </tr>
                                <tr>
                                    <td>3</td>
                                    <td>服务完成清洁现场</td>
                                    <td><c:if test="${fn:contains(comment.columns.supervise_id,'3')}">√</c:if></td>
                                </tr>
                                <tr>
                                    <td>4</td>
                                    <td>服务完成指导用户运维电站</td>
                                    <td><c:if test="${fn:contains(comment.columns.supervise_id,'4')}">√</c:if></td>
                                </tr>
                                <tr>
                                    <td>5</td>
                                    <td>服务人员服务态度满意</td>
                                    <td><c:if test="${fn:contains(comment.columns.supervise_id,'5')}">√</c:if></td>
                                </tr>
                                <tr>
                                    <td>6</td>
                                    <td>服务是否专业</td>
                                    <td><c:if test="${fn:contains(comment.columns.supervise_id,'6')}">√</c:if></td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-form-item operate-footer" style="text-align: center;">
        <div class="layui-btn-container">
            <%-- 3.待回访  4.待结算  5. 已完成  6.无效工单--%>
            <c:if test="${order.status eq 3}">
                <sfTags:pagePermission authFlag="DHF_XGGD_B"
                                       html='<button type="button" class="layui-btn xiugaiOrder">编辑</button>'/>
                <button type="button" class="layui-btn layui-hide uodateorder">保存</button>
                <button type="button" class="layui-btn layui-hide cancelorder">取消</button>
                <sfTags:pagePermission authFlag="DHF_HF_B"
                                       html='<button type="button" class="layui-btn callVisit">回访</button>'/>
                <c:if test="${order.warrantyFlag eq 0 && order.serviceType =='安装'}">
                    <sfTags:pagePermission authFlag="DHF_SCBXK_B"
                                           html='<button type="button" class="layui-btn warranty">生成保修卡</button> '/>
                </c:if>
                <c:if test="${order.warrantyFlag eq 1}">
                    <button type="button" class="layui-btn lookWarranty">查看保修卡</button>
                </c:if>
                <sfTags:pagePermission authFlag="DHF_WX_B"
                                       html='<button type="button" class="layui-btn invalid">无效</button>'/>
            </c:if>

            <c:if test="${order.status eq 4}">
                <sfTags:pagePermission authFlag="DJS_XGGD_B"
                                       html='<button type="button" class="layui-btn xiugaiOrder">编辑</button> '/>
                <button type="button" class="layui-btn layui-hide uodateorder">保存</button>
                <button type="button" class="layui-btn layui-hide cancelorder">取消</button>
                <sfTags:pagePermission authFlag="DJS_CXHF_B"
                                       html='<button type="button" class="layui-btn reCallVisit">重新回访</button> '/>
                <sfTags:pagePermission authFlag="DJS_JS_B"
                                       html='<button type="button" class="layui-btn settleOrder">结算</button> '/>
                <c:if test="${order.warrantyFlag eq 0 && order.serviceType =='安装'}">
                    <sfTags:pagePermission authFlag="DJS_SCBXK_B"
                                           html='<button type="button" class="layui-btn warranty">生成保修卡</button> '/>
                </c:if>
                <c:if test="${order.warrantyFlag eq 1}">
                    <button type="button" class="layui-btn lookWarranty">查看保修卡</button>
                </c:if>
                <sfTags:pagePermission authFlag="DJS_WX_B"
                                       html='<button type="button" class="layui-btn invalid">无效</button>'/>
            </c:if>

            <c:if test="${order.status eq 5}">
                <c:if test="${order.serviceType ne '咨询'}">
                    <sfTags:pagePermission authFlag="YWC_XGGD_B"
                                           html='<button type="button" class="layui-btn xiugaiOrder">编辑</button>'/>
                    <button type="button" class="layui-btn layui-hide uodateorder">保存</button>
                    <button type="button" class="layui-btn layui-hide cancelorder">取消</button>

                    <sfTags:pagePermission authFlag="YWC_CXJS_B"
                                           html='<button type="button" class="layui-btn reSettle">重新结算</button>'/>
                    <c:if test="${order.serviceType =='安装'}">
                        <button type="button" class="layui-btn lookWarranty">查看保修卡</button>
                    </c:if>
                </c:if>
            </c:if>
            <c:if test="${order.serviceType eq '维修'}">
                <button type="button" class="layui-btn  newOrder">新建工单</button>
            </c:if>
        </div>
    </div>
</div>
<div id="lookImg" class="hide pos-r">
    <div style="position:relative;width:100%;height:100%;">
        <div class="w-500 h-500 lookImg">
            <img src="" width="80%" id="image">
        </div>
        <i class="layui-icon xuanZhuan" style="position:absolute;bottom:9px;left:50%;">&#xe9aa;</i>
    </div>
</div>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script src="${ctxPlugin}/static/js/orderCommon.js"></script>
<script>
    var imgsCount="${imgNumber}";
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'layedit' ,'upload', 'laydate'], function () {
        $ = layui.$
            , admin = layui.admin
            , element = layui.element
            , form = layui.form
            , laydate = layui.laydate;
        var  upload = layui.upload;
        $(".mark").addClass("layui-hide");
        $(".red").addClass("layui-hide");

        $(".imgSpan img").click(function(){
            var img = $(this).attr("data-img");
            $("#lookImg img").attr('src',img);
            layer.open({
                type:1,
                title:'查看图片',
                area:['500px','550px'],
                content:$("#lookImg")
            })
        })
        //执行实例
        var uploadInst = upload.render({
            elem: '#uploader' //绑定元素
            , url: '${ctx}/common/uploadFile' //上传接口
            ,before: function(obj){
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {

                });
            }
            , done: function (res) {
                //上传完毕回调
                addImg(res.path);
            }
            , error: function () {
                //请求异常回调
            }
        });

        function addImg(data){
            imgsCount++;
            if (imgsCount >= 4) {
                $("#uploader").addClass("layui-hide");
            }else{
                $("#uploader").removeClass("layui-hide");
            }
            var html = '<div class="bj-img imgSpan"><span class="layui-icon-close layui-icon" onclick="delImg(this)"></span>';
            html += '<img src="${commonStaticImgPath}'+data+'" height="700" width="1200"/>';
            html += '<input type="hidden" class="imgPicker" value="'+data+'"/> </div>';
            $("#imgsDiv").append(html);
        }

        //日期
        laydate.render({
            elem: '#applianceBuyTime'
        });

        laydate.render({
            elem:'#repairTime'
            ,trigger: 'click'
            ,type: 'datetime'
        })
        laydate.render({
            elem: '#promiseTime'
            ,trigger: 'click'
        });
        form.render(null, 'component-form-element');
        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length < 5) {
                    return '标题至少得5个字符啊';
                }
            }
            , pass: [
                /^[\S]{6,12}$/
                , '密码必须6到12位，且不能出现空格'
            ]
            , content: function (value) {
                layedit.sync(editIndex);
            }
        });
        element.render('breadcrumb', 'breadcrumb');

        form.on('select(applianceBrand)', function (data) {
            var brand = data.value
            CategoryOrder(brand)
        });
        form.on('select(applianceCategory)', function (data) {
            var model = $(data.elem).find("option:selected").attr("title");
            $("#applianceModel").empty()
            if (isBlank(model)) {
                $("#applianceCategory").append("<option value=''>请选择</option>");
                return "";
            }
            orderModel(model);
        });

        form.on('select(province)', function (data) {
            var province = $(data.elem).find("option:selected").attr("title");
            provinceOrder(province);
        });
        form.on('select(city)', function (data) {
            var city = $(data.elem).find("option:selected").attr("title");
            cityOrder(city);

        });

        form.on('submit(component-form-demo1)', function (data) {

            //验证不必填项的值格式
            var shuzi = /[0-9]*[1-9][0-9]*$/;
            var applianceNum = data.field.applianceNum;
            var articleFrom = data.field;
            $.ajax({
                type: "POST",
                url: "${ctx}/order/saveOrder",
                data: articleFrom,
                success: function (data) {
                    if (data.code == '200') {
                        layer.msg('提交成功！', {icon: 1, time: 1000}, function () {
                            setTimeout('window.location.reload()', 1000);
                        });
                    } else {
                        layer.msg(data.msg, {icon: 2});
                    }
                }
            });

            return false;
        });

        form.on('select(completeLimitLength)', function(data){
            var model=$(data.elem).find("option:selected").attr("title");
            if(isBlank(model)){
                $(".completeExtendCost").html("¥0.00");
            }else{
                $("#completeExtendCost").val(model);
                $(".completeExtendCost").html("¥"+model);
            }
        });

        function provinceOrder(province) {
            $("#city").empty();
            $("#area").empty();
            if (isBlank(province)) {
                $("#city").append("<option value=''>请选择</option>");
                return "";
            }
            $.ajax({
                type: "POST",
                url: "${ctx}/main/redirect/getCitysByProId",
                data: {
                    province: province
                },
                success: function (result) {
                    if (result == "205") {
                        layer.msg("暂无数据!")
                        return
                    }
                    var html = " <option value=''>请选择</option>";
                    for (var i = 0; i < result.length; i++) {
                        var city = result[i];
                        html = html + '<option value="' + city.columns.CityName + '" title="' + city.columns.CityID + '">' + city.columns.CityName + '</option>';
                    }
                    $("#city").append(html);
                    form.render('select');
                }
            });

        }

        function cityOrder(city, arean) {
            $("#area").empty()
            if (isBlank(city)) {
                $("#area").append("<option value=''>请选择</option>");
                return "";
            }
            $.ajax({
                type: "POST",
                url: "${ctx}/main/redirect/getAreaByCityId",
                data: {
                    city: city
                },
                success: function (result) {
                    if (result == "205") {
                        layer.msg("暂无数据!")
                        return
                    }
                    var html = "<option value=''>请选择</option>";
                    for (var i = 0; i < result.length; i++) {
                        var area = result[i];
                        html = html + '<option value="' + area.columns.DistrictName + '" >' + area.columns.DistrictName + '</option>';
                    }
                    $("#area").append(html);
                    if (!isBlank(arean)) {
                        $("#area").val(arean)
                    }

                    form.render('select');
                }
            });

        }



        function CategoryOrder(brand, cateName) {
            $("#applianceCategory").empty();
            $("#applianceModel").empty();
            if (isBlank(brand)) {
                $("#applianceCategory").append("<option value=''>请选择</option>");
                return "";
            }
            $.ajax({
                type: "POST",
                url: "${ctx}/order/getCategoryByBrandname",
                data: {
                    brand: brand,
                    factId: factId
                },
                success: function (result) {
                    if (result == "205") {
                        layer.msg("暂无数据!");
                        return
                    }
                    var html = "<option value=''>请选择</option>";
                    for (var i = 0; i < result.length; i++) {
                        var cate = result[i];
                        html = html + '<option value="' + cate.columns.category + '" title="' + cate.columns.model + '">' + cate.columns.category + '</option>';
                    }
                    $("#applianceCategory").append(html);
                    $("#applianceCategory").val(cateName)
                    form.render('select');
                }
            });

        }

          var images="${collectionVoucher.columns.imgs}";
     /*   var images="sfimg02/M00/00/33/wKgCF1z3GruAUCswAALp7tlm2WY29..jpg,sfimg02/M00/00/3F/wKgCF11KJ4CAGjysAAKQF2GgG6g23..jpg,sfimg02/M00/00/33/wKgCF1z9p3GASP6mAAcBCt7Lur883..jpg";*/
        $("#showImage").click(function(){
            if(isBlank(images)){
                layer.msg("暂无数据!");
                return;
            }
            var arr=images.split(",");
            var number=0;
            $("#lookImg img").attr('src', "${commonStaticImgPath}" + arr[number]);
            layer.open({
                type: 1,
                title:'查看图片',
                area:['500px','543px'],
                btn:['上一张','下一张'],
                content: $('#lookImg'),
                yes:function(){
                    if(number<=0){
                        number=0;
                    }else{
                        number-=1;
                    }
                    $("#lookImg img").attr('src', "${commonStaticImgPath}" + arr[number]);
                },btn2:function(){
                    if(number>=arr.length-1){
                        number=arr.length-1;
                    }else{
                        number+=1;
                    }
                    $("#lookImg img").attr('src', "${commonStaticImgPath}" + arr[number]);
                    return false;
                }
            });
        })
        function orderModel(model) {
            if (isBlank(model)) {
                return
            }

            var mode = model.split(",")
            var html = "<option value=''>请选择</option>";
            for (var i = 0; i < mode.length; i++) {
                var mod = $.trim(mode[i]);
                html = html + '<option value="' + mod + '" >' + mod + '</option>';
            }
            $("#applianceModel").append(html);
            form.render('select');

        }

    });
    var siteId = "${order.siteId}";

    layui.use(['jquery', 'form'], function (args) {
        $ = layui.jquery;
        var form = layui.form;
        var aa = $('.siteOrderButten button');
        var orderId = $("#orderId").val();
        var sign = $("#sign").val();
        var fittingFlag = $("#fittingFlag").val();

        guocheng(orderId);

        $(".xiugaiOrder").click(function () {
            $(".mark").removeClass("layui-hide");
            $(".red").removeClass("layui-hide");
            $(this).addClass("layui-hide");
            $(".uodateorder").removeClass("layui-hide");
            $(".cancelorder").removeClass("layui-hide");
            $("input").removeClass("layui-bg-gray");
            $("input").removeClass("layui-disabled");
            $("input").removeAttr("disabled");
            $("select").removeAttr("disabled");
            $("textarea").removeClass("layui-bg-gray");
            $("#remarks").attr("disabled", false);
            $("#number").addClass("layui-bg-gray").attr("disabled",true);
            $("#serviceType").addClass("layui-bg-gray").attr("disabled",true);
            $("#serviceMeasures").addClass("layui-bg-gray").attr("disabled",true);
            $(".fuwufankui input").addClass("layui-bg-gray").attr("disabled",true);
            $("#imgsDiv span").removeClass("layui-hide");
            $(".callVisit").addClass("layui-disabled").attr("disabled",true);
            $(".warranty").addClass("layui-disabled").attr("disabled",true);
            $(".lookWarranty").addClass("layui-disabled").attr("disabled",true);
            $(".invalid").addClass("layui-disabled").attr("disabled",true);
            $(".newOrder").addClass("layui-disabled").attr("disabled",true);

            $(".reCallVisit").addClass("layui-disabled").attr("disabled",true);
            $(".settleOrder").addClass("layui-disabled").attr("disabled",true);

            $(".reSettle").addClass("layui-disabled").attr("disabled",true);

            if(imgsCount<4){
                $("#uploader").removeClass("layui-hide")
            }
            $(".tishi").removeClass("layui-hide");

            var serType=$("#serviceType").val();
            if("安装"==serType){
                $("#warrantyType").val("1").attr("disabled",true);
            }
            form.render('select');
        })
        //保存
        $(".uodateorder").click(function () {
            //验证不必填项的值格式
            var shuzi = /[0-9]*[1-9][0-9]*$/;
            var reg = /^(?:[1-9]\d*|0)(?:\.\d+)?$/;
            var orderType=$("#orderType").val();
            if(isBlank(orderType)){
                layer.msg("请输入信息来源!",{icon:2});
                return false
            }
            var serviceType=$("#serviceType").val(); //服务类型
            var serviceMeasures=$("#serviceMeasures").val()  //服务措施
            var customerName = $("#customerName").val();//用户姓名
            var customerMobile = $("input[name=customerMobile]").val();//联系方式1
            var customerTelephone = $("input[name=customerTelephone]").val();//联系方式2
            var province = $("#province").find("option:selected").text();//省
            var city = $("#city").find("option:selected").text();//市
            var area = $("#area").find("option:selected").text();//区
            var customerAddress = $("input[name=customerAddress]").val();//用户地址
            var applianceCapacity=$("#applianceCapacity").val();
            if(serviceType =='安装'){
                if(isBlank(applianceCapacity)){
                    layer.msg("请输入容量!", {icon: 2});
                    return false;
                }else  if (!reg.test(applianceCapacity)) {
                    layer.msg("容量格式不正确!", {icon: 2});
                    return false;
                }
            }
            if (isBlank(customerName)) {
                layer.msg("请输入用户姓名!", {icon: 2})
                return false
            }
            if (isBlank(customerMobile)) {
                layer.msg("请输入联系方式",{icon:2});
                return
            } else if (!isPhoneNo($.trim(customerMobile))) {
                layer.msg("手机号码格式不正确",{icon:2});
                return
            } else if (isBlank(customerAddress)) {
                layer.msg("请输入详细地址",{icon:2});
                return
            }
            if(isBlank(province)){
                layer.msg("请输入省",{icon:2});
                return
            }
            if(isBlank(city)){
                layer.msg("请输入市",{icon:2});
                return
            }
            if(isBlank(area)){
                layer.msg("请输入区",{icon:2});
                return
            }
            var powerStationName=$("#powerStationName").val();//电站名称
            var applianceCategory=$("#applianceCategory").val(); //设备类型
            var applianceModel=$("#applianceModel").val();//设备型号
            var applianceBuyTime=$("#applianceBuyTime").val();//投运时间
            var applianceBrand=$("#applianceBrand").val(); //设备品牌
            var applianceMachineCode=$("#applianceMachineCode").val(); //设备序列号
            var warrantyType = $("#warrantyType").find("option:selected").val();//保修类型
            var promiseTime = $("#promiseTime").val();//预约时间  2
            var promiseLimit = $("#promiseLimit").val();//时间要求   3
            var pleaseReferMall = $("#pleaseReferMall").val();//销售商  1
            var invoice=$("#invoice").val(); //发票号码
            var level=$("#level").val();  //重要程度
            var  repairTime=$("#repairTime").val(); //报单时间
            var remarks = $("textarea[name=remarks]").val();//故障描述
            if(isBlank(powerStationName)){
                layer.msg("请输入电站名称!",{icon:2});
                return false;
            }
            if(isBlank(warrantyType)){
                layer.msg("请输入保修类型!",{icon:2});
                return false;
            }
            if(isBlank(serviceMeasures)){
                layer.msg("请输入服务措施!",{icon:2});
                return false;
            }

            if(serviceType =='安装'){
                if(isBlank(pleaseReferMall)){
                    layer.msg("请输入销售商!",{icon:2});
                    return false;
                }
            }
            if(serviceType =='维修'){
                if(isBlank(applianceCategory)){
                    layer.msg("请输入设备类型!",{icon:2});
                    return false;
                }
                if(isBlank(applianceModel)){
                    layer.msg("请输入设备型号!",{icon:2});
                    return false;
                }
                if(isBlank(applianceMachineCode)){
                    layer.msg("请输入设备序列号!",{icon:2});
                    return false;
                }
            }

            if (isBlank(repairTime)) {
                layer.msg("请输入报单时间",{icon:2});
                return
            }
         /*   if (isBlank(remarks)) {
                layer.msg("请输入故障描述",{icon:2});
                return
            }*/
            var imgs = $(".imgPicker");
            var imgsAppend = '';
            imgs.each(function (index) {
                var img = $(this).val();
                if (!isBlank(img)) {
                    imgsAppend += img + ",";
                }
            });

            var orderId = $("#orderId").val();//工单id
            var order={
                id: orderId,
                serviceMeasures:serviceMeasures,
                applianceCapacity:applianceCapacity,
                orderType:orderType,
                customerName: customerName,
                customerMobile: customerMobile,
                customerTelephone: customerTelephone,
                province: province,
                city: city,
                area: area,
                customerAddress: customerAddress,
                powerStationName:powerStationName,
                applianceCategory: applianceCategory,
                applianceModel: applianceModel,
                applianceBuyTime: applianceBuyTime,
                applianceBrand:applianceBrand,
                applianceMachineCode:applianceMachineCode,
                warrantyType: warrantyType,
                promiseTime:promiseTime,
                promiseLimit:promiseLimit,
                pleaseReferMall: pleaseReferMall,
                invoice:invoice,
                level:level,
                repairTime: repairTime,
                remarks: remarks,
                bdImgs:imgsAppend
            };
            $.ajax({
                url: "${ctx}/order/saveUpdate",
                type: "post",
                contentType : "application/json;charsetset=UTF-8",
                data: JSON.stringify(order)
                , success: function (result) {
                    if (result.code == "200")  {
                        layer.msg("保存成功",{icon:1,time:1000},function(){
                            parent.table.reload('test');
                            window.location.href="${ctx}/order/getplatformOrderForm?orderId="+orderId;
                        })
                    }else{
                        layer.msg("保存失败！")
                    }
                }, error: function () {
                    layer.msg("保存失败", {icon: 2});
                }
            })

        })
        //取消
        $(".cancelorder").click(function () {
            $(this).addClass("layui-hide");
            $(".uodateorder").addClass("layui-hide");
            $(".xiugaiOrder").removeClass("layui-hide");

            window.location.reload();

        })
        /**
         * 转派
         */
        var orderId = $("#orderId").val();

        $(".transfer").click(function () {
            layer.open({
                type: 2,
                content: "${ctx}/dispatch/getturnDisOrderSite?orderId=" + orderId //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                , title: "转派"
                , area: ["800px", "480px"]
            });
        })
        //无效
        $(".invalid").click(function () {
            var indexla = layer.confirm('您确定要操作无效工单吗？', {
                icon: 3,
                btn: ['确定', '取消'] //按钮
            }, function () {
                layer.close(indexla);
                layer.open({
                    type:2,
                    content:"${ctx}/order/lookNOUse?orderId="+orderId+ "&where=1" //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                    ,title: "无效工单"
                    ,area:["600px","220px"]
                })
            }, function () {
                layer.close(indexla)
            });
        })

        //新建工单
        $(".newOrder").click(function(){
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index);
            parent.layer.open({
                type:2,
                content:"${ctx}/order/platform/addRepairOrder?orderId="+orderId,
                title:"新建工单",
                area: ['1100px', '90%'],
                end:function(){
                    //刷新表格
                }
            })
        })
        //回访
        $(".callVisit").click(function(){
            layer.open({
                type: 2,
                content: "${ctx}/callback/getSystemCallback?orderId="+orderId  //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                ,title: "回访"
                ,area:["680px","500px"]
                ,success : function(layero) {
                    layero.find('.layui-layer-btn').css('text-align', 'center');
                    layero.find('.layui-layer-btn').find(".layui-layer-btn0").css("background-color","#009688");
                }
            });
        })

        //重新回访
        $(".reCallVisit").click(function(){
            layer.open({
                type: 2,
                content: "${ctx}/callback/anewCallbackOrder?orderId="+orderId  //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                ,title: "回访"
                ,area:["680px","500px"]
            });
        })

   //结算
        var warrantyFlag = "${order.warrantyFlag}";
        var serviceType="${order.serviceType}";
        $(".settleOrder").click(function(){
             if(warrantyFlag=='0'&& serviceType=='安装'){
                 layer.msg("请先生成保修卡再来结算！",{icon:5,anim:6});
                 return;
             }
            layer.open({
                type: 2,
                content: "${ctx}/settlement/site/stat/getSettlement?orderId="+orderId  //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                ,title: "结算"
                ,area:["780px","500px"]
            })
        })
     //重新结算
        $(".reSettle").click(function(){
            layer.open({
                type: 2,
                content: "${ctx}/settlement/site/stat/siteAgainSettle?orderId="+orderId  //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                ,title: "结算"
                ,area:["780px","500px"]
            })
        })
     //生成保修卡
        $(".warranty").click(function(){
            parent.layer.open({
                type: 2,
                content: "${ctx}/callback/buildWarranty?orderId="+orderId //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                ,area: ['1100px','96%']
                ,title: false //不显示标题栏
                ,shade: 0.8
              /*  ,btn: ['确认生成', '取消']*/
                ,btnAlign: 'c'
                ,scrollbar:false
              /* , zIndex: layer.zIndex
                ,success: function(layero){
                    layer.setTop(layero); //重点2
                }*/
                ,cancel: function(){
                    window.location.reload();
                }
            });
        })
     // 查看保修卡
        $(".lookWarranty").click(function(){
            parent.layer.open({
                type: 2,
                content: "${ctx}/callback/lookWarranty?orderId="+orderId //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                ,area: ['1100px','96%']
                ,title: false //不显示标题栏
                ,shade: 0.8
                ,btnAlign: 'c'
                ,scrollbar:false
        });
        })
        //点击放大查看图片
        $(".selectImg").click(function(){
            var img = $(this).attr("data-img");
            $("#lookImg img").attr('src',img);
            layer.open({
                type:1,
                title:'查看图片',
                area:['500px','543px'],
                content:$("#lookImg")
            })
        })

               //旋转
        var deg = 0;
        $(".xuanZhuan").click(function(){
            deg += 90;
            document.getElementById("image").style.transform = "rotate(" + deg + "deg)";
        })

        //反馈
        $(".feedback").click(function () {
            var barcode = $("#applianceBarcode").val();
            var status = $("#status").val();
            if(status == '3'){
                layer.msg("服务商未派工，不可操作反馈！",{icon:5,anim:6});
                return;
            }
            var mark = false;
            layer.open({
                type: 2,
                content: "${ctx}/order/platFormFeedback?orderId="+orderId  //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                , title: "反馈封单"
                //  , btn: ['过程反馈', "反馈完成", "取消"]
                , area: ["700px", "420px"]
                , end:function(){
                    //  layer.closeAll()
                    //   layer.msg('反馈成功！', {icon: 1, time: 1000}, function () {
                    //    window.location.reload();
                    // });
                }
            });
        })

        //跟进信息
        $(".track_detail").click(function () {
            layer.prompt({title: '个人记录', formType: 2}, function (text, index) {
                if (isBlank(text)) {
                    layer.msg("请输入反馈内容", {icon: 2})
                    return
                }

                $.ajax({
                    type: "POST",
                    url: "${ctx}/order/FollowUp",
                    data: {
                        orderId: orderId,
                        follow: text
                    },
                    success: function (result) {
                        if (result == "200") {
                            layer.closeAll()
                            layer.msg('保存信息成功！', {icon: 1, time: 1000}, function () {
                                window.location.reload();
                            });
                        } else {
                            layer.msg('保存失败,数据有误', {icon: 2, time: 1000});
                        }
                    }
                });
            });
        })

        //却换服务反馈按钮
        var fuwu = $('.fuwufankuiorder button');
        fuwu.click(function () {
            fuwu.addClass("layui-btn-primary");
            $(this).removeClass("layui-btn-primary");
            var index = fuwu.index(this);
            if (index == 1) {   //备件信息
                $(".beijianxinxi").removeClass("layui-hide");
                $(".fuwufankui").addClass("layui-hide");
                $(".orderRelation").addClass("layui-hide");
                $(".settleMent").addClass("layui-hide");
                $(".serviceComment").addClass("layui-hide");
                orderFitting(orderId);
            } else if (index == 3) {   //回访信息
                $(".beijianxinxi").addClass("layui-hide");
                $(".fuwufankui").addClass("layui-hide");
                $(".orderRelation").removeClass("layui-hide");
                $("#addFitApply").addClass("layui-hide");
                $(".settleMent").addClass("layui-hide");
                $(".serviceComment").addClass("layui-hide");
            } else if(index == 4){   //结算信息
                $(".beijianxinxi").addClass("layui-hide");
                $(".fuwufankui").addClass("layui-hide");
                $(".orderRelation").addClass("layui-hide");
                $(".settleMent").removeClass("layui-hide");
                $(".serviceComment").addClass("layui-hide");
            } else if (index == 0) {   //服务反馈
                $("#addFitApply").addClass("layui-hide");
                $(".fuwufankui").removeClass("layui-hide");
                $(".beijianxinxi").addClass("layui-hide");
                $(".orderRelation").addClass("layui-hide");
                $(".settleMent").addClass("layui-hide");
                $(".serviceComment").addClass("layui-hide");
            } else {
                $(".fuwufankui").addClass("layui-hide");
                $(".serviceComment").removeClass("layui-hide");
                $(".beijianxinxi").addClass("layui-hide");
                $(".orderRelation").addClass("layui-hide");
                $(".settleMent").addClass("layui-hide");
            }
        })

        if ("${type}" == 2) {
            $(".processInformation").removeClass("layui-hide");
            $(".jibenxinxi").addClass("layui-hide");
            $(".logsticInfoNew").addClass("layui-hide");
            guocheng(orderId)
        }



        /* if (${order.status == 1}) {
            orderFitting(orderId);
        }*/
        function guocheng(orderId) {

            $.ajax({
                type: "POST",
                url: "${ctx}/order/getOrderDetail",
                data: {
                    orderId: orderId
                },
                success: function (data) {
                    if (data != null) {
                        var deatil = "";
                        for (var i = 0; i < data.length; i++) {
                            deatil += '<li class="layui-timeline-item"><i class="layui-icon layui-timeline-axis"></i>';
                            deatil += '<div class="layui-timeline-content layui-text">';
                            deatil += ' <h4 class="layui-timeline-title">' + data[i].d + '</h4> <p>';
                            deatil += data[i].c + '  </p> </div> </li>';
                        }
                        $(".guoChen").html(deatil);
                    } else {
                        layer.msg("数据有误！", {icon: 2});
                    }
                }
            });
        }

        //查看物流信息
        $(".productInfo").click(function(){
            var logisticName = $("#logisticName").val();
            var logisticNo = $("#logisticNo").val();
            var orderId = $("#orderId").val();
            addLogisticInfo(logisticName,logisticNo,orderId);
        })


        //查看已发备件信息
        $(".fitRefundInfo").click(function(){
            var logisticName = $("#logisticName").val();
            var logisticNo = $("#logisticNo").val();
            var orderId = $("#orderId").val();
            addLogisticInfo(logisticName,logisticNo,orderId);
        })

        //查看添加备件申请获取的物流信息
        $(".fitApplyInfo").click(function(){
            var logisticName = $(this).attr("data-logName");
            var logisticNo = $(this).attr("data-logNumber");
            var orderId = $("#orderId").val();
            addLogisticInfo(logisticName,logisticNo,orderId);
        })


        //查看新建，旧件返厂物流信息
        $(".returnFactoryInfo").click(function(){
            var logisticName = $(this).attr("data-logName");
            var logisticNo = $(this).attr("data-logNum");
            var orderId = $("#orderId").val();
            $.ajax({
                type:"POST",
                url:"${ctx}/main/order/logisticsDetail",
                data:{
                    orderId:orderId,
                    logisticName:logisticName,
                    logisticNo:logisticNo
                },
                success:function(data){
                    if(data!=null){
                        var deatil ="";
                        for(var i =0;i<data.length;i++){
                            deatil += '<li class="layui-timeline-item">';
                            deatil += '<i class="layui-icon layui-timeline-axis"></i>';
                            deatil += '<div class="layui-timeline-content layui-text">';
                            deatil += '<div class="layui-timeline-title">'+data[i].AcceptTime+" "+data[i].AcceptStation+'</div>';
                            deatil += '</div>';
                            deatil += '</li>';
                        }
                        $(".returnFactory").html(deatil);
                    }else{
                        layer.msg("数据有误！", {icon: 2});
                    }

                }
            })
        })

        function addLogisticInfo(logisticName,logisticNo,orderId){
            $(".logisticInfor").empty()
            $.ajax({
                type:"POST",
                url:"${ctx}/main/order/logisticsDetail",
                data:{
                    orderId:orderId,
                    logisticName:logisticName,
                    logisticNo:logisticNo
                },
                success:function(data){
                    if(data!=null){
                        var deatil ="";
                        for(var i =0;i<data.length;i++){
                            deatil += '<li class="layui-timeline-item">';
                            deatil += '<i class="layui-icon layui-timeline-axis"></i>';
                            deatil += '<div class="layui-timeline-content layui-text">';
                            deatil += '<div class="layui-timeline-title">'+data[i].AcceptTime+" "+data[i].AcceptStation+'</div>';
                            deatil += '</div>';
                            deatil += '</li>';
                        }
                        $(".logisticInfor").html(deatil);
                    }else{
                        layer.msg("数据有误！", {icon: 2});
                    }

                }
            })
        }

        function orderFitting(orderId) {
            loadFitApply(orderId);
        }
    })
        // 验证手机号
        function isPhoneNo(phone) {
            var tel = /(^1\d{10}$)|(^(\d{3,4}\-)?\d{5,9}$)/;
            return tel.test($.trim(phone));
        }



    function loadFitApply(orderId) {
        $(".bodyContent").empty();
        $.ajax({
            type: "POST",
            url: "${ctx}/main/order/getOrderFittingByorderId",
            data: {
                orderId: orderId,
            },
            success: function (data) {
                if (data != null) {
                    var deatil = "";
                    for (var i = 0; i < data.length; i++) {
                        var status = data[i].columns.status;
                        var stname = "";
                        var fittingNumber = "";data[i].columns.fitting_audit_num;
                        if (status == 0) {
                            stname = "待审核";
                            fittingNumber = data[i].columns.fitting_apply_num;
                        }else if (status == 1) {
                            stname = "已完成";
                            fittingNumber = data[i].columns.fitting_audit_num;
                        }
                        var oldStatus="";
                        var oldFittingStauts= data[i].columns.return_fitting;
                        var refund=data[i].columns.refundStatus;
                        if(isBlank(refund)){
                           if(oldFittingStauts == 1){
                               oldStatus="未登记";
                           }else if(oldFittingStauts == 2){
                               oldStatus="已登记";
                           }
                        }else{
                            if(refund == 1){
                                oldStatus="未到厂";
                            }else if(refund == 2){
                                oldStatus="已到厂";
                            }
                        }
                        if(isBlank(fittingNumber)){
                            fittingNumber=data[i].columns.fitting_apply_num;
                        }
                        deatil += ' <tr>';
                        deatil += ' <td style="overflow:hidden;" class="text-over">' +(i+1)+ '</td>';
                        deatil += ' <td style="overflow:hidden;" class="text-over">' + data[i].columns.fitting_code + '</td>';
                        deatil += ' <td style="overflow:hidden;" class="text-over">' + data[i].columns.fitting_name + '</td>';
                        deatil += ' <td style="overflow:hidden;" class="text-over">' + data[i].columns.fitting_version + '</td>';
                        if ('${order.warrantyType}' == '2' && data[i].columns.status == '1') {
                            deatil += ' <td style="overflow:hidden;" class="text-over"> ' + data[i].columns.customer_price + '</td>';
                        }else{
                            deatil += ' <td style="overflow:hidden;" class="text-over">0</td>';
                        }
                        deatil += ' <td style="overflow:hidden;" class="text-over">' + fittingNumber + '</td>';
                        deatil += ' <td style="overflow:hidden;" class="text-over">' + stname + '</td>';
                        deatil += ' <td style="overflow:hidden;" class="text-over" >' + oldStatus + '</td>';
                        deatil += ' </tr>';
                    }
                    $(".bodyContent").html(deatil);
                } else {
                    // layer.msg("数据有误！", {icon: 2});
                }
            }
        });
    }

    //申请备件
    var addFitApplyIndex = '';

    function toAddFitApplyPage(orderId,selectAddress) {
        addFitApplyIndex = layer.open({
            type: 2
            , title: '申请备件'
            , content: '${ctx}/siteFitting/apply/toAddFitApplyPage?orderId=' + orderId+"&selectAddress="+selectAddress
            , area: ['1000px', '430px']
            , yes: function (index, layero) {

            }
        });
    }

    function closeApplyFit() {
        var orderId = $("#orderId").val();//工单id
        loadFitApply(orderId);
        layer.close(addFitApplyIndex);
    }

    function reloadApplyFitPage(selectAddress) {
        var orderId = $("#orderId").val();//工单id
        loadFitApply(orderId);
        layer.close(addFitApplyIndex);
        toAddFitApplyPage(orderId,selectAddress);
    }


    function isBlank(val) {
        if (val == null || val == '' || val == undefined) {
            return true;
        }
        return false;
    }
    function delImg(that){
        imgsCount--;
        if (imgsCount < 4) {
            $("#uploader").removeClass("layui-hide");
        }
        $(that).parent().remove();
    }
</script>
</body>
</html>