allparkrecords.js 66.8 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 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 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 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 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 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 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 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 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 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 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570
/**
 * Created by chenbiao on 2017/8/23.
 */

window.downloadFile = function (sUrl) {

    //iOS devices do not support downloading. We have to inform user about this.
    if (/(iP)/g.test(navigator.userAgent)) {
        alert('Your device does not support files downloading. Please try again in desktop browser.');
        return false;
    }

    //If in Chrome or Safari - download via virtual link click
    if (window.downloadFile.isChrome || window.downloadFile.isSafari) {
        //Creating new link node.
        var link = document.createElement('a');
        link.href = sUrl;

        if (link.download !== undefined) {
            //Set HTML5 download attribute. This will prevent file from opening if supported.
            var fileName = sUrl.substring(sUrl.lastIndexOf('/') + 1, sUrl.length);
            link.download = fileName;
        }

        //Dispatching click event.
        if (document.createEvent) {
            var e = document.createEvent('MouseEvents');
            e.initEvent('click', true, true);
            link.dispatchEvent(e);
            return true;
        }
    }

    // Force file download (whether supported by server).
    if (sUrl.indexOf('?') === -1) {
        sUrl += '?download';
    }

    window.open(sUrl, '_self');
    return true;
}

window.downloadFile.isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
window.downloadFile.isSafari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
/** 时间初始化 **/
//进场时间初始化
$('#allparkrecord-daterange-btnsta').val(moment().subtract('months', 3).format('YYYY-MM-DD'));
$('#allparkrecord-daterange-btnend').val(moment().subtract('months', 0).format('YYYY-MM-DD'));
//开始日期
$("#allparkrecord-daterange-btnsta").datetimepicker({
    endDate: moment().subtract('days', 0).format('YYYY-MM-DD'),
    format: 'yyyy-mm-dd',
    autoclose: true,
    startView: 2,
    //maxDate:moment().subtract('months', 3),
    minView: 2,
    forceParse: false,
    clearBtn: true, //添加清除按钮,可选值:true/false
    locale: "zh-CN",
    language: 'zh-CN',
    pickerPosition: "bottom-right"
})
//结束日期
$("#allparkrecord-daterange-btnend").datetimepicker({
    endDate: moment().subtract('days', 0).format('YYYY-MM-DD'),
    //startDate:startVal,
    format: 'yyyy-mm-dd',
    weekStart: 1,
    autoclose: true,
    clearBtn: true, //添加清除按钮,可选值:true/false
    startView: 2,
    minView: 2,
    forceParse: false,
    locale: "zh-CN",
    language: 'zh-CN',
    pickerPosition: "bottom-right"
})

//出场时间初始化
//开始日期
$("#allparkrecord-daterange-timeoutsta").datetimepicker({
    endDate: moment().subtract('days', 0).format('YYYY-MM-DD'),
    format: 'yyyy-mm-dd',
    autoclose: true,
    startView: 2,
    clearBtn: true, //添加清除按钮,可选值:true/false
    //maxDate:moment().subtract('months', 3),
    minView: 2,
    forceParse: false,
    locale: "zh-CN",
    language: 'zh-CN',
    pickerPosition: "bottom-right"
})
//结束日期
$("#allparkrecord-daterange-timeoutend").datetimepicker({
    endDate: moment().subtract('days', 0).format('YYYY-MM-DD'),
    //startDate:startVal,
    format: 'yyyy-mm-dd',
    weekStart: 1,
    autoclose: true,
    clearBtn: true, //添加清除按钮,可选值:true/false
    startView: 2,
    minView: 2,
    forceParse: false,
    locale: "zh-CN",
    language: 'zh-CN',
    pickerPosition: "bottom-right"
})

//var parkTypeSelected = {0:"短时停车免费",1:"待核算",2:"待支付",3:"待支付",4:"已完成",5:"逃逸",7:"授权车免费",8:"手动免费开闸",12:"预付费"};
//201:临停车,301:包年车辆,302:包月车辆,303:包季度车辆,304:半年卡车辆,305:包天车辆,501:白名单车辆',
var parkTypeSelected = {100: "短时停车免费", 200: "临停车", 300: "授权车免费", 400: "手动出场", 500: "白名单车辆免费"};
(function () {
    var cacheParkData;

    var fun = {
        init: function () {
            if("10133" != fn.getUserId() && "10134" != fn.getUserId() && "10135" != fn.getUserId()){
                $('#allparkrecord-toptab').append(
                    '<div class="ITD-graynav-topbar" data-parkstate="error">欠费</div>'+
                    '<div class="ITD-graynav-topbar" data-parkstate="back">补缴</div>'
                );
            }
            commSelect.area_Pl_LinkedSelect("#parkArea", "#parkIds", null, "", 3);

            //初始化停车场下拉框
            //fun.initPark();
            //初始化停车状态下拉框
            fn.getParkStatus(fun.initParkStatus);
            //初始化停车类型下拉框
            fn.getParkOrderType(fun.initParkType);
            //初始化停车场类型下拉框
            //fn.getParkLotType(fun.initParkLotType);
            //初始化支付类型下拉框
            //fn.getPayType(fun.initPayType);
            fun.createTableData();
//          $("#parkLotType").change(function(){
//              fun.initPark();
//          });
        },
        //生成表格数据
        createTableData: function () {
            $('#recordtable').bootstrapTable('destroy').bootstrapTable({
                striped: true,//表格显示条纹
                pagination: true, //启动分页
                pageNumber: 1, //当前第几页
                pageSize: 10,  //每页显示的记录数
                pageList: [10, 15, 20],  //记录数可选列表
                sidePagination: 'server',//表示服务端分页
                queryParamsType: 'limit',
                method: 'POST',//请求方法
                paginationPreText: '<',
                paginationNextText: '>',
                // fixedColumns:true,
                // fixedNumber:1,
                // leftFixedColumns: true,
                // leftFixedNumber: 1,
                ajax: tableLoadRequest,//自定义ajax加载数据
                // uniqueId:'id',
                columns: [
                    {
                        field: 'orderId',
                        title: '订单编号',
                        width: '10%',
                        align: "left",
                        visible: false,
                    },
                    {
                        field: 'carNumber',
                        title: '<span class="information-icon"></span>车辆信息',
                        width: '10%',
                        align: "left",
                        formatter: function (value, row, index) {
                            var berthNos = row.berthNo;
                            if (berthNos == '' || berthNos == undefined || berthNos == null) {
                                // berthNos='';
                                return '<div class="ITD-common-fontsize16 ITD-common-color000 ITD-cursor-pointer" data-toggle="tooltip" title="'+value+'">' + commonClass.cutString(value, 8) + '</div>' +
                                    '<div class="ITD-common-fontsize12 ITD-common-color60 ITD-cursor-pointer" >泊位编号: --</div>' +
                                    '<div class="ITD-common-fontsize12 ITD-common-color60 ITD-hidden-nowrap" style="padding: 3px 0;" title="' + row.parkName + '">' + row.parkName + '</div>'
                            } else {
                                return '<div class="ITD-common-fontsize16 ITD-common-color000 ITD-cursor-pointer" >' + value + '</div>' +
                                    '<div class="ITD-common-fontsize12 ITD-common-color60 ITD-cursor-pointer" >泊位编号:' + berthNos + '</div>' +
                                    '<div class="ITD-common-fontsize12 ITD-common-color60 ITD-hidden-nowrap" style="padding: 3px 0;" title="' + row.parkName + '">' + row.parkName + '</div>'
                            }

                        }

                    },
                    // {field: 'parkName', title: '停车场名称', width: '10%', align:"left"},


                    {
                        field: 'orderType',
                        title: '<span class="type-icon"></span>类型',
                        width: '8%',
                        align: "left",
                        formatter: fun.isFixCarFormatter
                    },
                    {
                        field: 'orderTotalFees',
                        title: '<span class="money-icon"></span>停车费(元)',
                        width: '15%',
                        align: "left",
                        formatter: function (value, row, index) {
                        /*    return '<div class="ITD-common-color ITD-cursor-pointer records_popMsg" data-id="' + row.orderId + '"><div class="ITD-common-fontsize16 display-inlineblock ITD-vertical-align-middle ITD-hidden-nowrap" style="width:75px;" title="' + commonObj.moneyFormatter(row.orderActFees) + '">' + commonObj.moneyFormatter(row.orderActFees) + '  元</div>' +
                                        '<div class="ITD-common-fontsize12 ITD-hidden-nowrap ITD-common-color60 display-inlineblock ITD-vertical-align-middle">' +
                                        '<div>应收&nbsp;:&nbsp; ' + commonObj.moneyFormatter(row.orderTotalFees) + '元</div>' +
                                        '<div>优惠&nbsp;:&nbsp; ' + commonObj.moneyFormatter(row.orderDicountFee) + '元</div>' +
                                        '</div>' +
                                     '</div>'*/
                            return '<div class="ITD-common-color ITD-cursor-pointer records_popMsg" style="padding-top: 18px" data-id="' + row.orderId + '">' +
                                            '<div class="ITD-common-fontsize16 ITD-hidden-nowrap" title="' + commonObj.moneyFormatter(row.orderTotalFees ) + '">应收:' + commonObj.moneyFormatter(row.orderTotalFees ) + '</div>' +
                                            '<div class="ITD-common-fontsize16 ITD-hidden-nowrap"  title="' + commonObj.moneyFormatter(row.orderActFees) + '">实收:' + commonObj.moneyFormatter(row.orderActFees) + '</div>' +
                                    '</div>'
                        }
                    },
                    {
                        field: 'parkInTime',
                        title: '<span class="time-icon"></span>停车时间',
                        width: '24%',
                        align: "left",
                        formatter: function (value, row, index) {
                            return '<div class="ITD-common-fontsize16 ITD-common-color000  display-inlineblock ITD-vertical-align-middle  ITD-hidden-nowrap" style="width: 110px;" title="' + fun.parkingDurationFormatter(row.parkingDuration, row) + '">' + fun.parkingDurationFormatter(row.parkingDuration, row) + '</div>' +
                                '<div class="ITD-cursor-pointer ITD-common-fontsize12 ITD-common-color ITD-hidden-nowrap allparkrecords-in-out display-inlineblock ITD-vertical-align-middle" data-terminalSource="' + row.terminalSource + '" data-order="' + row.orderId + '" style="padding: 3px 0;" title="入场&nbsp;:&nbsp; ' + fun.inDatatimeFormatter(row.parkInTime) + '&nbsp;&nbsp;&nbsp;出场&nbsp;:&nbsp; ' + fun.inDatatimeFormatter(row.parkOutTime) + '">' +
                                '<div>入场&nbsp;:&nbsp; ' + commonObj.timeFormatter(row.parkInTime) + '</div>' +
                                '<div>出场&nbsp;:&nbsp; ' + commonObj.timeFormatter(row.parkOutTime) + '</div>' +
                                '</div>'
                        }
                    },
                    {
                        field: 'parkOutTime',
                        title: '<span class="person-icon"></span>出入口信息',
                        width: '15%',
                        align: "left",
                        formatter: function (value, row, index) {
                            return '<div class="ITD-common-fontsize16 ITD-common-color000 display-inlineblock ITD-vertical-align-middle  ITD-hidden-nowrap" style="width: 73px;" title="' + fun.chargerFormatter(value, row, index) + '">' + fun.chargerFormatter(value, row, index) + '</div>' +
                                '<div class="ITD-common-fontsize12 ITD-common-color60 ITD-hidden-nowrap display-inlineblock ITD-vertical-align-middle" style="padding: 3px 0;" title="入口&nbsp;:&nbsp; ' + fun.inCodeFormatter(value, row, index) + '&nbsp;&nbsp;&nbsp;出口&nbsp;:&nbsp; ' + fun.outCodeFormatter(value, row, index) + '">' +
                                '<div>入口&nbsp;:&nbsp; ' + fun.inCodeFormatter(value, row, index) + '</div>' +
                                '<div>出口&nbsp;:&nbsp; ' + fun.outCodeFormatter(value, row, index) + '</div>' +
                                '</div>'
                        }
                    },
                    {
                        /**
                         * 根据订单状态来判断是否已经出场
                         */
                        field: 'orderState',
                        title: '<span class="state-icon"></span>状态',
                        width: '9%',
                        align: "left",
                        formatter: fun.inOutStateFormatter
                    },


                    // {
                    //     field: 'parkingDuration',
                    //     title: '停车时长',
                    //     width: '10%',
                    //     align:"left",
                    //     formatter: fun.parkingDurationFormatter
                    // },
                    // {
                    //     field: 'couponFee',
                    //     title: '优惠',
                    //     width: '10%',
                    //     align:"left",
                    //     formatter: fun.moneyFormatter
                    // },
                    // {
                    //     field: 'parkInSourceCode',
                    //     title: '进口/出口',
                    //     width: '5%',
                    //     align:"left",
                    //     formatter: fun.intOutFormatter
                    // },
                    // {field: 'parkInSourceCode',title: '收费员',width: '10%',align:"left",
                    //     formatter: fun.intOutCodeFormatter},
                    // {
                    //     field: '',
                    //     title: '详情',
                    //     width: '20%',
                    //     align: 'left',
                    //     //visible: false,
                    //     formatter: fun.detailFormater
                    // }

                ]
            });

        },
        /*获取查询参数*/
        getQueryParam: function () {

            /*停车场编码*/
            var plNos = JSON.parse($("#parkIds").val());
            /*停车状态*/
            var parkStatus = JSON.parse($("#parkStatus").val());
            /*停车类型*/
            var parkType = JSON.parse($('#parkType').val());
            var orderStates = null;
            /*泊位*/
            var berthNo = $.trim($('#cordsberthNo').val());

            var data_parkState = $('#allparkrecord-toptab div.ITD-graynav-topbaractive').data('parkstate');


            if (data_parkState == 'all') {
                parkStatus = null;
            }

            if (data_parkState == 'in') {
                parkStatus = JSON.parse('[10]');
            }

            if (data_parkState == 'out') {
                parkStatus = JSON.parse('[20]');
            }

            if (data_parkState == 'error') {
                orderStates = [52];
                // if (null == parkType || parkType.length == 0) {
                //     parkType = JSON.parse('[100,400]');
                // } else if (parkType.contains(100)) {
                //     parkType = JSON.parse('[100]');
                // } else if (parkType.contains(400)) {
                //     parkType = JSON.parse('[400]');
                // } else {
                //     parkType = JSON.parse('[-999]');
                // }


            }

            if (data_parkState == 'back') {
                orderStates = JSON.parse('[53]');
            }

            /*停车场类型 路内、路侧*/
            //var parkLotType = JSON.parse($('#parkLotType').val());
            /*支付方式*/
            //var payType = JSON.parse($('#payType').val());
            /*进场开始时间*/
            var beginInTime = null;
            /*进场结束*/
            var endInTime = null;
            /*出场开始时间*/
            var beginOutTime = null;
            /*出场结束时间*/
            var endOutTime = null;
            /*解析进场时间*/
            var beginInTime = $('#allparkrecord-daterange-btnsta').val();
            var endInTime = $('#allparkrecord-daterange-btnend').val();

            /*解析出场时间*/
            var beginOutTime = $('#allparkrecord-daterange-timeoutsta').val();
            var endOutTime = $('#allparkrecord-daterange-timeoutend').val();

            /*进口*/
            var entrance = $('#enterType').val();
            /*出口*/
            var exit = $('#outType').val();
            /*车牌号*/
            var carNum = $('#carNumber').val();
            carNum = carNum == null || carNum.length == 0 ? null : carNum.trim();
            /*收费员*/
            var chargePerson = $('#personName').val();
            chargePerson = chargePerson == null || chargePerson.length == 0 ? null : chargePerson.trim();
            //var parkStatus=[3,4];
            var req = {
                orderStates: orderStates,
                plNos: plNos,
                parkStatus: parkStatus,
                parkType: parkType,
                berthNo: berthNo,
                //payType: null,
                beginInTime: beginInTime,
                endInTime: endInTime,
                beginOutTime: beginOutTime,
                endOutTime: endOutTime,
                entrance: null,
                exit: null,
                carNum: carNum,
                chargePerson: chargePerson
            };

            return req;
        },
        //停车场下拉框
        initPark: function () {

            var data = fn.getParkLot();
//          var parkLotType = $("#parkLotType").val();
//          if (null != parkLotType) {
//              parkLotType = JSON.parse(parkLotType)[0];
//          }

            $("#parkIds").empty();
            var html = '';
            var plNos = [];
            var isFirst = false;
            if (null == cacheParkData) {
                cacheParkData = {}
                isFirst = true;
            }
            var tempPlNo;
            for (var i = 0; i < data.length; i++) {
                if (isFirst) {
                    tempPlNo = data[i].code;

                    cacheParkData[tempPlNo] = data[i];
                }


                plNos.push(data[i].code);
                html += "<option value='[\"" + data[i].code + "\"]'>" + data[i].name + "</option>";

            }
            var plnosStr = JSON.stringify(plNos);
            html = '<option value=' + plnosStr + ' selected>所有停车场</option>' + html;
            $("#parkIds").append(html);
            $('#parkIds').selectpicker('render');

        },
        //停车类型下拉框
        initParkType: function (data) {

            if (null == data) {
                return;
            }
            $("#parkType").empty();
            var html = '<option value="[]" selected >所有停车类型</option>';
            $.each(data, function (index, item) {
                html += '<option value="[' + item.codeValue + ']">' + item.codeValueName + '</option>'
            });
            $("#parkType").append(html);
            $('#parkType').selectpicker('refresh');

        },
        //停车场类型下拉框
        initParkLotType: function (data) {
//          if (null == data) {
//              return;
//          }
//          $("#parkLotType").empty();
//          var html = '<option value="[]" selected >全部</option>';
//          $.each(data, function (index, item) {
//              html += '<option value="[' + item.codeValue + ']">' + item.codeValueName + '</option>'
//          });
//          $("#parkLotType").append(html);
//          $('#parkLotType').selectpicker('refresh');
        },
        //停车状态下来框
        initParkStatus: function (data) {

            if (null == data) {
                return;
            }
            $("#parkStatus").empty();
            var html = '<option value="[]" selected >所有停车状态</option>';
            $.each(data, function (index, item) {
                html += '<option value="[' + item.codeValue + ']">' + item.codeValueName + '</option>'
            });
            $("#parkStatus").append(html);
            $('#parkStatus').selectpicker('refresh');

        },
        //支付状态下拉框
        initPayType: function (data) {
//          if (null == data) {
//              return;
//          }
//          $("#payType").empty();
//          var html = '<option value="[]" selected >全部</option>';
//          $.each(data, function (index, item) {
//              html += '<option value="[' + item.codeValue + ']">' + item.codeValueName + '</option>'
//          });
//          $("#payType").append(html);
//          $('#payType').selectpicker('refresh');
        },
        freeReasonFormater: function (value, row, index) {
            //:0:短时停车免费,1:待核算、2:待支付、3:已支付、4:已完成、5 逃逸,7:授权车免费,8:手动免费开闸
            var code = row.parkOutSourceCode == null ? (row.parkInSourceCode == null ? "" : row.parkInSourceCode) : row.parkOutSourceCode;
            var parkInSourceCode = row.parkInSourceCode == null ? "" : row.parkInSourceCode;
            var parkOutSourceCode = row.parkOutSourceCode == null ? "" : row.parkOutSourceCode;
            var preMoney = row.preXJ + row.preWX + row.preZFB + row.preZH;
            var prePayType = "";
            var afterMoney = row.afterXJ + row.afterZFB + row.afterWX + row.afterZH;
            var afterPayType = "";

            if (row.preXJ != null && row.preXJ != 0) {
                prePayType = '现金';
            }
            if (row.preWX != null && row.preWX != 0) {
                prePayType = '微信';
            }
            if (row.preZFB != null && row.preZFB != 0) {
                prePayType = '支付宝';
            }
            if (row.preZH != null && row.preZH != 0) {
                prePayType = '账户余额';
            }

            if (row.afterXJ != null && row.afterXJ != 0) {
                afterPayType = '现金';
            }
            if (row.afterWX != null && row.afterWX != 0) {
                afterPayType = '微信';
            }
            if (row.afterZFB != null && row.afterZFB != 0) {
                afterPayType = '支付宝';
            }
            if (row.afterZH != null && row.afterZH != 0) {
                afterPayType = '账户余额';
            }


            if (preMoney > 0 && afterMoney > 0) {
                return "收费员:" + parkInSourceCode + ",预付费" + prePayType + "收费" + preMoney / 100 + "元;" +
                    "收费员:" + parkOutSourceCode + ",后付费" + afterPayType + "收费" + afterMoney / 100 + "元";
                //return "预付款:"+preMoney/100+" 元"+prePayType+"、收费员编号:"+code+"、后付款:"+afterMoney/100+" 元"+afterPayType+"、收费员编号:"+code;
            } else if (preMoney > 0) {
                return "收费员:" + parkInSourceCode + ",预付费" + prePayType + "收费" + preMoney / 100 + "元";
            } else if (afterMoney > 0) {
                return "收费员:" + parkOutSourceCode + ",后付费" + afterPayType + "收费" + afterMoney / 100 + "元";
            } else {
                return "";
            }

        },
        detailFormater: function (value, row, index) {
            //:0:短时停车免费,1:待核算、2:待支付、3:已支付、4:已完成、5 逃逸,7:授权车免费,8:手动免费开闸
            var code = row.parkOutSourceCode == null ? (row.parkInSourceCode == null ? "" : row.parkInSourceCode) : row.parkOutSourceCode;
            var parkInSourceCode = row.parkInSourceCode == null ? "" : row.parkInSourceCode;
            var parkOutSourceCode = row.parkOutSourceCode == null ? "" : row.parkOutSourceCode;
            var preMoney = row.preFee;
            var afterMoney = row.afterFee;
            if (preMoney > 0 && afterMoney > 0) {
                return "收费员:" + parkInSourceCode + ",预付费" + preMoney / 100 + "元;" +
                    "收费员:" + parkOutSourceCode + ",后付费" + afterMoney / 100 + "元";
                //return "预付款:"+preMoney/100+" 元"+prePayType+"、收费员编号:"+code+"、后付款:"+afterMoney/100+" 元"+afterPayType+"、收费员编号:"+code;
            } else if (preMoney > 0) {
                return "收费员:" + parkInSourceCode + ",预付费" + preMoney / 100 + "元";
            } else if (afterMoney > 0) {
                return "收费员:" + parkOutSourceCode + ",后付费" + afterMoney / 100 + "元";
            } else {
                return "";
            }
        },
        parkOutSourceCodeFormatter: function (value, row, index) {
            if (value == null) {
                return "-";

            } else {
                return value;
            }
        },
        payTypeFormater: function (value, row, index) {
            //1:支付宝  2:微信 3:银联 4:微信公众号  6:现金 7:IC卡
            var payTypeStr;
            switch (value) {
                case 1:
                    payTypeStr = '支付宝'
                    break;
                case 2:
                    payTypeStr = '微信'
                    break;
                case 3:
                    payTypeStr = '银联'
                    break;
                case 4:
                    payTypeStr = '微信公众号'
                    break;
                case 6:
                    payTypeStr = '现金'
                    break;
                case 7:
                    payTypeStr = 'IC卡'
                    break;
                default:
                    payTypeStr = '其他'
            }
            return payTypeStr;
        },


        intOutFormatter: function (value, row, index) {

            if (value == null) {
                if (row.parkOutSourceCode == null) {
                    return "-" + '/' + '-';
                } else {
                    return "-" + '/' + row.parkOutSourceCode;
                }
            } else {
                if (row.parkOutSourceCode == null) {
                    return value + '/' + '-';
                } else {
                    return value + '/' + row.parkOutSourceCode
                }
            }
        },
        //收费员格式化
        chargerFormatter: function (value, row, index) {

            //展示需求: 如果是进场,展示进场收费员,如果是出场,展示出场收费员


            //停车状态 10:在场 ,20:离场,30:预订
            var parkState = row.parkState;
            if (null == parkState) {
                if (null != row.parkOutTime) {
                    parkState = 20;
                } else {
                    parkState = 10;
                }

            }
            //在场
            if (parkState == 10) {
                return row.parkInSourceName == null ? (row.parkInSourceCode == null ? '-' : row.parkInSourceCode) : row.parkInSourceName;
            }

            //离场
            if (parkState == 20) {
                return row.parkOutSourceName == null ? (row.parkOutSourceCode == null ? '-' : row.parkOutSourceCode) : row.parkOutSourceName;
            }


            return null;


        },
        //入口格式化
        inCodeFormatter: function (value, row, index) {
            return row.parkInSourceName == null ? (row.parkInSourceCode == null ? "-" : row.parkInSourceCode) : row.parkInSourceName;

        },
        //出口格式化
        outCodeFormatter: function (value, row, index) {
            return row.parkOutSourceName == null ? (row.parkOutSourceCode == null ? "-" : row.parkOutSourceCode ) : row.parkOutSourceName;


        },
        //金额处理
        moneyFormatter: function (value) {
            // console.log(typeof value)
            if (value == 0 || value == undefined || value == null) {
                return '0.00';
            } else {
                return (value / 100).toFixed(2);
            }
        },
        parkingDurationFormatter: function (value, row, index) {
            // 
            var parkState = row.parkState
            if (null == parkState) {
                if (null != row.parkOutTime) {
                    parkState = 20;
                } else {
                    parkState = 10;
                }
            }

            var inTime = row.parkInTime;
            if (parkState == 10) {
                var thisTime = new Date().getTime();
                var parkDuration = (thisTime - inTime) / 1000;
                return formatSeconds(parkDuration);
            }


            if (value == null) {
                return "";
            } else {
                return formatSeconds(value);
            }
        },

        //100:短时停车免费,200:临停车,300:授权车免费,400:手动免费开闸 500:白名单车辆免费
        isFixCarFormatter: function (value, row, index) {
            var carType = '';
            if (row.carType == 1) {
                carType = '大型车'
            } else if (row.carType == 2) {
                carType = '小型车'
            } else if (row.carType == 3) {
                carType = '新能源车'
            } else {
                carType = '未知'
            }

            if (value == 100) {
                return "<span class='allparkrecords-park-type ITD-common-color ITD-common-fontsize12'>短时停车</span><div style='font-size: 12px;padding-left: 10px;padding-top: 10px;'>" + carType + "</div>";
            } else if (value == 200) {
                return "<span class='allparkrecords-park-type ITD-common-color ITD-common-fontsize12'>临停车</span> <div style='font-size: 12px;padding-left: 10px;padding-top: 10px;'>" + carType + "</div>";
            } else if (value == 300) {
                return "<span class='allparkrecords-park-type ITD-common-color ITD-common-fontsize12'>授权车</span><div style='font-size: 12px;padding-left: 10px;padding-top: 10px;'>" + carType + "</div>";
            } else if (value == 400) {
                return "<span class='allparkrecords-park-type ITD-common-color ITD-common-fontsize12'>手动出场</span><div style='font-size: 12px;padding-left: 10px;padding-top: 10px;'>"+carType+"</div>";
            } else if (value == 500) {
                return "<span class='allparkrecords-park-type ITD-common-color ITD-common-fontsize12'>白名单</span><div style='font-size: 12px;padding-left: 10px;padding-top: 10px;'>"+carType+"</div>";
            }
        },
        inDatatimeFormatter: function (value, row, index) {
            if (value == null) {
                return "";
            } else {
                return DateUtils.long2String(value, 11);
            }
        },
        outDatatimeFormatter: function (value, row, index) {
            if (value == null) {
                return "";
            } else {
                return DateUtils.long2String(value, 11);
            }
        },
        inOutStateFormatter: function (value, row, index) {

            // /**停车大类型[字典表:PARK_ORDER_TYPE]:100:短时停车免费,200:临停车,300:授权车免费,400:手动免费开闸 500:白名单车辆免费*/
            var parkOrderType = row.orderType;

            var orderState = row.orderState;

            if (null == parkOrderType) {
                parkOrderType = 200;
            }


            //停车状态 10:在场 ,20:离场,30:预订
            var parkState = row.parkState;
            if (null == parkState) {
                if (null != row.parkOutTime) {
                    parkState = 20;
                } else {
                    parkState = 10;
                }
            }

            if (parkState == 10) {
                return "<span class='ITD-status-on'>在场</span>";
            }

            if (parkState == 20) {

                if (orderState == 52) {
                    return "<span class='ITD-status-abnormal'>欠费</span>";
                } else {
                    return "<span class='ITD-status-off'>离场</span>";
                }
            }

        },
        imageformatter: function (value, row, index) {
            return "<span onClick='' id='inParkimage'></span>";

        },
        //获取进出场图片
        getParkOrderInOutImg: function (orderid, orderterminalSource) {
            //orderid = '101461919192518762496';
            $('.featured-in-wrap').empty();
            $('.featured-out-wrap').empty();
            // console.log(orderterminalSource)
            var req = {
                sourceId: orderid,
                sysCode: sysComm.sysCode
            }

            var opt = {
                method: 'post',
                url: dataUrl.util.queryParkOrderInOutImg(),
                data: JSON.stringify(req),
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                success: function (res) {
                    if (res.code == '8888') {

                        var inHtml = '';
                        var outHtml = '';
                        if (undefined == res.data['4'] || null == res.data['4'] || res.data['4'].length == 0 || res.data["4"] == "http://img.renniting.cn/不需要上传图片") {
                            inHtml = '<div id="featured-in">' +
                                '<img src="../../assets/pages/img/allparkrecords-in-out.jpg">' +
                                '</div>';
                        } else {
                            if (orderterminalSource == '2') {
                                inHtml += '<div id="featured-in" style="margin-left: 200px;width: 188.4px;height: 384px;">';
                                $.each(res.data['4'], function (index, item) {
                                    inHtml += '<img style="width: 188.4px;height: 384px;" class="openImg" data-img="' + item + '" src="' + item + '" title="点击跳转查看原图">';

                                })
                                inHtml += '</div>';
                            } else {
                                inHtml += '<div id="featured-in">';
                                $.each(res.data['4'], function (index, item) {
                                    inHtml += '<img src="' + item + '">';
                                })
                                inHtml += '</div>';
                            }


                        }

                        if (undefined == res.data['5'] || null == res.data['5'] || res.data['5'].length == 0) {
                            outHtml = '<div id="featured-out">' +
                                '<img src="../../assets/pages/img/allparkrecords-in-out.jpg">' +
                                '</div>';
                        } else {
                            if (orderterminalSource == '2') {
                                outHtml += '<div id="featured-in" style="margin-left: 200px;width: 188.4px;height: 384px;">';
                                $.each(res.data['5'], function (index, item) {
                                    outHtml += '<img style="width: 188.4px;height: 384px;" class="openImg" data-img="' + item + '" src="' + item + '">';
                                })
                                outHtml += '</div>';
                            } else {
                                outHtml += '<div id="featured-out">';
                                $.each(res.data['5'], function (index, item) {
                                    outHtml += '<img src="' + item + '">';
                                })
                                outHtml += '</div>';
                            }

                        }

                        $('.featured-in-wrap').append(inHtml);
                        $('.featured-out-wrap').append(outHtml);
                        $('#featured-in').orbit();
                        $('#featured-out').orbit();
                        $('#cardrule_alertmodel').modal('show')
                    }
                }
            };
            sysAjax(opt);


        }
    };


    //隐藏显示 查询条件 搜索框 hide-common-style
    documentBindFunc.on('click', ".ITD-search-morebtn", function () {
        $(".hide-common-style").toggleClass("display-none");
    });
    //切换 搜索部分 是否生效
    documentBindFunc.on('click', "#allparkrecord-toptab div.ITD-graynav-topbar", function () {
        var index = $(this).index();
        $(this).addClass('ITD-graynav-topbaractive').siblings('div').removeClass('ITD-graynav-topbaractive');
        //console.log(index);
        //切换完后,调用查询表格
        fun.createTableData();

    });
    //点击图片切换
    documentBindFunc.on('click', ".allparkrecords-in-out", function () {
        var orderId = $(this).attr('data-order');
        var orderterminalSource = $(this).attr('data-terminalSource');
        // console.log(orderterminalSource)
        $('.featured-in-wrap').removeClass('display-none');
        $('.featured-out-wrap').addClass('display-none');
        $("#ITD-alert-tab-wrap li:first").addClass('ITD-alert-tab-active')
        $("#ITD-alert-tab-wrap li:gt(0)").removeClass('ITD-alert-tab-active')
        fun.getParkOrderInOutImg(orderId, orderterminalSource);


    });

    documentBindFunc.on('click', ".openImg", function (item) {
        var imgs = $(this).attr('data-img');
        window.open(imgs, "_blank");
    });


    //初始执行
    fun.init();
    //查询 事件
    documentBindFunc.on('click', '#queryBtn', function () {
        fun.createTableData();
    });

    //支出明细 弹窗
    documentBindFunc.on('click', '.records_popMsg', function () {
        var orderId = $(this).data('id');
        var req = {
            orderId: orderId
        };

        req.sysCode = sysComm.sysCode;
        var opt = {
            method: 'post',
            url: dataUrl.util.queryExpenseRecordByOrderId(),
            data: JSON.stringify(req),
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            success: function (res) {
                if (res.code == '8888') {
                    // console.log("支出明细" + JSON.stringify(res.data));
                     $('#records_detail').empty();

                    var orderData = res.data.orderParkQueryDTO;
                    var detailData = res.data.expenseRecordDetailDTOList;

                    var totalFee = fun.moneyFormatter(orderData.orderTotalFee) + '元';
                    var actFee = fun.moneyFormatter(orderData.orderActFee) + '元';
                    var refundActFee = fun.moneyFormatter(orderData.refundActFee) + '元';
                    var arrearageFee = fun.moneyFormatter(orderData.arrearageFee) + '元';
                    var backActFee = fun.moneyFormatter(orderData.backActFee) + '元';
                    var discountFee = fun.moneyFormatter(orderData.orderDicountFee) + '元'

                    $('#handle_moneytop').attr('title', totalFee);
                    $('#handle_moneytop').text(totalFee);

                    $('#handle_moneybot').attr('title', actFee);
                    $('#handle_moneybot').text(actFee);

                    $('#handle_rdismoneytop').attr('title', arrearageFee);
                    $('#handle_rdismoneytop').text(arrearageFee);

                    $('#handle_rovermoneybot').attr('title', backActFee);
                    $('#handle_rovermoneybot').text(backActFee);

                    $('#handle_rarrmoneytop').attr('title', discountFee);
                    $('#handle_rarrmoneytop').text(discountFee);

                    $('#handle_rrefmoneybot').attr('title', refundActFee);
                    $('#handle_rrefmoneybot').text(refundActFee);


                    //遍历 消费明细
                    if (null != detailData && detailData.length != 0) {

                        //数据长度
                        var detailDataNum = detailData.length;

                        var html = '';
                        $.each(detailData, function (index, item) {
                            //
                            var createTime = DateUtils.long2String(item.createTime, 11);

                            var payFinishTime = item.payFinishTime == 0 ? '-' : DateUtils.long2String(item.payFinishTime, 11);
                            console.log(payFinishTime)
                            //支付方式[字典表:PAY_TYPE]-- -1:未知(创建时还不清楚支付方式)1:支付宝  2:微信 3:银联
                        // 4:微信公众号 5:个人账户  6:现金 7:IC卡
                        var payType = item.payType;
                        var payTypeStr;
                        var payTypeIcon;
                        switch (payType) {
                            case null:
                                payTypeStr = '未支付';
                                payTypeIcon = 'msgxj-ico';
                                break;
                            case 1:
                                payTypeStr = '支付宝';
                                payTypeIcon = 'msgalipay-ico';
                                break;
                            case 2:
                                payTypeStr = '微信';
                                payTypeIcon = 'msgwx-ico';
                                break;
                            case 3:
                                payTypeStr = '银联';
                                payTypeIcon = 'msgxj-ico';
                                break;
                            case 4:
                                payTypeStr = '微信';
                                payTypeIcon = 'msgwx-ico';
                                break;
                            case 5:
                                payTypeStr = '余额';
                                payTypeIcon = 'msgyy-ico';
                                break;
                            case 6:
                                payTypeStr = '现金';
                                payTypeIcon = 'msgxj-ico';
                                break;
                            case 7:
                                payTypeStr = 'IC卡';
                                payTypeIcon = 'msgxj-ico';
                                break;
                            default:
                                payTypeStr = '未知';
                                payTypeIcon = 'msgxj-ico';
                        }

                            var actFee = commonObj.moneyFormatter(item.actFee);

                            var terminal = item.terminalSource;
                            var terminalStr;
                            //终端来源[字典表:TERMINAL_SOURCE]:1:任你听 2:pda 3:微信公共号 4:云平台,5:道闸',
                            switch (terminal) {
                                case null:
                                    terminalStr = '-';
                                    break;
                                case 1:
                                    terminalStr = 'APP';
                                    break;
                                case 2:
                                    terminalStr = 'PDA';
                                    break;
                                case 3:
                                    terminalStr = '微信公众号';
                                    break;
                                case 4:
                                    terminalStr = '云平台';
                                    break;
                                case 5:
                                    terminalStr = '道闸';
                                    break;
                                case 6:
                                    terminalStr = '企业APP';
                                    break;
                                case 7:
                                    terminalStr = 'H5支付';
                                    break;
                                default:
                                    terminalStr = '未知';
                            }

                            var status = item.status == null ? '-' : item.status;
                            var statusStr;
                            var statusIcon;
                            //订单状态[字典表:ORDER_STATE]:-50:已取消,10:待核算,20:待支付,30:支付中,
                            // 40:支付完成,50:已完成,52:欠费逃逸, 53:已补缴 60:退款中 70:退款成功
                            switch (status) {
                                case -50:
                                    statusStr = '已撤销';
                                    statusIcon = 'detail_falseIco';
                                    break;
                                case 10:
                                    statusStr = '待支付';
                                    statusIcon = 'detail_falseIco';
                                    break;
                                case 20:
                                    statusStr = '待支付';
                                    statusIcon = 'detail_falseIco';
                                    break;
                                case 30:
                                    statusStr = '支付中';
                                    statusIcon = 'detail_falseIco';
                                    break;
                                case 40:
                                    statusStr = '成功';
                                    statusIcon = 'detail_trueIco';
                                    break;
                                case 50:
                                    statusStr = '成功';
                                    statusIcon = 'detail_trueIco';
                                    break;
                                case 52:
                                    statusStr = '成功';
                                    statusIcon = 'detail_falseIco';
                                    break;
                                case 53:
                                    statusStr = '成功';
                                    statusIcon = 'detail_trueIco';
                                    break;
                                case 60:
                                    statusStr = '失败';
                                    statusIcon = 'detail_falseIco';
                                    break;
                                case 70:
                                    statusStr = '成功';
                                    statusIcon = 'detail_trueIco';
                                    break;
                                case 80:
                                    statusStr = '正在退款';
                                    statusIcon = 'detail_falseIco';
                                    break;
                                default:
                                    statusStr = '失败';
                                    statusIcon = 'detail_falseIco';
                            }


                            var type = item.type == null ? '-' : item.type;
                            var typeStr;
                            //支付单类型[字典表:PAY_ORDER_TYPE]:-100:停车欠费单,-200:停车退费单,101:停车付款单,102:停车预付单,103:停车补缴单,104:共享车位;201:余额充值单,202:押金充值;301:会员卡购买单,302:会员卡续费
                            switch (type) {
                            case 101:
                                typeStr = '停车付款';
                                break;
                            case 102:
                                typeStr = '停车预付';
                                break;
                            case 103:
                                typeStr = '停车补缴';
                                break;
                            case -100:
                                typeStr = '停车欠费';
                                statusStr = '未支付';
                                break;
                            case -200:
                                typeStr = '停车退费';
                                break;
                            default:
                                typeStr = '未知';
                        }
                            if(status == 53){//已补缴
                                typeStr = '欠费已补缴';
                                statusStr = '已补缴';
                            }

                            var operId = item.operId == null ? '-' : item.operId;

                            var operName = item.operName == null ? '-' : item.operName;

                            var lineHtml = '';

                            if (detailDataNum != 1) {

                                if (index == 0) {
                                    //第一个,只有下线
                                    lineHtml =
                                        '<!--下 线--> <div class="detail_line pos-abs"></div>';
                                } else if (index == (detailDataNum - 1)) {
                                    //最后一个,只有上线
                                    lineHtml =
                                        '<!--上 线--> <div class="detail_linetop pos-abs"></div>';
                                } else {
                                    //中间的 上线、下线都有
                                    lineHtml =
                                        '<!--上 线--> <div class="detail_linetop pos-abs"></div>' +
                                        '<!--下 线--> <div class="detail_line pos-abs"></div>';
                                }
                            }


                            html += '<div class="detail_cont" data-orderid="' + item.rltOrderId + '">' +
                                // ' <div class="' + statusIcon + ' float-left pos-rel">' +
                                // lineHtml +
                                // ' </div>' +
                                '  <div class="detail_right float-right">' ;

                            if(payFinishTime=='-'){
                                html +='  <div class="detail_righttime text-center float-left" data-createtime="' + createTime + '" data-payfinishtime="' + payFinishTime + '">'+
                                    '' + createTime + '</div>';
                            }else {
                                html +='  <div class="detail_righttime text-center float-left" data-createtime="' + createTime + '" data-payfinishtime="' + payFinishTime + '">'+
                                    '' + payFinishTime + '</div>';
                            }

                            html += '  <div class="detail_rightmsg float-left">' +
                                '  <div class="detail_rightmsgtop">' +
                                '  <div class="detail_rightmsgtopl float-left">' +
                                '  <div class="' + payTypeIcon + ' float-left"></div>' +
                                '  <div class="float-left" data-paytype="' + payType + '">' + payTypeStr + ':' + actFee + '</div>' +
                                '  </div>' +
                                '  <div class="detail_rightmsgtopr float-right" data-type="' + type + '" >' + typeStr + '</div>' +
                                ' </div>' +
                                '  <div class="detail_rightmsgline"></div>' +
                                '   <div class="detail_rightmsgbot">' +
                                '   <div>状态:<span data-staus="' + status + '">' + statusStr + '</span></div>' +
                                '  <div>渠道:<span data-terminal="' + terminal + '">' + terminalStr + '</span></div>' +
                                ' <div>操作人:<span style="max-width:75px;display: inline-block;vertical-align: middle;" class="ITD-hidden-nowrap" title="' + operName + '" data-operid="' + operId + '">' + operName + '</span></div>' +
                                '  </div>' +
                                '  </div>' +
                                '</div>' +
                                '</div>';


                        });
                        $('#records_detail').append(html);
                    }
                    else{
                        var nullhtml='<div class="detail_default">暂无支出明细信息</div>';
                        $('#records_detail').append(nullhtml);
                    }


                    //接口 ajax
                    $('#records_handlemodel').modal('show');
                } else {
                    $('#records_alertmodel').modal('show');
                    $('.ITD-alertmodel-contentmsg').text('查询订单支出明细失败');
                }
            }
        };
        sysAjax(opt);


    });

    //导出
    var InterValObj; //timer变量,控制时间
    var count = 8; //间隔函数,1秒执行
    var curCount;//当前剩余秒数

    function sendMessage() {
        curCount = count;
        //设置button效果,开始计时
        $("#reportBtn").attr("disabled", "true");
        $(".ITD-export-btn").css("width", "138px");
        $("#reportBtn").val(curCount + "秒后可再次导出");
        InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器,1秒执行一次
    }

    //timer处理函数
    function SetRemainTime() {
        if (curCount == 0) {
            window.clearInterval(InterValObj);//停止计时器
            $("#reportBtn").removeAttr("disabled");//启用按钮
            $(".ITD-export-btn").css("width", "72px");
            $("#reportBtn").val("导出");
        }
        else {
            curCount--;
            $("#reportBtn").val(curCount + "秒后可再次导出");
        }
    }

    //导出excle
    documentBindFunc.on('click', '#reportBtn', function () {
        //获取table所有行数据
        var parkLot = $("#recordtable").bootstrapTable('getData');
        //获取table总条数
        var numTotal = $("#recordtable").bootstrapTable('getOptions').totalRows;
        if (parkLot.length < 1) {
            $('.ITD-alertmodel-contentmsg').text('无数据可导出!');
            $('#ITD-tipsmodel').modal('show');
            setTimeout(function () {
                $('.ITD-alertmodel-contentmsg').text('');
                $('#ITD-tipsmodel').modal('hide');
            }, 3000);
            return false;
        }
        if (numTotal > 10000) {
            $('.ITD-alertmodel-contentmsg').text('数据量过大,请缩小查询范围!');
            $('#ITD-tipsmodel').modal('show');
            setTimeout(function () {
                $('.ITD-alertmodel-contentmsg').text('');
                $('#ITD-tipsmodel').modal('hide');
            }, 3000);
            return false;
        }
        //执行倒计时函数
        sendMessage();
        var params = fun.getQueryParam();
        var url = dataUrl.util.excleImportParkOrderForFinance();
        url += '?plNos=' + params.plNos;
        if (null != params.parkStatus) {
            url += '&parkStatus=' + params.parkStatus;
        }
        if (null != params.payType) {
            url += '&payType=' + params.payType;
        }
        if (null != params.parkType) {
            url += '&parkType=' + params.parkType;
        }
        if (null != params.orderStates) {
            url += '&orderStates=' + params.orderStates;
        }
        if (null != params.beginInTime && "" != params.beginInTime) {
            url += '&beginInTime=' + params.beginInTime + " 00:00:00";

        }
        if (null != params.endInTime && "" != params.endInTime) {
            url += '&endInTime=' + params.endInTime + " 23:59:59";
        }
        if (null != params.beginOutTime && "" != params.beginOutTime) {
            url += '&beginOutTime=' + params.beginOutTime + " 00:00:00";
        }
        if (null != params.endOutTime && "" != params.endOutTime) {
            url += '&endOutTime=' + params.endOutTime + " 23:59:59";
        }
        if (null != params.carNum) {
            url += '&carNum=' + params.carNum
        }
        if (null != params.chargePerson) {
            url += '&chargePerson=' + params.chargePerson
        }
        url = encodeURI(url);
        window.downloadFile(url);
    });


    /**
     * 自定义table AJAX请求
     * @param {Object} params
     */
    function tableLoadRequest(params) {
        var req = fun.getQueryParam();
        //设置请求参数
        var pageNum = (params.data.offset / params.data.limit) + 1;

        //条件查询
        req.baseRequest = {
            pageNum: pageNum,
            pageSize: params.data.limit
        };
        req.sysCode = sysComm.sysCode;
        var opt = {
            method: 'post',
            url: dataUrl.util.queryParkOrderForFinance(),
            data: JSON.stringify(req),
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            success: function (res) {
                if (res.code == '8888') {
                    //console.log(res.data);
                    params.success(res.data);
                    $("[data-toggle='tooltip']").tooltip({
                        delay: {show: 500, hide: 100},
                    });
                }
            }
        };
        sysAjax(opt);
    }


    Array.intersect = function () {
        var result = new Array();
        var obj = {};
        for (var i = 0; i < arguments.length; i++) {
            for (var j = 0; j < arguments[i].length; j++) {
                var str = arguments[i][j];
                if (!obj[str]) {
                    obj[str] = 1;
                }
                else {
                    obj[str]++;
                    if (obj[str] == arguments.length) {
                        result.push(str);
                    }
                }//end else
            }//end for j
        }//end for i
        return result;
    }

    Array.prototype.contains = function (needle) {
        for (i in this) {
            if (this[i] == needle) return true;
        }
        return false;
    }

})
();

function formatSeconds(value) {
    var theTime = parseInt(value);// 秒
    var theTime1 = 0;// 分
    var theTime2 = 0;// 小时
    var theTime3 = 0;//天
    if (theTime < 60) {
        return theTime + '秒';
    }
    if (theTime > 60) {
        theTime1 = parseInt(theTime / 60);
        theTime = parseInt(theTime % 60);


    }

    if (theTime1 > 60) {
        theTime2 = parseInt(theTime1 / 60);
        theTime1 = parseInt(theTime1 % 60);
    }

    if (theTime2 > 24) {
        theTime3 = parseInt(theTime2 / 24);
        theTime2 = parseInt(theTime2 % 24);
    }

    var result = '';
    if (theTime1 == 0 && theTime2 == 0 && theTime3 == 0) {
        result = parseInt(theTime) + "秒"
    }

    if (theTime1 > 0) {
        result = "" + parseInt(theTime1) + "分钟" + result;
    }
    if (theTime2 > 0) {
        result = "" + parseInt(theTime2) + "小时" + result;
    }

    if (theTime3 > 0) {
        result = "" + parseInt(theTime3) + "天" + result;
    }
    return result;
};

/*
 * jQuery Orbit Plugin 1.2.3
 * www.ZURB.com/playground
 * Copyright 2010, ZURB
 * Free to use under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 */

(function (d) {
    d.fn.orbit = function (a) {
        a = d.extend({
            animation: "horizontal-push",
            animationSpeed: 600,
            timer: !0,
            advanceSpeed: 4E3,
            pauseOnHover: !1,
            startClockOnMouseOut: !1,
            startClockOnMouseOutAfter: 1E3,
            directionalNav: !0,
            captions: !0,
            captionAnimation: "fade",
            captionAnimationSpeed: 600,
            bullets: !1,
            bulletThumbs: !1,
            bulletThumbLocation: "",
            afterSlideChange: function () {
            }
        }, a);
        return this.each(function () {
            function q() {
                if (!a.timer || a.timer == "false")return !1; else r.is(":hidden") ? s = setInterval(function () {
                    l("next")
                }, a.advanceSpeed) :
                    (o = !0, x.removeClass("active"), s = setInterval(function () {
                        var a = "rotate(" + m + "deg)";
                        m += 2;
                        t.css({"-webkit-transform": a, "-moz-transform": a, "-o-transform": a});
                        m > 180 && (t.addClass("move"), y.addClass("move"));
                        m > 360 && (t.removeClass("move"), y.removeClass("move"), m = 0, l("next"))
                    }, a.advanceSpeed / 180))
            }

            function n() {
                if (!a.timer || a.timer == "false")return !1; else o = !1, clearInterval(s), x.addClass("active")
            }

            function z() {
                if (!a.captions || a.captions == "false")return !1; else {
                    var c = e.eq(b).data("caption");
                    (_captionHTML = d(c).html()) ?
                        (j.attr("id", c).html(_captionHTML), a.captionAnimation == "none" && j.show(), a.captionAnimation == "fade" && j.fadeIn(a.captionAnimationSpeed), a.captionAnimation == "slideOpen" && j.slideDown(a.captionAnimationSpeed)) : (a.captionAnimation == "none" && j.hide(), a.captionAnimation == "fade" && j.fadeOut(a.captionAnimationSpeed), a.captionAnimation == "slideOpen" && j.slideUp(a.captionAnimationSpeed))
                }
            }

            function A() {
                if (a.bullets) C.children("li").removeClass("active").eq(b).addClass("active"); else return !1
            }

            function l(c) {
                function d() {
                    e.eq(f).css({"z-index": 1});
                    u = !1;
                    a.afterSlideChange.call(this)
                }

                var f = b, g = c;
                if (f == g)return !1;
                if (e.length == "1")return !1;
                u || (u = !0, c == "next" ? (b++, b == p && (b = 0)) : c == "prev" ? (b--, b < 0 && (b = p - 1)) : (b = c, f < b ? g = "next" : f > b && (g = "prev")), A(), e.eq(f).css({"z-index": 2}), a.animation == "fade" && e.eq(b).css({
                    opacity: 0,
                    "z-index": 3
                }).animate({opacity: 1}, a.animationSpeed, d), a.animation == "horizontal-slide" && (g == "next" && e.eq(b).css({
                    left: h,
                    "z-index": 3
                }).animate({left: 0}, a.animationSpeed, d), g == "prev" && e.eq(b).css({
                    left: -h,
                    "z-index": 3
                }).animate({left: 0}, a.animationSpeed,
                    d)), a.animation == "vertical-slide" && (g == "prev" && e.eq(b).css({
                    top: v,
                    "z-index": 3
                }).animate({top: 0}, a.animationSpeed, d), g == "next" && e.eq(b).css({
                    top: -v,
                    "z-index": 3
                }).animate({top: 0}, a.animationSpeed, d)), a.animation == "horizontal-push" && (g == "next" && (e.eq(b).css({
                    left: h,
                    "z-index": 3
                }).animate({left: 0}, a.animationSpeed, d), e.eq(f).animate({left: -h}, a.animationSpeed)), g == "prev" && (e.eq(b).css({
                    left: -h,
                    "z-index": 3
                }).animate({left: 0}, a.animationSpeed, d), e.eq(f).animate({left: h}, a.animationSpeed))), z())
            }

            var b = 0,
                p = 0, h, v, u, f = d(this).addClass("orbit"), c = f.wrap('<div class="orbit-wrapper" />').parent();
            f.add(h).width("1px").height("1px");
            var e = f.children("img, a, div");
            e.each(function () {
                var a = d(this), b = a.width(), a = a.height();
                b > f.width() && (f.add(c).width(b), h = f.width());
                a > f.height() && (f.add(c).height(a), v = f.height());
                p++
            });
            if (e.length == 1) a.directionalNav = !1, a.timer = !1, a.bullets = !1;
            e.eq(b).css({"z-index": 3}).fadeIn(function () {
                e.css({display: "block"})
            });
            if (a.timer) {
                c.append('<div class="timer"><span class="mask"><span class="rotator"></span></span><span class="pause"></span></div>');
                var r = c.children("div.timer"), o;
                if (r.length != 0) {
                    var t = d("div.timer span.rotator"), y = d("div.timer span.mask"), x = d("div.timer span.pause"),
                        m = 0, s;
                    q();
                    r.click(function () {
                        o ? n() : q()
                    });
                    if (a.startClockOnMouseOut) {
                        var B;
                        c.mouseleave(function () {
                            B = setTimeout(function () {
                                o || q()
                            }, a.startClockOnMouseOutAfter)
                        });
                        c.mouseenter(function () {
                            clearTimeout(B)
                        })
                    }
                }
            }
            a.pauseOnHover && c.mouseenter(function () {
                n()
            });
            if (a.captions) {
                c.append('<div class="orbit-caption"></div>');
                var j = c.children(".orbit-caption");
                z()
            }
            if (a.directionalNav) {
                if (a.directionalNav ==
                    "false")return !1;
                c.append('<div class="slider-nav"><span class="right">Right</span><span class="left">Left</span></div>');
                var k = c.children("div.slider-nav").children("span.left"),
                    w = c.children("div.slider-nav").children("span.right");
                k.click(function () {
                    n();
                    l("prev")
                });
                w.click(function () {
                    n();
                    l("next")
                })
            }
            if (a.bullets) {
                c.append('<ul class="orbit-bullets"></ul>');
                var C = c.children("ul.orbit-bullets");
                for (i = 0; i < p; i++) {
                    k = d("<li>" + (i + 1) + "</li>");
                    if (a.bulletThumbs && (w = e.eq(i).data("thumb"))) k = d('<li class="has-thumb">' +
                        i + "</li>"), k.css({background: "url(" + a.bulletThumbLocation + w + ") no-repeat"});
                    c.children("ul.orbit-bullets").append(k);
                    k.data("index", i);
                    k.click(function () {
                        n();
                        l(d(this).data("index"))
                    })
                }
                A()
            }
        })
    }
})(jQuery);

$('#featured-in').orbit();

$('#featured-out').orbit();

$('#ITD-alert-tab-wrap li').on('click', function () {
    var _index = $(this).index();
    $(this).addClass('ITD-alert-tab-active').siblings('li').removeClass('ITD-alert-tab-active');
    if (_index == 0) {
        $('.featured-in-wrap').removeClass('display-none')
        $('.featured-out-wrap').addClass('display-none')
    } else {
        $('.featured-in-wrap').addClass('display-none')
        $('.featured-out-wrap').removeClass('display-none')
    }
});