<link href="/css/tabs.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/fix_car.css">
<script type="text/javascript" language="javascript" src="/js/artDialog/artDialog.js?skin=default"></script>
<script type="text/javascript" language="javascript" src="/js/artDialog/plugins/iframeTools.source.js"></script>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
    <tr>
        <td colspan="13" height="22" class="td_bg">
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TBODY>
                <TR>
                    <TD height="30" align="center" class=tab-on id=navcell onclick=switchCell(1) name="navcell">
                        维修信息
                    </TD>
                    <?php if(3 != $info->status): ?>
                    <TD height="30" align="center" class=tab-off id=navcell onclick=switchCell(2) name="navcell">
                        保险理赔
                    </TD>
                    <?php endif; ?>
                    <?php if(3 != $info->status): ?>
                    <TD height="30" align="center" class=tab-off id=navcell onclick=switchCell(3) name="navcell">
                        自我维修
                    </TD>
                    <?php endif; ?>
                    <?php if(3 != $info->status): ?>
                    <TD height="30" align="center" class=tab-off id=navcell onclick=switchCell(4) name="navcell">
                        汽车保养
                    </TD>
                    <?php endif; ?>
                    <?php if(3 != $info->status): ?>
                    <TD height="30" align="center" class=tab-off id=navcell onclick=switchCell(5) name="navcell">
                        汽车美容
                    </TD>
                    <?php endif; ?>
                    <TD height="30" align="center" class=tab-off id=navcell onclick=switchCell(<?= 3 == $info->status ? 2 : 6 ?>) name="navcell">
                        操作记录
                    </TD>
                    <TD height="30" class=tab-none>&nbsp;</TD>
                </TR>
                </TBODY>
            </TABLE>
        </td>
    </tr>
    <tr>
        <td height="22" colspan="2" class="td_bg">
            <table width="100%" align="center" height="120" border="0" cellpadding="0" cellspacing="0" id="mainTable">
                <tr>
                    <td height="120" valign="top" class="td_bg">
                        <TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
                            <TR>
                                <TD valign="top">
                                    <form id="theFrm">
                                        <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1"
                                               class="table" style="table-layout: fixed;">
                                            <input type="hidden" id="id" name="id" value="<?= $info->id ?>">
                                            <input type="hidden" name="car_id" value="<?= $info->car_id ?>">
                                            <tr>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 车牌号
                                                </td>
                                                <td height="25" class="td_bg" nowrap>
                                                    <input name="car_no" type="text" id="car_no"
                                                           value="<?= $info->car_no ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">发动机号</td>
                                                <td height="25" class="td_bg">
                                                    <input name="engine_no" type="text" id="engine_no"
                                                           value="<?= $info->engine_no ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">车架号</td>
                                                <td height="25" class="td_bg">
                                                    <input name="car_frame_no" type="text" id="car_frame_no"
                                                           value="<?= $info->car_frame_no ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 事故类型
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <select name="accident_type">
                                                        <option><?= $info->accident_type ?></option>
                                                        <option>单方</option>
                                                        <option>双方</option>
                                                        <option>多方</option>
                                                        <option>自费维修</option>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 被保险人
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <input name="id_man" type="text" id="id_man"
                                                           value="<?= $info->id_man ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 电话
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <input name="id_phone" type="text" id="id_phone"
                                                           value="<?= $info->id_phone ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 联系人
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <input name="link_man" type="text" id="link_man"
                                                           value="<?= $info->link_man ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 电话
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <input name="link_phone" type="text" id="link_phone"
                                                           value="<?= $info->link_phone ?>" style="width:100px;"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 保养时间
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <input name="service_date" type="text" id="service_date"
                                                           style="width:100px;"
                                                           onClick="WdatePicker()" readonly
                                                           value="<?= $info->service_date ?>"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 保险时间
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <input name="insurance_date" type="text" id="insurance_date"
                                                           style="width:100px;"
                                                           onClick="WdatePicker()" readonly
                                                           value="<?= $info->insurance_date ?>"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 驾驶证时间
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <input name="driving_date" type="text" id="driving_date"
                                                           style="width:100px;"
                                                           onClick="WdatePicker()" readonly
                                                           value="<?= $info->driving_date ?>"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">年份</td>
                                                <td height="25" class="td_bg">
                                                    <input type="text" id="car_year" name="car_year"
                                                           onclick="WdatePicker({dateFmt:'yyyy'})" readonly
                                                           value="<?= $info->car_year ?>" style="width:100px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 保险公司
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <input name="company" type="text" id="company"
                                                           value="<?= $info->company ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 接车日期
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <input name="receive_date" type="text" id="receive_date"
                                                           value="<?= $info->receive_date ?>" readonly
                                                           style="width:100px;"
                                                           onClick="WdatePicker()"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 交车方式
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <select name="receive_type" id="receive_type">
                                                        <option><?= $info->receive_type ?></option>
                                                        <option>上门接车</option>
                                                        <option>客户自送</option>
                                                    </select>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 责任
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <select name="responsibility" id="responsibility">
                                                        <option><?= $info->responsibility ?></option>
                                                        <option>全责</option>
                                                        <option>无责</option>
                                                        <option>主要责任</option>
                                                        <option>次要责任</option>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 品牌
                                                </td>
                                                <td height="25" class="td_bg">
                                                    <select id="brand_id" name="brand_id">
                                                        <option value="0">---请选择---</option>
                                                        <?php
                                                        foreach ($brand_items as $item) {
                                                            echo '<option value="' . $item->id . '"';
                                                            if ($info->brand_id == $item->id)
                                                                echo ' selected ';
                                                            echo '>' . $item->name . '</option>';
                                                        }
                                                        ?>
                                                    </select>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span>车系</td>
                                                <td height="25" class="td_bg">
                                                    <select name="series_id" id="series_id">
                                                        <option value="">---请选择---</option>
                                                        <?php
                                                        foreach ($series_items as $item) {
                                                            echo '<option value="' . $item->id . '"';
                                                            if ($info->series_id == $item->id)
                                                                echo ' selected ';
                                                            echo '>' . $item->name . '</option>';
                                                        }
                                                        ?>
                                                    </select>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">排量</td>
                                                <td height="25" class="td_bg">
                                                    <select name="displacement_id" id="displacement_id">
                                                        <option value="0">---请选择---</option>
                                                        <?php
                                                        foreach ($displacement_items as $item) {
                                                            echo '<option value="' . $item->id . '"';
                                                            if ($info->displacement_id == $item->id)
                                                                echo ' selected ';
                                                            echo '>' . $item->name . '</option>';
                                                        }
                                                        ?>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">商业保单号</td>
                                                <td height="25" class="td_bg" nowrap>
                                                    <input name="insurer1_no" type="text" id="insurer1_no"
                                                           value="<?= $info->insurer1_no ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">交强保单号</td>
                                                <td height="25" class="td_bg" nowrap>
                                                    <input name="insurer2_no" type="text" id="insurer2_no"
                                                           value="<?= $info->insurer2_no ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">险项</td>
                                                <td height="25" class="td_bg" nowrap>
                                                    <input name="insurer_type" type="text" id="insurer_type" value=""
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">新车购置价</td>
                                                <td height="25" class="td_bg">
                                                    <input name="new_price" type="text" id="new_price"
                                                           value="<?= $info->new_price ?>"
                                                           style="width:100px;"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">方位</td>
                                                <td height="25" class="td_bg">
                                                    <select name="direction_id" id="direction_id">
                                                        <option value="0">请选择</option>
                                                        <?php
                                                        foreach ($direction_items as $item) {
                                                            echo '<option value="' . $item->id . '"';
                                                            if ($info->direction_id == $item->id)
                                                                echo ' selected ';
                                                            echo '>' . $item->name . '</option>';
                                                        }
                                                        ?>
                                                    </select>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">范围</td>
                                                <td height="25" class="td_bg">
                                                    <select name="range_id" id="range_id">
                                                        <option value="0">请选择</option>
                                                        <?php
                                                        foreach ($range_items as $item) {
                                                            echo '<option value="' . $item->id . '"';
                                                            if ($info->range_id == $item->id)
                                                                echo ' selected ';
                                                            echo '>' . $item->name . '</option>';
                                                        }
                                                        ?>
                                                    </select>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"><span
                                                            style="color:#ff0000">*</span> 地址
                                                </td>
                                                <td colspan="3" height="25" class="td_bg">
                                                    <input name="address" type="text" id="address"
                                                           value="<?= $info->address ?>"
                                                           style="width:80%;"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">代步车</td>
                                                <td height="25" class="td_bg">
                                                    <select name="replace_car_id" id="replace_car_id">
                                                        <option value="0">无代步车</option>
                                                    </select>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">接车司机</td>
                                                <td height="25" class="td_bg">
                                                    <select name="driver_id">
                                                        <option value="0">请选择</option>
                                                        <?php
                                                        foreach ($driver_items as $item) {
                                                            echo '<option value="' . $item->id . '"';
                                                            if ($item->id == $info->driver_id)
                                                                echo ' selected ';
                                                            echo '>' . $item->getShowName() . '</option>';
                                                        }
                                                        ?>
                                                    </select>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"></td>
                                                <td height="25" class="td_bg"></td>
                                                <td width="100" height="25" class="bg_tr"></td>
                                                <td height="25" class="td_bg"></td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">接车里程数</td>
                                                <td height="25" class="td_bg">
                                                    <input name="receive_mileage" type="text" id="receive_mileage"
                                                           value="<?= $info->receive_mileage ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">接车油表数</td>
                                                <td height="25" class="td_bg">
                                                    <input name="receive_oil" type="text" id="receive_oil"
                                                           value="<?= $info->receive_oil ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"></td>
                                                <td height="25" class="td_bg"></td>
                                                <td width="100" height="25" class="bg_tr"></td>
                                                <td height="25" class="td_bg"></td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">进厂里程数</td>
                                                <td height="25" class="td_bg">
                                                    <input name="factory_mileage" type="text" id="factory_mileage"
                                                           value="<?= $info->factory_mileage ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">进厂油表数</td>
                                                <td height="25" class="td_bg">
                                                    <input name="factory_oil" type="text" id="factory_oil"
                                                           value="<?= $info->factory_oil ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">预计出厂时间</td>
                                                <td height="25" class="td_bg">
                                                    <input name="finish_date" type="text" id="finish_date"
                                                           value="<?= $info->finish_date ?>" style="width:100px;"
                                                           readonly
                                                           onClick="WdatePicker()"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"></td>
                                                <td height="25" class="td_bg"></td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">报案号</td>
                                                <td height="25" class="td_bg">
                                                    <input name="report_no" type="text" id="report_no"
                                                           value="<?= $info->report_no ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">报案人</td>
                                                <td height="25" class="td_bg">
                                                    <input name="baoan_man" type="text" id="baoan_man"
                                                           value="<?= $info->baoan_man ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">报案时间</td>
                                                <td height="25" class="td_bg">
                                                    <input name="baoan_time" type="text" id="baoan_time"
                                                           value="<?= $info->baoan_time ?>" style="width:100px;"
                                                           readonly
                                                           onclick="WdatePicker()"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">出险时间</td>
                                                <td height="25" class="td_bg">
                                                    <input name="chuxian_time" type="text" id="chuxian_time"
                                                           value="<?= $info->chuxian_time ?>" style="width:100px;"
                                                           readonly
                                                           onclick="WdatePicker()"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">出险地点</td>
                                                <td colspan="3" height="25" class="td_bg">
                                                    <input name="baoan_address" type="text" id="baoan_address"
                                                           value="<?= $info->baoan_address ?>" style="width:400px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">事故描述</td>
                                                <td colspan="3" height="25" class="td_bg">
                                                    <input name="shigu_info" type="text" id="shigu_info"
                                                           value="<?= $info->shigu_info ?>" style="width:400px;"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">理赔公司</td>
                                                <td height="25" class="td_bg">
                                                    <input name="lipei_company" type="text" id="lipei_company"
                                                           value="<?= $info->lipei_company ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">主车定损金额</td>
                                                <td height="25" class="td_bg">
                                                    <input name="zhuche_money" type="text" id="zhuche_money"
                                                           value="<?= $info->zhuche_money ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">三者外修</td>
                                                <td height="25" class="td_bg">
                                                    <input name="sanzhe_money" type="text" id="sanzhe_money"
                                                           value="<?= $info->sanzhe_money ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">物损</td>
                                                <td height="25" class="td_bg">
                                                    <input name="wusun_money" type="text" id="wusun_money"
                                                           value="<?= $info->wusun_money ?>" style="width:100px;"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">拖车</td>
                                                <td height="25" class="td_bg">
                                                    <input name="tuoche" type="text" id="tuoche"
                                                           value="<?= $info->tuoche ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">拖车费用</td>
                                                <td height="25" class="td_bg">
                                                    <input name="tuoche_money" type="text" id="tuoche_money"
                                                           value="<?= $info->tuoche_money ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">定损工时费</td>
                                                <td height="25" class="td_bg">
                                                    <input name="dingsun_hour_money" type="text" id="dingsun_hour_money"
                                                           value="<?= $info->dingsun_hour_money ?>"
                                                           style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">定损换件费</td>
                                                <td height="25" class="td_bg">
                                                    <input name="dingsun_huanjian_money" type="text"
                                                           id="dingsun_huanjian_money"
                                                           value="<?= $info->dingsun_huanjian_money ?>"
                                                           style="width:100px;"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">赔付比例</td>
                                                <td height="25" class="td_bg">
                                                    <input name="peifu_bili" type="text" id="peifu_bili"
                                                           value="<?= $info->peifu_bili ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">赔付金额</td>
                                                <td height="25" class="td_bg">
                                                    <input name="peifu_money" type="text" id="peifu_money"
                                                           value="<?= $info->peifu_money ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr">客户自付</td>
                                                <td height="25" class="td_bg">
                                                    <input name="kehu_money" type="text" id="kehu_money"
                                                           value="<?= $info->kehu_money ?>" style="width:100px;"/>
                                                </td>
                                                <td width="100" height="25" class="bg_tr"></td>
                                                <td height="25" class="td_bg"></td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="25" class="bg_tr">备注</td>
                                                <td colspan="7" height="25" class="td_bg" align="left">
                                    <textarea name="remark" id="remark"
                                              style="width: 600px;"><?= $info->remark ?></textarea>
                                                </td>
                                            </tr>
                                        </table>
                                        <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1"
                                               class="table"
                                               style="table-layout: fixed;">
                                            <tr>
                                                <td rowspan="2" class="bg_tr" align="center" valign="center">
                                                    交接物品
                                                </td>
                                                <td width="50" align="center" class="bg_tr" nowrap>行驶本</td>
                                                <td class="td_bg">
                                                    <input type="radio" name="driving_this"
                                                           value="1" <?= $info->driving_this == 1 ? 'checked' : '' ?>>
                                                    原件
                                                    <input type="radio" name="driving_this"
                                                           value="2" <?= $info->driving_this == 2 ? 'checked' : '' ?>>
                                                    复印件
                                                </td>
                                                <td width="200" align="center" class="bg_tr" nowrap>驾驶本</td>
                                                <td class="td_bg">
                                                    <input type="radio" name="driver_licesne"
                                                           value="1" <?= $info->driver_licesne == 1 ? 'checked' : '' ?>>
                                                    原件
                                                    <input type="radio" name="driver_licesne"
                                                           value="2" <?= $info->driver_licesne == 2 ? 'checked' : '' ?>>
                                                    复印件
                                                </td>
                                                <td width="80" align="center" class="bg_tr" nowrap>身份证</td>
                                                <td class="td_bg">
                                                    <input type="radio" name="identity_card_paper"
                                                           value="1" <?= $info->identity_card_paper == 1 ? 'checked' : '' ?>>
                                                    原件
                                                    <input type="radio" name="identity_card_paper"
                                                           value="2" <?= $info->identity_card_paper == 2 ? 'checked' : '' ?>>
                                                    复印件
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="50" align="center" class="bg_tr" nowrap>车钥匙</td>
                                                <td class="td_bg">
                                                    <input type="radio" name="car_key"
                                                           value="1" <?= $info->car_key == 1 ? 'checked' : '' ?>> 一副
                                                    <input type="radio" name="car_key"
                                                           value="2" <?= $info->car_key == 2 ? 'checked' : '' ?>> 二副
                                                </td>
                                                <td width="200" align="center" class="bg_tr" nowrap>保险单</td>
                                                <td class="td_bg">
                                                    <input type="radio" name="policy_of_insurance"
                                                           value="1" <?= $info->policy_of_insurance == 1 ? 'checked' : '' ?>>
                                                    原件
                                                    <input type="radio" name="policy_of_insurance"
                                                           value="2" <?= $info->policy_of_insurance == 2 ? 'checked' : '' ?>>
                                                    复印件
                                                </td>
                                                <td width="80" align="center" class="bg_tr" nowrap>交警证明</td>
                                                <td class="td_bg">
                                                    <input type="radio" name="police_to_prove"
                                                           value="1" <?= $info->police_to_prove == 1 ? 'checked' : '' ?>>
                                                    原件
                                                    <input type="radio" name="police_to_prove"
                                                           value="2" <?= $info->police_to_prove == 2 ? 'checked' : '' ?>>
                                                    复印件
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="bg_tr" align="center" valign="center">随车物品</td>
                                                <td class="td_bg" colspan="6">
                                                    <input type="checkbox" name="follow_car_items[]"
                                                           value="1" <?= strpos($info->follow_car_items, '1') !== false ? 'checked' : '' ?>>
                                                    备胎
                                                    <input type="checkbox" name="follow_car_items[]"
                                                           value="2" <?= strpos($info->follow_car_items, '2') !== false ? 'checked' : '' ?>>
                                                    工具
                                                    <input type="checkbox" name="follow_car_items[]"
                                                           value="3" <?= strpos($info->follow_car_items, '3') !== false ? 'checked' : '' ?>>
                                                    警告牌
                                                    <input type="checkbox" name="follow_car_items[]"
                                                           value="4" <?= strpos($info->follow_car_items, '4') !== false ? 'checked' : '' ?>>
                                                    灭火器
                                                </td>
                                            </tr>
                                        </table>
                                        <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1"
                                               class="table"
                                               style="table-layout: fixed;">
                                            <tr>
                                                <td class="td_bg">
                                                    <input type="file" id="fileUploadBtn" value="上传图片"><span
                                                            style="color:#ff0000">1M/每张 | 最多上传6张</span>
                                                    <input type="button" id="fileDownBtn" value="下载图片"
                                                           onclick="downloadImg()"><span
                                                            style="color:#ff0000">请先选择需要下载的图片</span>
                                                </td>
                                            </tr>

                                            <tr id="showImg"
                                                style="display: <?= $info->fixCarImg ? 'block' : 'none' ?>">
                                                <td class="td_bg">
                                                    <textarea name="result" id="result" cols="30" rows="10"
                                                              style="display:none"></textarea>
                                                    <ul id="img-area">
                                                        <?php if ($fixCarImg = $info->fixCarImg): ?>
                                                            <?php foreach ($fixCarImg as $img): ?>
                                                                <li>
                                                                    <i data-fix-img="<?= $img->id ?>"
                                                                       onclick="rmImg(event,$(this))">删除</i>
                                                                    <img src="\<?= $img->name ?>" alt="">
                                                                </li>
                                                            <?php endforeach; ?>
                                                        <?php endif; ?>
                                                    </ul>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="22" align="center" class="td_bg">
                                                    <input type=button class="ACT_btn js-insert-btn" name=Submit1
                                                           value=" 提交 "/>
                                                    <input id="save-btn" type=button class="ACT_btn" name=Submit1
                                                           value=" 保存 "/>
                                                    <input type=button class="ACT_btn js-back-btn" name=Submit1
                                                           value=" 返回 "/>
                                                </td>
                                            </tr>
                                        </table>
                                    </form>
                                </TD>
                            </TR>
                        </TABLE>
                        <?php if(3 != $info->status): ?>
                        <TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
                            <TR>
                                <TD class="td_bg" align="left">
                                    <input type="button" class="ACT_btn" VALUE="添加"
                                           onclick="dialogBox('保险理赔',1,<?= $info->id ?>)">
                                </TD>
                            </TR>
                            <TR>
                                <TD id="list3">
                                </TD>
                            </TR>
                        </TABLE>
                        <?php endif; ?>
                        <?php if(3 != $info->status): ?>
                        <TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
                            <TR>
                                <TD class="td_bg" align="left">
                                    <input type="button" class="ACT_btn" VALUE="添加"
                                           onclick="dialogBox('自费维修',2,<?= $info->id ?>)">
                                </TD>
                            </TR>
                            <TR>
                                <TD id="list4">
                                </TD>
                            </TR>
                        </TABLE>
                        <?php endif; ?>
                        <?php if(3 != $info->status): ?>
                        <TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
                            <TR>
                                <TD id="list5">
                                </TD>
                            </TR>
                        </TABLE>
                        <?php endif; ?>
                        <?php if(3 != $info->status): ?>
                        <TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
                            <TR>
                                <TD id="list6">
                                </TD>
                            </TR>
                        </TABLE>
                        <?php endif; ?>
                        <TABLE id=tb cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
                            <TR>
                                <TD>
                                    <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1"
                                           class="table" style="table-layout: fixed;">
                                        <tr>
                                            <td width="10%" align="center" class="bg_tr" nowrap>姓名</td>
                                            <td width="10%" align="center" class="bg_tr" nowrap>操作时间</td>
                                            <td width="60%" align="center" class="bg_tr" nowrap>意见</td>
                                            <td width="20%" align="center" class="bg_tr" nowrap>意见说明</td>
                                        </tr>
                                        <?php
                                        foreach ($log_items as $item) {
                                            ?>
                                            <tr>
                                                <td align="center" class="td_bg" nowrap><?= $item->op_man ?></td>
                                                <td class="td_bg"
                                                    style="word-break: break-all"><?= date('Y-m-d H:i:s', $item->op_time) ?></td>
                                                <td class="td_bg" nowrap><?= $item->info ?></td>
                                                <td class="td_bg"
                                                    style="word-break: break-all"><?= $item->remark ?></td>
                                            </tr>
                                            <?php
                                        }
                                        ?>
                                        <tr>
                                            <td height="22" align="center" class="td_bg" colspan="4">
                                                <input type=button class="ACT_btn js-back-btn" name=Submit1
                                                       value=" 返回 "/>
                                            </td>
                                        </tr>
                                    </table>
                                </TD>
                            </TR>
                        </TABLE>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<!--对话框begin-->
<div id="dialog" style="display: none">
</div>
<!--end-->
<!--遮罩层 begin-->
<div class="mask-layer" style="display: none">
</div>
<script type="text/javascript" language="javascript" src="/js/artDialog/artDialog.js?skin=default"></script>
<script type="text/javascript" language="javascript" src="/js/artDialog/plugins/iframeTools.source.js"></script>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
    reloadItems();
    function reloadItems() {
        var id = $('#id').val();
        if(id > 0) {
            gotoPage('/fix-car/ajax-item-list?fix_id=' + id + '&pay_type=1','list3');
            gotoPage('/fix-car/ajax-item-list?fix_id=' + id + '&pay_type=2','list4');
            gotoPage('/fix-car/ajax-item-list?fix_id=' + id + '&small_type_id=5','list5');
            gotoPage('/fix-car/ajax-item-list?fix_id=' + id + '&small_type_id=6','list6');
        }
    }
    function show(id_str) {
        var obj = $('#' + id_str);
        var obj_title = $('#' + id_str + '_title');
        obj.toggle();
        if (obj_title.html() == '▼')
            obj_title.html('▲');
        else
            obj_title.html('▼');
    }

    //退回处理
    $('.js-return-btn').click(function () {
        var r = prompt('退回原因', '');
        if (r != null && r != '') {
            $.post('/business-order/return-op', {
                id:<?=$info->id > 0 ? $info->id : 0?>,
                return_remark: r,
                return_status_id:<?=$info->status?>
            }, function (obj) {
                alert(obj.msg);
                if (obj.success) {
                    $('#back-btn').click();
                }
            }, 'json');
        } else {
            alert('不填写原因,无法退回');
        }
    });

    //提交按钮
    $(".js-insert-btn").click(function () {
        if (confirm('是否确认提交?')) {
            var params = $("#theFrm").serialize();
            params = params + '&status=<?= $info->status + 1 ?>';
            $.post('/business-order/all-save', params, function (obj) {
                alert(obj.msg);
                if (obj.success) {
                    $('#id').val(obj.fix_id);
                    window.location.href = '/business-order/front-desk-list';
//                    window.history.back();
                }
            }, 'json');
        }
    });
    //维修信息保存
    $("#save-btn").click(function(){
        if(confirm('是否确认提交?')) {
            var params = $("#theFrm").serialize();
            params = params + '&status=<?=$info->status?>';
            $.post('/business-order/all-save',params,function(obj){
                alert(obj.msg);
                if(obj.success) {
                    $('#id').val(obj.fix_id);
                    window.location.reload();
                }
            },'json');
        }
    });
    //返回按钮
    $('.js-back-btn').click(function () {
        window.history.back();
    });

    $('#brand_id').change(function () {
        var brand_id = $(this).val();
        $('#series_id').html('<option value="0">---请选择---</option>');
        $('#displacement_id').html('<option value="0">---请选择---</option>');
        if (brand_id > 0) {
            $.get('/car/series', {brand_id: brand_id}, function (obj) {
                if (obj.success) {
                    $('#series_id').html(obj.html);
                }
            }, 'json');
        }
    });
    $('#series_id').change(function () {
        var series_id = $(this).val();
        $('#displacement_id').html('<option value="0">---请选择---</option>');
        if (series_id > 0) {
            $.get('/car/displacement', {series_id: series_id}, function (obj) {
                if (obj.success) {
                    $('#displacement_id').html(obj.html);
                }
            }, 'json');
        }
    });
    //图片点击加边框
    $('#img-area > li').on('click', function () {
        $(this).addClass('active-border');
        $(this).siblings().removeClass('active-border');
    });
    //base64图片上传
    var result = img_area = null,
        input = document.getElementById("fileUploadBtn"),
        result = document.getElementById("result"),
        img_area = document.getElementById("img-area");
    if (typeof(FileReader) === 'undefined') {
        alert("抱歉，你的浏览器不支持 FileReader，请使用现代浏览器操作！");
        input.setAttribute('disabled', 'disabled');
    } else {
        input.addEventListener('change', readFile, false);
    }

    function readFile() {
        var liLen = img_area.getElementsByTagName('li').length;
        if (liLen >= 6) {
            alert("最多上传6张图片");
            return false;
        }

        var file = this.files[0];
        //这里我们判断下类型如果不是图片就返回 去掉就可以上传任意文件
        if (!/image\/\w+/.test(file.type)) {
            alert("请确保文件为图像类型");
            return false;
        }
        var reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = function (e) {
            result.innerHTML += '#@#' + this.result;
            img_area.innerHTML += '<li><i onclick="rmImg(event,$(this))">删除</i><img src="' + this.result + '" alt=""/></li>';
            $('#showImg').show();
        }
    }

    //图片删除
    function rmImg(event, obj) {
        event.stopPropagation();
        var id = obj.data('fix-img');
        if (id > 0) {
            $.post('/fix-car/rm-img', 'id=' + id, function (msg) {
                if (msg.success) {
                    obj.parent().remove();
                }
            }, 'json');
        } else {
            obj.parent().remove();
        }
    }

    //下载图片
    function downloadImg() {
        var isChoice = false,
            id = 0;

        $('#img-area > li ').each(function (i) {
            if ($(this).hasClass('active-border')) {
                isChoice = true;
                id = $(this).find('i').data('fix-img')
            }
        })
        if (!isChoice) {
            alert('请先选择要下载的图片!');
            return false;
        }

        if (id == 0) {
            alert('下载失败！');
            return false;
        }
        window.location.href = "/fix-car/download-img?id=" + id;
    }

    //弹框
    function dialogBox(title,type,fix_id){
        art.dialog.open('/business-order/dialog-box?fix_id='+fix_id+'&type='+type,{width:520,title:title,lock:true,opacity:0.5},true);

    }
//    function dialogBox(title, type, fix_id,obj) {
//        var dialog = '<form id="dialog-from"><table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">' +
//            '<input type="hidden" name="fix_id" value="' + fix_id + '">' +
//            '<input type="hidden" name="list_type" value="' + type + '">' +
//            '<input type="hidden" name="big_type_id" value="' + type + '">' +
//            '<tr><th colspan="4" id="dialog-title">' + title + '</th></tr>' +
//            '<tr class="bg_tr"><td colspan="4"><select name="small_type_id">';
//        if (1 == type || 2 == type) {
//            dialog += '<option value="1">更换清单</option>' +
//                '<option value="2">维修清单</option>' +
//                '<option value="3">辅料清单</option>' +
//                '<option value="4">待定清单</option>' +
//                '<option value="5">汽车保养</option>' +
//                '<option value="6">美容装饰</option>';
//        } else if (3 == type || 4 == type) {
//            dialog += '<option value="1">更换清单</option>' +
//                '<option value="2">维修清单</option>' +
//                '<option value="3">辅料清单</option>' +
//                '<option value="4">待定清单</option>';
//        }
//
//        dialog += '</select></td></tr>' +
//            '        <tr>' +
//            '            <td class="bg_tr">项目名称</td>' +
//            '            <td class="td_bg"><input type="text" name="name" class="js-name"></td>' +
//            '            <td class="bg_tr">数量</td>' +
//            '            <td class="td_bg"><input name="count" type="text"></td>' +
//            '        </tr>' +
//            '        <tr>' +
//            '            <td class="bg_tr">保险定价</td>' +
//            '            <td class="td_bg"><input name="insurance_price" type="text"></td>' +
//            '            <td class="bg_tr">自费单价</td>' +
//            '            <td class="td_bg"><input name="price" type="text"></td>' +
//            '</select></td>' +
//            '        </tr>' +
//            '        <tr>' +
//            '            <td class="bg_tr">类型</td>' +
//            '            <td class="td_bg"><select name="type" onchange="typeChange($(this))">' +
//            '<option value="">--请选择--</option>' +
//            '<option value="68">机修</option>' +
//            '<option value="69">美容</option>' +
//            '<option value="70">喷漆</option>' +
//            '</select></td>' +
//            '            <td class="bg_tr">维修人</td>' +
//            '            <td class="td_bg"><select name="fix_user" id="fix-user">' +
//            '<option value="">--请选择--</option>' +
//            '</select></td>' +
//            '        </tr>' +
//            '<tr>' +
//            '            <td class="bg_tr">结算方式</td>' +
//            '            <td class="td_bg"><select name="pay_type" id="">';
//        if (1 == type) {
//            dialog += '<option value="1">保险理赔</option>';
//        } else if (2 == type) {
//            dialog += '<option value="2">自费维修</option>';
//        }
//        dialog += '</select>' +
//            '</tr>' +
//            '        <tr>' +
//            '            <td class="bg_tr">备注</td>' +
//            '            <td class="td_bg" colspan="3"><textarea name="fix_remark" id="" cols="40" rows="2"></textarea></td>' +
//            '        </tr>' +
//            '        <tr>' +
//            '            <td colspan="4" align="center" class="td_bg"><input type="button" class="act_btn" value="提交" onclick="detailedListAdd()"></td>' +
//            '        </tr>' +
//            '    </table></form>';
//        $('#dialog').html($(dialog));
//        $('#dialog').show();
//        $('.js-name').focus();
//        maskOpen();
//    }

    function maskOpen() {
        $('.mask-layer').show();
        $(document.body).css({
            "overflow-x": "hidden",
            "overflow-y": "hidden"
        });
    }
</script>
