<!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>
    <header class="aui-bar aui-bar-nav" id="header">
        <a class="aui-pull-left aui-btn  event-back" tapmode onclick="closeWin()">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title" data-i18n="900735"></div>
        <a class="aui-pull-right  " data-page="tpm_jhwhdetail" data-params="%7B%22straight%22%3A1%7D" data-i18n="[data-qr-title]900404" onclick="openQRcodetpm(this)" tapmod="">
            <img src="../image/qrcode.png" style="width: 20px;height: 20px;    margin-top:12px;" />
        </a>
    </header>
    <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}}","state":"{{= value.state}}"}'>
                                <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.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;
    apiready = function() {
        fnReady();
        api.parseTapmode();
        ajaxsetup();
        host = $api.getStorage('host');
        load_i18n(function(t, i18n) {
            lang = t;
            i18next = i18n;
            getRepairList();
        });
    };

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

    function getRepairList() {

        $.ajax({
            url: host + '/tpm/AppPlan/PlanList',
            //  data:JSON.stringify({
            //     "machineCode":qrcode
            // }),
            type: 'POST',
            success: function(result) {
                // console.log(host + '/tpm/AppPlan/PlanList');
                api.hideProgress();
                if (result.ret == 1) {

                    var testTemplate = doT.template($("#DotTemplate").text());
                    $("#list").html(testTemplate(result));
                    var collapse = new auiCollapse({
                        autoHide: false //是否自动隐藏已经展开的容器
                    });
                    fnReadyOpenWin();
                } else {
                    customToast(lang(result.msg), 2000);
                }
            },error:function(error){
                console.log(JSON.stringify(error));
            }
        })
    }

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

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

    function reloadMe() {
        console.log('reloadMe');
        location.reload();
        window.location.reload();
    }
</script>

</html>
