审查视图

public/themes/simpleboot3/portal/order_salesman/get_all.html 41.5 KB
1 2 3
<!DOCTYPE html>
<html lang="en">
王晓刚 authored
4 5 6 7 8 9 10 11 12
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <title>学考无忧-订单管理</title>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.min.css"/>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.picker.min.css"/>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css"/>
王晓刚 authored
13 14 15 16 17 18 19 20 21 22
    <style>
        .tx_masktwo {
            display: none;
            z-index: 2;
            width: 100%;
            height: 100%;
            position: fixed;
            background-color: rgba(0, 0, 0, 0.5);
        }
    </style>
王晓刚 authored
23
</head>
24
王晓刚 authored
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
<body>
<div class="tx_mask_school">
    <div class="tx_maskCon_school">
        <div class="three_model_school">
            <div class="three_model_school_title">
                选择学校-班级
            </div>
            <div class="three_model_school_tab">
                <div class="three_model_school_left three_model_school_hover word">
                    学校
                </div>
                <div class="three_model_school_left">
                    班级
                </div>
            </div>
            <div>
                <div class="three_model_school_data there_university" style="display: block;">
                    <foreach name="$school" item="s">
                        <div class="three_model_school_name <if condition='$key eq 0'>there_unActive</if> school"
                             data-id="{$s.id}">{$s.school}
                        </div>
                    </foreach>
                </div>
                <div class="three_model_school_data there_class grade">
49
王晓刚 authored
50 51 52 53 54
                </div>
            </div>
        </div>
    </div>
</div>
王晓刚 authored
55 56 57 58 59
<!--统一配送-->
<div class="tx_mask_tongyi">
    <div class="tx_maskCon_tongyi">
        <div class="three_model_school">
            <div class="three_model_school_data" style="display: block;">
60
                <div class="three_model_school_name there_unActive" data-id="1">统一配送</div>
王晓刚 authored
61 62
                <div class="three_model_school_name" data-id="2">快递配送</div>
            </div>
王晓刚 authored
63
        </div>
王晓刚 authored
64 65 66 67 68 69 70 71 72 73 74
    </div>
</div>
<!--选择快递-->
<div class="tx_mask_kuaidi">
    <div class="tx_maskCon_school">
        <div class="three_model_school">
            <div class="three_model_school_title">
                选择快递
            </div>
            <div>
                <div class="three_model_school_data" style="display: block;">
75 76
                    <div class="three_model_school_name" data-name="SF">顺丰快递</div>
                    <div class="three_model_school_name" data-name="YTO">圆通快递</div>
王晓刚 authored
77
                    <div class="three_model_school_name" data-name="ZTO">中通快递</div>
78 79 80 81 82 83 84 85 86
                    <div class="three_model_school_name there_unActive" data-name="STO">申通快递</div>
                    <div class="three_model_school_name" data-name="YD">韵达快递</div>
                    <div class="three_model_school_name" data-name="HHTT">天天快递</div>
                    <div class="three_model_school_name" data-name="HTKY">百世快递</div>
                    <div class="three_model_school_name" data-name="YZPY">邮政快递包裹</div>
                    <div class="three_model_school_name" data-name="EMS">EMS</div>
                    <div class="three_model_school_name" data-name="DBL">德邦快递</div>
                    <div class="three_model_school_name" data-name="ZJS">宅急送</div>
                    <div class="three_model_school_name" data-name="TNT">TNT快递</div>
王晓刚 authored
87 88 89 90 91
                </div>
            </div>
        </div>
    </div>
</div>
王晓刚 authored
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
<div class="tx_masktwo" style="display: none;">
    <div class="tx_maskCon">
        <div class="tx_maskConImg">
            <img src="__TMPL__/public/assets/images/91.png" alt=""/>
        </div>
        <div class="tx_maskCon2">
            <div class="log_three_model">
                <div class="log_three_model_one time">
                    <div class="log_three_model_left">配送时间</div>
                    <div class="log_psong">
                        <input type="text" id="start_time2" value="" placeholder="请输入开始配送时间"/>
                    </div>
                </div>
                <div class="log_three_model_one time">
                    <div class="log_three_model_left">配送时间</div>
                    <div class="log_psong">
                        <input type="text" id="end_time2" value="" placeholder="请输入结束配送时间"/>
                    </div>
                </div>
            </div>
            <!-- 确定 -->
            <div class="tx_maskOk confirm2" data-is_courier="" data-id="" data-indent-id="">确定</div>
        </div>
    </div>
</div>
王晓刚 authored
117 118 119 120 121 122 123
<div class="tx_maskone">
    <div class="tx_maskCon">
        <div class="tx_maskConImg">
            <img src="__TMPL__/public/assets/images/91.png" alt=""/>
        </div>
        <div class="tx_maskCon2">
            <div class="log_three_model">
王晓刚 authored
124
                <div class="log_three_model_one time">
王晓刚 authored
125 126
                    <div class="log_three_model_left">配送时间</div>
                    <div class="log_psong">
王晓刚 authored
127
                        <input type="text" id="start_time" value="" placeholder="请输入开始配送时间"/>
王晓刚 authored
128 129
                    </div>
                </div>
王晓刚 authored
130
                <div class="log_three_model_one time">
王晓刚 authored
131 132
                    <div class="log_three_model_left">配送时间</div>
                    <div class="log_psong">
王晓刚 authored
133 134 135 136
                        <input type="text" id="end_time" value="" placeholder="请输入结束配送时间"/>
                    </div>
                </div>
                <!--<div class="log_three_model_one logistic" style="padding-bottom: 0;">-->
王晓刚 authored
137 138 139 140
                <!--<div class="log_three_model_left" style="margin-top: -0.3rem;">快递公司</div>-->
                <!--<div class="log_three_model_right">-->
                <!--<input type="text" id="logistic_name" placeholder="请输入快递公司"/>-->
                <!--</div>-->
王晓刚 authored
141
                <!--</div>-->
142
                <div class="log_three_model_one logistic">
王晓刚 authored
143 144 145 146
                    <div class="log_three_model_left">选择快递</div>
                    <div class="log_psong log_psong_select">
                        <div class="log_ps_title">请选择</div>
                        <div class="log_ps_img">
王晓刚 authored
147
                            <img src="__TMPL__/public/assets/images/29.png"/>
148
                            <input type="hidden" id="logistic_name" placeholder="请选择快递公司"/>
王晓刚 authored
149 150 151 152 153 154 155
                        </div>
                    </div>
                </div>
                <div class="log_three_model_one logistic" style="padding-bottom: 0;">
                    <div class="log_three_model_left" style="margin-top: -0.3rem;">快递单号</div>
                    <div class="log_three_model_right">
                        <input type="text" id="logistic_code" placeholder="请输入快递单号"/>
王晓刚 authored
156 157 158 159
                    </div>
                </div>
            </div>
            <!-- 确定 -->
王晓刚 authored
160
            <div class="tx_maskOk confirm" data-is_courier="" data-id="" data-indent-id="">确定</div>
王晓刚 authored
161 162 163 164 165 166 167 168 169 170 171 172 173 174
        </div>
    </div>
</div>
<div class="log_top_co">
    <!-- 顶部 -->
    <div class=" order_top log_top_co">
        <a href="">
            <img src="__TMPL__/public/assets/images/left.png" alt=""/>
        </a>
        <p>订单管理</p>
    </div>
</div>
<!-- tab切换 -->
<div class="log_three_tab log_three_tab_top">
王晓刚 authored
175 176 177
    <div class="log_three_tab_one log_three_tab_two word_color aaa" data-state="2">未发货</div>
    <div class="log_three_tab_one" data-state="5">已发货</div>
    <div class="log_three_tab_one" data-state="3">已完成</div>
王晓刚 authored
178 179 180 181 182 183 184 185 186 187 188
</div>
<!-- 下拉框  -->
<div class="log_three_select">
    <div class="log_three_select_one log_three_select_school">
        <div class="log_three_select_title log_three_select_school2">
            请选择学校/班级
        </div>
        <div class="log_three_select_img">
            <img src="__TMPL__/public/assets/images/75.png" alt=""/>
        </div>
    </div>
王晓刚 authored
189 190
    <div class="log_three_select_one log_three_select_peisong log_three_select_tongyi">
        <div class="log_three_select_title log_three_select_contant">
191
            统一配送
王晓刚 authored
192 193 194 195 196 197 198 199 200 201
        </div>
        <div class="log_three_select_img">
            <img src="__TMPL__/public/assets/images/75.png" alt=""/>
        </div>
    </div>
    <div class="log_three_select_one log_three_select_btn search">
        搜索
    </div>
    <input type="hidden" id="school" value=""/>
    <input type="hidden" id="grade" value=""/>
202
    <input type="hidden" id="is_courier" value="1"/>
王晓刚 authored
203 204 205 206 207 208 209
</div>
<!-- 列表内容 -->
<div>
    <!--未发货-->
    <div class="log_three_list_contant" style="display: block;">
        <foreach name="$data" item="vo">
            <if condition="$vo.state eq 2">
210
                <div class="log_three_list order_{$vo.id}">
王晓刚 authored
211 212
                    <div class="log_three_list_top">
                        <div class="log_three_list_top_left">
213 214
                            <if condition="$vo.is_courier eq 1">
                                <div class="log_three_list_top_lo">
王晓刚 authored
215 216
                                    <img src="__TMPL__/public/assets/images/fangkuang.png"
                                         data-indent-id="{$vo['id']}" alt=""/>
217 218
                                </div>
                            </if>
王晓刚 authored
219 220 221 222 223
                            <div class="log_three_list_top_lt">
                                <div class="log_three_zhongbiao">
                                    <img src="__TMPL__/public/assets/images/52.png" alt=""/>
                                </div>
                                <div class="log_three_shijian">
王晓刚 authored
224
                                    {$vo['pay_time']}
王晓刚 authored
225 226 227 228 229 230 231 232 233 234 235 236 237
                                </div>
                            </div>
                        </div>
                        <div class="log_three_list_top_right">
                            <if condition="$vo.state eq 2">
                                待发货
                                <elseif condition="$vo.state eq 5"/>
                                已发货
                                <elseif condition="$vo.state eq 3"/>
                                已完成
                            </if>
                        </div>
                    </div>
王晓刚 authored
238 239
                    <a href="{:url('get_one',array('id'=>$vo['id']))}">
                        <foreach name="$vo.indent_goods" item="i_g">
王晓刚 authored
240 241 242
                            <div class="log_three_list_center" style="display: flex;justify-content: flex-start;">
                                <div class="log_three_list_center_left" style="width: 1.44rem;hieght:1.44rem">
                                    <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" style="width: 100%;height: 100%;"/>
王晓刚 authored
243
                                </div>
王晓刚 authored
244
                                <div class="log_three_list_center_right" style="margin-left: 0.16rem;">
王晓刚 authored
245 246 247 248 249
                                    <div class="log_three_center_one">
                                        {$i_g.book_name}
                                    </div>
                                    <div class="log_three_center_two">×{$i_g.number}</div>
                                    <div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
王晓刚 authored
250 251
                                </div>
                            </div>
王晓刚 authored
252 253
                        </foreach>
                    </a>
王晓刚 authored
254 255 256
                    <!-- 立即发货 -->
                    <div class="log_three_bottom_btn">
                        <if condition="$vo.state eq 2">
王晓刚 authored
257 258
                            <div class="log_three_bottom send" data-indent-id="{$vo.id}"
                                 data-is_courier="{$vo.is_courier}">
王晓刚 authored
259 260 261 262
                                立即发货
                            </div>
                            <elseif condition="$vo.state eq 5"/>
                            <if condition="$vo.is_courier eq 2">
王晓刚 authored
263
                                <a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
王晓刚 authored
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
                                    <div class="log_three_bottom" data-indent-id="{$vo.id}">
                                        查看物流
                                    </div>
                                </a>
                            </if>
                            <elseif condition="$vo.state eq 3"/>
                            <div class="log_three_bottom" data-indent-id="{$vo.id}">
                                已完成啦
                            </div>
                        </if>
                    </div>
                </div>
            </if>
        </foreach>
    </div>
    <!--已发货-->
    <div class="log_three_list_contant">
        <foreach name="$data" item="vo">
            <if condition="$vo.state eq 5">
283
                <div class="log_three_list order_{$vo.id}">
王晓刚 authored
284 285
                    <div class="log_three_list_top">
                        <div class="log_three_list_top_left">
286 287
                            <if condition="$vo.is_courier eq 1">
                                <div class="log_three_list_top_lo">
王晓刚 authored
288 289
                                    <img src="__TMPL__/public/assets/images/fangkuang.png"
                                         data-indent-id="{$vo['id']}" alt=""/>
290 291
                                </div>
                            </if>
王晓刚 authored
292 293 294 295 296
                            <div class="log_three_list_top_lt">
                                <div class="log_three_zhongbiao">
                                    <img src="__TMPL__/public/assets/images/52.png" alt=""/>
                                </div>
                                <div class="log_three_shijian">
297
                                    {$vo['pay_time']}
王晓刚 authored
298 299 300 301 302 303 304 305 306 307 308 309 310
                                </div>
                            </div>
                        </div>
                        <div class="log_three_list_top_right">
                            <if condition="$vo.state eq 2">
                                代发货
                                <elseif condition="$vo.state eq 5"/>
                                已发货
                                <elseif condition="$vo.state eq 3"/>
                                已完成
                            </if>
                        </div>
                    </div>
王晓刚 authored
311 312
                    <a href="{:url('get_one',array('id'=>$vo['id']))}">
                        <foreach name="$vo.indent_goods" item="i_g">
王晓刚 authored
313 314 315
                            <div class="log_three_list_center" style="display: flex;justify-content: flex-start;">
                                <div class="log_three_list_center_left"  style="width: 1.44rem;hieght:1.44rem">
                                    <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" style="width: 100%;height: 100%;"/>
王晓刚 authored
316
                                </div>
王晓刚 authored
317
                                <div class="log_three_list_center_right" style="margin-left: 0.16rem;">
王晓刚 authored
318 319 320 321 322
                                    <div class="log_three_center_one">
                                        {$i_g.book_name}
                                    </div>
                                    <div class="log_three_center_two">×{$i_g.number}</div>
                                    <div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
王晓刚 authored
323 324
                                </div>
                            </div>
王晓刚 authored
325 326
                        </foreach>
                    </a>
王晓刚 authored
327 328 329 330 331 332 333 334
                    <!-- 立即发货 -->
                    <div class="log_three_bottom_btn">
                        <if condition="$vo.state eq 2">
                            <div class="log_three_bottom" data-indent-id="{$vo.id}" data-is_courier="{$vo.is_courier}">
                                立即发货
                            </div>
                            <elseif condition="$vo.state eq 5"/>
                            <if condition="$vo.is_courier eq 2">
王晓刚 authored
335 336 337 338 339
                                <a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
                                    <div class="log_three_bottom" data-indent-id="{$vo.id}">
                                        查看物流
                                    </div>
                                </a>
王晓刚 authored
340 341 342 343 344 345 346 347
                            </if>
                            <elseif condition="$vo.state eq 3"/>
                            <div class="log_three_bottom" data-indent-id="{$vo.id}">
                                已完成啦
                            </div>
                        </if>
                    </div>
                </div>
王晓刚 authored
348
                </a>
王晓刚 authored
349 350 351 352 353 354 355
            </if>
        </foreach>
    </div>
    <!--已完成-->
    <div class="log_three_list_contant">
        <foreach name="$data" item="vo">
            <if condition="$vo.state eq 3">
356
                <div class="log_three_list order_{$vo.id}">
王晓刚 authored
357 358
                    <div class="log_three_list_top">
                        <div class="log_three_list_top_left">
359 360
                            <if condition="$vo.is_courier eq 1">
                                <div class="log_three_list_top_lo">
王晓刚 authored
361 362
                                    <img src="__TMPL__/public/assets/images/fangkuang.png"
                                         data-indent-id="{$vo['id']}" alt=""/>
363 364
                                </div>
                            </if>
王晓刚 authored
365 366 367 368 369
                            <div class="log_three_list_top_lt">
                                <div class="log_three_zhongbiao">
                                    <img src="__TMPL__/public/assets/images/52.png" alt=""/>
                                </div>
                                <div class="log_three_shijian">
370
                                    {$vo['pay_time']}
王晓刚 authored
371 372 373 374 375 376 377 378 379 380 381 382 383
                                </div>
                            </div>
                        </div>
                        <div class="log_three_list_top_right">
                            <if condition="$vo.state eq 2">
                                代发货
                                <elseif condition="$vo.state eq 5"/>
                                已发货
                                <elseif condition="$vo.state eq 3"/>
                                已完成
                            </if>
                        </div>
                    </div>
王晓刚 authored
384 385
                    <a href="{:url('get_one',array('id'=>$vo['id']))}">
                        <foreach name="$vo.indent_goods" item="i_g">
王晓刚 authored
386 387 388
                            <div class="log_three_list_center" style="display: flex;justify-content: flex-start;">
                                <div class="log_three_list_center_left" style="width: 1.44rem;hieght:1.44rem">
                                    <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" style="width: 100%;height: 100%;"/>
王晓刚 authored
389
                                </div>
王晓刚 authored
390
                                <div class="log_three_list_center_right" style="margin-left: 0.16rem;">
王晓刚 authored
391 392 393 394 395
                                    <div class="log_three_center_one">
                                        {$i_g.book_name}
                                    </div>
                                    <div class="log_three_center_two">×{$i_g.number}</div>
                                    <div class="log_three_center_three"><span></span>{$i_g.price*$i_g.number}</div>
王晓刚 authored
396 397
                                </div>
                            </div>
王晓刚 authored
398 399
                        </foreach>
                    </a>
王晓刚 authored
400 401 402 403 404 405 406 407
                    <!-- 立即发货 -->
                    <div class="log_three_bottom_btn">
                        <if condition="$vo.state eq 2">
                            <div class="log_three_bottom" data-indent-id="{$vo.id}" data-is_courier="{$vo.is_courier}">
                                立即发货
                            </div>
                            <elseif condition="$vo.state eq 5"/>
                            <if condition="$vo.is_courier eq 2">
王晓刚 authored
408 409 410 411 412
                                <a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
                                    <div class="log_three_bottom" data-indent-id="{$vo.id}">
                                        查看物流
                                    </div>
                                </a>
王晓刚 authored
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
                            </if>
                            <elseif condition="$vo.state eq 3"/>
                            <div class="log_three_bottom" data-indent-id="{$vo.id}">
                                已完成啦
                            </div>
                        </if>
                    </div>
                </div>
            </if>
        </foreach>
    </div>
</div>
<!-- 底部按钮 -->
<div class="log_three_list_fixed">
    <div class="log_three_fixed_left">
        <div class="log_three_fixed_left_one">
            <img src="__TMPL__/public/assets/images/fangkuang.png" alt=""/>
        </div>
        <div class="log_three_fixed_left_two">
            全选
        </div>
    </div>
王晓刚 authored
435
    <div class="log_three_fixed_right unify_all">
王晓刚 authored
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
        统一发货
    </div>
</div>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/mui.min.js"></script>
<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
<script>
    // 选择学校
    $(".three_model_school_left").click(function () {
        var indexs = $(this).index();
        console.log(indexs);
        $(".three_model_school_data").eq(indexs).css("display", "block").siblings().css("display", "none");
    });
451
王晓刚 authored
452 453 454 455
    $(".log_three_tab_one").click(function () {
        var tabIndex = $(this).index();
        $(this).addClass("log_three_tab_two").addClass("word_color").addClass('aaa').siblings().removeClass("log_three_tab_two").removeClass("word_color").removeClass("aaa");
        $('.log_three_list_contant').eq(tabIndex).css('display', 'block').siblings().css('display', 'none');
王晓刚 authored
456
        search();
王晓刚 authored
457 458 459 460
    });
    $(".three_model_school_tab>div").click(function () {
        $(this).addClass("three_model_school_hover").addClass("word_color").addClass('aaa').siblings().removeClass("three_model_school_hover").removeClass("word_color").removeClass("aaa");
    });
461
王晓刚 authored
462
    $("body").on('click', '.log_three_list_top_lo', function () {
463
        console.log($(this).find("img").attr("src"));
王晓刚 authored
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
        if ($(this).find("img").attr("src") == "__TMPL__/public/assets/images/fangkuang.png") {
            $(this).find("img").attr("src", "__TMPL__/public/assets/images/xuanzhong (1).png");
        } else {
            $(this).find("img").attr("src", "__TMPL__/public/assets/images/fangkuang.png");
        }
    });
    $(".log_three_fixed_left_one").click(function () {
        if (
            $(this)
                .find("img")
                .attr("src") == "__TMPL__/public/assets/images/fangkuang.png"
        ) {
            $(this)
                .find("img")
                .attr("src", "__TMPL__/public/assets/images/xuanzhong (1).png");
            $(".log_three_list_top_lo")
                .find("img")
                .attr("src", "__TMPL__/public/assets/images/xuanzhong (1).png");
        } else {
            $(this)
                .find("img")
                .attr("src", "__TMPL__/public/assets/images/fangkuang.png");
            $(".log_three_list_top_lo")
                .find("img")
                .attr("src", "__TMPL__/public/assets/images/fangkuang.png");
        }
    });
491
王晓刚 authored
492 493 494 495 496
    $(".log_three_select_peisong").click(function () {
        $(".tx_mask").css({
            display: "block"
        });
    });
王晓刚 authored
497 498

    //统一配送
王晓刚 authored
499
    $(".log_three_select_tongyi").click(function () {
王晓刚 authored
500 501 502 503
        $(".tx_mask_tongyi").css({
            display: "block"
        });
    })
王晓刚 authored
504
    $(".tx_mask_tongyi .three_model_school_name").click(function () {
王晓刚 authored
505 506 507 508 509 510 511 512
        var index = $(this).index();
        $(this).addClass('there_unActive').siblings().removeClass('there_unActive');
        $('.log_three_select_contant').text($(this).text()).css("color", "#333");
        console.log($('.log_three_select_contant').text($(this).text()))
        $(".tx_mask_tongyi").hide();
        $("#is_courier").val($(this).attr('data-id'))
    })
    //选择快递方式
王晓刚 authored
513
    $(".log_psong_select").click(function () {
王晓刚 authored
514 515 516 517 518
        console.log(213)
        $(".tx_mask_kuaidi").css({
            display: "block"
        });
    });
王晓刚 authored
519
    $(".tx_mask_kuaidi .three_model_school_name").click(function () {
王晓刚 authored
520
        var index = $(this).index();
521
        $(this).addClass('there_unActive').siblings().removeClass('there_unActive');
王晓刚 authored
522 523
        $('.log_ps_title').text($(this).text()).css("color", "#333");
        $(".tx_mask_kuaidi").hide();
524
        $('#logistic_name').val($(this).attr('data-name'))
王晓刚 authored
525
    });
王晓刚 authored
526
    var index = $(".log_three_bottom").index();
王晓刚 authored
527
    $("body").on('click', '.log_three_bottom', function () {
王晓刚 authored
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
        console.log(index);
        $(".tx_maskone").css({
            display: "block"
        });
    });

    //学校/弹窗
    $(".log_three_select_school").click(function () {
        $(".tx_mask_school").css({
            display: "block"
        });
    });
    // tab 大学
    var $xuexiao
    $(".there_university div").click(function () {
        var index = $(this).index();
        $(this).addClass("there_unActive").siblings().removeClass("there_unActive");
        if ($(this).hasClass("there_unActive")) {
            $xuexiao = $(this).text();
            console.log($xuexiao);
            $(".there_university").hide();
            $(".there_class").show();
            $('.three_model_school_left').eq(0).removeClass('word_color').removeClass('three_model_school_hover');
            $('.three_model_school_left').eq(1).addClass('word_color').addClass('three_model_school_hover');
        }
    });
    $('body').on('click', ".there_class div", function () {
        console.log($xuexiao)
        var index2 = $(this).index();
        $(this).addClass("there_unActive").siblings().removeClass("there_unActive");
        if ($xuexiao == undefined) {
            alert('请选择学校')
        } else if ($(this).hasClass("there_unActive")) {
            var banji = $(this).text();
            $('.log_three_select_school2').text($xuexiao + ' ' + "—" + ' ' + banji);
            $(".log_three_select_school2").css("color", "#333")
            $(".tx_mask_school").hide();
            $('#school').val($xuexiao);
            $('#grade').val(banji);
        }
    })
    // 关闭弹窗
    $(document).mouseup(function (e) {
        var _con = $('.tx_maskCon_school');
        if (!_con.is(e.target) && _con.has(e.target).length === 0) {
            $('.tx_mask_school').hide()
        }
王晓刚 authored
575
    });
王晓刚 authored
576 577

    function search() {
王晓刚 authored
578 579 580
        var school = $('#school').val();
        var grade = $('#grade').val();
        var state = $('.log_three_tab_top .aaa').attr('data-state');
581
        var is_courier = $('#is_courier').val();
王晓刚 authored
582 583 584 585 586 587
        console.log(state);
        // if (school == '') {
        //     alert('请选择学校')
        // } else if (grade == '') {
        //     alert('请选择班级')
        // } else {
王晓刚 authored
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
        console.log(school);
        console.log(grade);
        $.ajax({
            'url': "{:url('order_salesman/getOrderSalesman')}",
            'type': "GET",
            'data': {'school': school, 'grade': grade, 'state': state, 'is_courier': is_courier},
            'success': (function (data) {
                var index = $('.log_three_tab_top div').index($('.aaa'));
                if (data.code == 1) {
                    var result = data.data;
                    console.log(result)
                    var html = '';
                    for (var i = 0; i < result.length; i++) {
                        if (result[i]['state'] == 2) {
                            var state = '待发货';
                            if (result[i]['is_courier'] == 1) {
                                var html_bottom = "<div class=\"log_three_bottom_btn\"><div class=\"log_three_bottom send\" data-indent-id=\"" + result[i].id + "\" data-is_courier=\"" + result[i].is_courier + "\">\n" +
                                    "\t\t\t\t\t\t\t\t\t\t立即发货\n" +
                                    "\t\t\t\t\t\t\t\t\t</div></div>";
王晓刚 authored
607
                            } else {
王晓刚 authored
608 609 610
                                var html_bottom = "<div class=\"log_three_bottom_btn\"><div class=\"log_three_bottom send\" data-indent-id=\"" + result[i].id + "\" data-is_courier=\"" + result[i].is_courier + "\">\n" +
                                    "\t\t\t\t\t\t\t\t\t\t立即发货\n" +
                                    "\t\t\t\t\t\t\t\t\t</div></div>";
王晓刚 authored
611
                            }
王晓刚 authored
612 613 614 615 616 617 618 619 620 621
                        } else if (result[i]['state'] == 5) {
                            var state = '已发货';
                            if (result[i]['is_courier'] == 2) {
                                var html_bottom = "<a href=\"{:url('logistics/index','',false,true)}/indent_id/" + result[i].id + "\">\n" +
                                    "\t\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_bottom_btn\"><div class=\"log_three_bottom\" data-indent-id=\"" + result[i].id + "\">\n" +
                                    "\t\t\t\t\t\t\t\t\t\t\t\t查看物流\n" +
                                    "\t\t\t\t\t\t\t\t\t\t\t</div></div>\n" +
                                    "\t\t\t\t\t\t\t\t\t\t</a>";
                            } else {
                                var html_bottom = "";
622
                            }
王晓刚 authored
623 624 625 626 627 628 629 630 631 632 633
                        } else {
                            var state = '已完成';
                            var html_bottom = "<div class=\"log_three_bottom\" data-indent-id=\"\"+result[i].id+\"\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t已完成啦\n" +
                                "\t\t\t\t\t\t\t\t\t</div>";
                        }
                        var indent_goods_data = result[i].indent_goods;
                        var indent_goods_html = '';
                        for (var i3 = 0; i3 < indent_goods_data.length; i3++) {
                            indent_goods_html += "<div class=\"log_three_list_center\">\n" +
                                "                            <div class=\"log_three_list_center_left\">\n" +
王晓刚 authored
634
                                "                                <img src=\"{:cmf_get_image_url('')}" + indent_goods_data[i3].thumbnail + "\" alt=\"\"/>\n" +
王晓刚 authored
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686
                                "                            </div>\n" +
                                "                            <div class=\"log_three_list_center_right\">\n" +
                                "                                <div class=\"log_three_center_one\">\n" +
                                "                                    " + indent_goods_data[i3].book_name + "\n" +
                                "                                </div>\n" +
                                "                                <div class=\"log_three_center_two\">×" + indent_goods_data[i3].number + "</div>\n" +
                                "                                <div class=\"log_three_center_three\"><span>¥</span>" + indent_goods_data[i3].price * indent_goods_data[i3].number + "</div>\n" +
                                "                            </div>\n" +
                                "                        </div>";
                        }
                        if (is_courier == 1) {
                            html += "<div class=\"log_three_list order_" + result[i].id + "\">\n" +
                                "\t\t\t\t\t\t\t<div class=\"log_three_list_top\">\n" +
                                "\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_left\">\n" +
                                "\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lo\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/fangkuang.png\" alt=\"\" />\n" +
                                "\t\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lt\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_zhongbiao\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/52.png\" alt=\"\" />\n" +
                                "\t\t\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_shijian\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t\t" + result[i].pay_time + "\n" +
                                "\t\t\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_right\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t" + state + "\n" +
                                "\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t</div><a href=\"{:url('get_one','',false,true)}/id/"+result[i].id+"\">\n" + indent_goods_html +"</a>"+
                                "\t\t\t\t\t\t" + html_bottom + "</div>";
                        } else if (is_courier == 2) {
                            html += "<div class=\"log_three_list order_" + result[i].id + "\">\n" +
                                "\t\t\t\t\t\t\t<div class=\"log_three_list_top\">\n" +
                                "\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_left\">\n" +
                                // "\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lo\">\n" +
                                // "\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/fangkuang.png\" alt=\"\" />\n" +
                                // "\t\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_lt\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_zhongbiao\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t\t<img src=\"__TMPL__/public/assets/images/52.png\" alt=\"\" />\n" +
                                "\t\t\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t\t\t<div class=\"log_three_shijian\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t\t" + result[i].pay_time + "\n" +
                                "\t\t\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t\t<div class=\"log_three_list_top_right\">\n" +
                                "\t\t\t\t\t\t\t\t\t\t" + state + "\n" +
                                "\t\t\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t\t</div><a href=\"{:url('get_one','',false,true)}/id/"+result[i].id+"\">\n" + indent_goods_html +"</a>"+
                                "\t\t\t\t\t\t" + html_bottom + "</div>";
王晓刚 authored
687 688
                        }
                    }
王晓刚 authored
689
王晓刚 authored
690 691 692 693 694 695 696 697
                    $('.log_three_list_contant').eq(index).html(html);
                    update();
                } else {
                    alert('未知错误');
                }
            }),
            'error': (function () {
                alert('与服务器断开连接');
王晓刚 authored
698
            })
王晓刚 authored
699
        })
王晓刚 authored
700 701
        // }
    }
王晓刚 authored
702
王晓刚 authored
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731
    $(function () {
        $('.school').click(function () {
            var school_id = $(this).attr('data-id');
            $.ajax({
                url: "{:url('order_salesman/getGradeClass')}",
                type: 'GET',
                data: {'school_id': school_id},
                success: (function (data) {
                    if (data.code == 1) {
                        var result = data.data;
                        var html = '';
                        for (var i = 0; i < result.length; i++) {
                            var i2 = Number(result[i].start);
                            var j = Number(result[i].end);
                            for (i2; i2 <= j; i2++) {
                                // if(i == 0){
                                //     html += "<div class=\"three_model_school_name there_unActive\" data-id=\""+result[i].id+"\">"+result[i].grade+"—"+i2+"</div>";
                                // }
                                html += "<div class=\"three_model_school_name\" data-id=\"" + result[i].id + "\">" + result[i].grade + "—" + i2 + "班</div>";
                            }
                        }
                        $('.grade').html(html);
                    } else {
                        alert(data.msg);
                    }
                })
            })
        })
        $('.search').click(function () {
王晓刚 authored
732 733 734
            search()
        });
        //发货
王晓刚 authored
735
        $("body").on('click', '.send', function () {
王晓刚 authored
736 737
            var indent_id = $(this).attr('data-indent-id');
            var is_courier = $(this).attr('data-is_courier');
王晓刚 authored
738
            if (is_courier == 1) {
王晓刚 authored
739 740 741
                //统一配送
                $('.time').show();
                $('.logistic').hide();
王晓刚 authored
742
            } else if (is_courier == 2) {
王晓刚 authored
743 744 745
                //快递
                $('.time').hide();
                $('.logistic').show();
王晓刚 authored
746
            }
王晓刚 authored
747 748 749
            $('.confirm').attr('data-is_courier', is_courier);
            $('.confirm').attr('data-indent-id', indent_id);
            $('.confirm').attr('data-is_courier', is_courier);
王晓刚 authored
750
        })
王晓刚 authored
751
        //点击确认
王晓刚 authored
752
        $("body").on('click', '.confirm', function () {
王晓刚 authored
753 754 755 756 757 758
            var is_courier = $(this).attr('data-is_courier');
            var start_time = $('#start_time').val();
            var end_time = $('#end_time').val();
            var logistic_name = $('#logistic_name').val();
            var logistic_code = $('#logistic_code').val();
            var indent_id = $(this).attr('data-indent-id');
王晓刚 authored
759 760 761
            if (is_courier == 1) {
                if (start_time == '') {
                    alert('请填写配送时间');
762
                    return false;
王晓刚 authored
763 764
                } else if (end_time == '') {
                    alert('请填写配送时间');
765
                    return false;
王晓刚 authored
766
                }
王晓刚 authored
767 768 769
            } else if (is_courier == 2) {
                if (logistic_name == '') {
                    alert('请填写快递公司');
770
                    return false;
王晓刚 authored
771 772
                } else if (logistic_code == '') {
                    alert('请填写快递单号');
773
                    return false;
王晓刚 authored
774
                }
王晓刚 authored
775 776
            } else if (is_courier == '') {
                alert('未知错误');
777
                return false;
王晓刚 authored
778 779
            }
            $.ajax({
王晓刚 authored
780 781 782 783 784 785 786 787 788 789 790
                url: "{:url('order_salesman/send')}",
                type: "GET",
                data: {
                    'start_time': start_time,
                    'end_time': end_time,
                    'logistic_name': logistic_name,
                    'logistic_code': logistic_code,
                    'is_courier': is_courier,
                    'indent_id': indent_id
                },
                success: function (res) {
王晓刚 authored
791
                    console.log(res);
王晓刚 authored
792 793
                    if (res.code == 1) {
                        $('.order_' + indent_id).remove();
794 795 796 797 798 799 800
                        $(".tx_maskone").css({
                            display: "none"
                        });
                        $(".tx_mask").css({
                            display: "none"
                        });
                    }
王晓刚 authored
801 802
                    alert(res.msg)
                },
王晓刚 authored
803
                error: function (res) {
王晓刚 authored
804 805 806 807
                    alert('与服务器断开连接')
                }
            })
        });
王晓刚 authored
808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847
        $('body').on('click', '.unify_all', function () {
            var length = $('.log_three_list_top_lo img').length - 1;
            var arr = [];
            for (var i = 0; i <= length; i++) {
                if ($('.log_three_list_top_lo img').attr('src') == "__TMPL__/public/assets/images/xuanzhong (1).png") {
                    arr.push($('.log_three_list_top_lo img').eq(i).attr('data-indent-id'));
                }
            }
            $('.confirm2').attr('data-indent-id', arr.join(","));
            if (arr.length != 0) {
                $('.tx_masktwo').show();
            } else {
                alert('请至少选择一个订单');
            }
        });
        $('.confirm2').click(function () {
            var start_time2 = $('#start_time2').val();
            var end_time2 = $('#end_time2').val();
            var indent_ids = $(this).attr('data-indent-id');
            if (indent_ids == '') {
                alert('请至少选择一个订单');
            } else if (start_time2 == '') {
                alert('请选择配送时间')
            } else if (end_time2 == '') {
                alert('请选择配送时间')
            } else {
                $.ajax({
                    url: "{:url('order_salesman/send_all')}",
                    type: "GET",
                    data: {'start_time2': start_time2, 'end_time2': end_time2, 'indent_ids': indent_ids},
                    success: function (res) {
                        if (res.code == 1) {
                            alert('发货成功')
                        } else {
                            alert(res.msg);
                        }
                    }
                })
            }
        });
848 849
        update();
王晓刚 authored
850
    })
王晓刚 authored
851 852

    function update() {
853
        var is_courier = $('#is_courier').val();
王晓刚 authored
854
        var index = $('.log_three_tab_top div').index($('.aaa'));
855
        console.log(is_courier);
王晓刚 authored
856
        if (is_courier == 1 && index == 0) {
857
            $('.log_three_list_fixed').show();
王晓刚 authored
858
        } else if (is_courier == 2 || index != 0) {
859 860 861
            $('.log_three_list_fixed').hide();
        }
    }
王晓刚 authored
862 863
</script>
</body>
864 865

</html>