<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>计划维护</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <style type="text/css">
        .aui-card-list {
            margin-bottom: 0px;
        }
    </style>
</head>

<body>
    <div class="container" id="list">
        <script id="DotTemplate" type="text/x-dot-template">
            {{~it.data:value:index}}

            <section class="aui-content-padded ">
                <ul class="aui-list aui-collapse aui-border">
                    <div class="aui-collapse-item">
                        <li class="aui-list-item aui-collapse-header" tapmode>
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-title">{{=gettext(index)}}(<span style="{{if(value.status==1){ }}color:#FF0000;{{}}}">{{= value.count}}</span>)</div>
                                <div class="aui-list-item-right">
                                    <i class="aui-iconfont aui-icon-down aui-collapse-arrow"></i>
                                </div>
                            </div>
                        </li>
                        <div class="aui-collapse-content aui-padded-15">
                            {{~value.plans:val:ind}}
                            <div class="aui-card-list aui-padded-b-15 open-win" win="tpm_jhwhdetail" param='{"machineid":"{{= val.machineID}}","status":"{{= value.status}}"}'>
                                <div class="aui-card-list-header aui-card-list-user">
                                    <div class="aui-card-list-user-name">
                                        <div class="aui-font-size-16">
                                            <b>{{= val.machineID}}</b> &nbsp;
                                            <b>{{= val.location}}</b> &nbsp;
                                            <span style="color:#ccc;"></span>&nbsp;
                                            <i class="aui-iconfont aui-icon-right aui-font-size-12"></i></div>
                                        <small></small>
                                    </div>
                                </div>
                                <div class="aui-card-list-content aui-border-t" style="margin-left: 1rem;">
                                    <ul class="aui-list aui-list-noborder">
                                        <div style="{{ if(val.markself==0){ }}display:none;{{} }};height:100%;width:30px;float:left;">
                                            <div class="dotflag"></div>
                                        </div>
                                        <div class="aui-list-item aui-padded-l-0">
                                            <div class="aui-list-item-inner">
                                                <div class="aui-list-item-title aui-font-size-14 goods-title">{{= val.count}}{{=lang('6660004')}} {{=lang('800192')}}{{= val.standard_time}}{{=lang('200028')}}</div>
                                                <div class="aui-list-item-right goods-price">{{= maskTime2(val.overdue)}}</div>
                                            </div>
                                        </div>

                                    </ul>
                                </div>
                            </div>
                            {{~}}
                        </div>

                    </div>
                </ul>
            </section>
            {{~}}
        </script>

    </div>

</body>

<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/md5.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/swipe.js"></script>
<script type="text/javascript" src="../script/SHA1.js"></script>
<script type="text/javascript" src="../script/doT.min.js"></script>
<script type="text/javascript" src="../script/remotedb.js"></script>
<script type="text/javascript" src="../script/list.js"></script>
<script type="text/javascript" src="../script/aui-tab.js"></script>
<script type="text/javascript" src="../script/aui-toast.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
<script type="text/javascript" src="../script/CryptoJS/core.js"></script>
<script type="text/javascript" src="../script/CryptoJS/cipher-core.js"></script>
<script type="text/javascript" src="../script/CryptoJS/mode-ecb.js"></script>
<script type="text/javascript" src="../script/CryptoJS/aes.js"></script>
<script type="text/javascript" src="../script/aui-collapse.js"></script>

<script type="text/javascript" src="../script/i18next-12.0.0.min.js"></script>
<script type="text/javascript" src="../script/i18nextLocizeBackend.min.js"></script>
<script type="text/javascript" src="../script/jquery-i18next.min.js"></script>
<script type="text/javascript" src="../script/jquery.cookie.js"></script>
<script type="text/javascript" src="../script/i18n-app.js"></script>

<script type="text/javascript">
    var host, testTemplate;
    apiready = function() {
        fnReady();
        api.parseTapmode();
        ajaxsetup();
        host = $api.getStorage('host');
        testTemplate = doT.template($("#DotTemplate").text());
        load_i18n(function(t, i18n) {
            lang = t;
            i18next = i18n;
            getRepairList();
        });
        doRefreshEvent();
    };

    // var host='http://61.177.28.246:8100';
    // ajaxsetup();
    // autologin();
    // getRepairList();

    function doRefreshEvent() {
        api.setCustomRefreshHeaderInfo({
            bgColor: '#f0f0f0',
            image: {
                pull: 'widget://image/loading/pull.png',
                transform: [
                    'widget://image/loading/00.png',
                    'widget://image/loading/01.png',
                    'widget://image/loading/02.png',
                    'widget://image/loading/03.png',
                    'widget://image/loading/04.png',
                    'widget://image/loading/05.png',
                    'widget://image/loading/06.png'
                ],
                load: [
                    'widget://image/loading/00.png',
                    'widget://image/loading/01.png',
                    'widget://image/loading/02.png',
                    'widget://image/loading/03.png',
                    'widget://image/loading/04.png',
                    'widget://image/loading/05.png',
                    'widget://image/loading/06.png'
                ]
            },
            switchTime: 0.2
        }, function() {
            //下拉刷新被触发，自动进入加载状态，使用 api.refreshHeaderLoadDone() 手动结束加载中状态
            setTimeout(function() {
                api.refreshHeaderLoadDone();
                getRepairList();
            }, 500);
        });
    }

    function getRepairList() {

        $.ajax({
            url: host + '/tpm/AppPlan/PlanList',
            //  data:JSON.stringify({
            //     "machineCode":qrcode
            // }),
            type: 'POST',
            success: function(result) {
                console.log(JSON.stringify(result));
                api.hideProgress();
                if (result.ret == 1) {
                    $("#list").html(testTemplate(result));
                    var collapse = new auiCollapse({
                        autoHide: false //是否自动隐藏已经展开的容器
                    });
                    fnReadyOpenWin();
                } else {
                    customToast(lang(result.msg), 2000);
                }
            }
        })
    }

    var collapse = new auiCollapse({
        autoHide: false //是否自动隐藏已经展开的容器
    });

    function gettext(i) {
        return i == "0" ? lang('6660034') : lang('6660035');
    }
</script>

</html>
