<!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" />
</head>

<body>
    <header class="aui-bar aui-bar-nav" id="header">
        <a class="aui-pull-left aui-btn  event-back">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title">离线盘点单</div>
    </header>
    <div class="container" id="con1">
        <script id="dotTemplate" type="text/x-dot-template">
            {{~it:value:index}}
            <div class="aui-card-list  open-win" win="pandian_offline" param='{"id":"{{= value.id}}"}'>
                <div class="aui-card-list-header aui-card-list-user">
                    <div class="aui-card-list-user-name">
                        <div class="aui-font-size-16">
                            <b>{{= value.order_number}}</b> &nbsp;
                            <span style="color:#ccc;"></span>&nbsp;
                        </div>
                        <small>{{= getWmsPandianStatus(value.order_status)}}</small>
                    </div>
                </div>
                <div class="aui-card-list-content aui-border-t" style="margin-left: 1rem;">
                    <ul class="aui-list aui-list-noborder">
                        <div class="aui-list-item aui-padded-l-0 aui-padded-r-15" style="min-height: 1.2rem;">
                            <div class="aui-list-item-title aui-font-size-14 goods-title">创建人:{{= value.creatername}}</div>
                            <div class="aui-list-item-title aui-font-size-14 goods-title">创建时间:{{= value.create_time}}</div>
                        </div>
                        <div class="aui-list-item aui-padded-l-0 aui-padded-r-15" style="min-height: 1.2rem;">
                            <div class="aui-list-item-title aui-font-size-14 goods-title">审核人:{{= value.auditname}}</div>
                            <div class="aui-list-item-title aui-font-size-14 goods-title">审核时间:{{= value.audittime}}</div>
                        </div>
                        <div class="aui-list-item aui-padded-l-0 aui-padded-r-15" style="min-height: 1.2rem;">
                            <div class="aui-list-item-title aui-font-size-14 goods-title">种类:{{= value.totalCount}}</div>
                            <div class="aui-list-item-title aui-font-size-14 goods-title">已盘点数:{{= value.checkCount}}</div>
                        </div>
                    </ul>
                </div>
            </div>
            {{~}}
        </script>
    </div>
    <footer class="aui-bar aui-bar-tab" id="footer">
        <div class="aui-content-padded">
            <div class="aui-list-item-inner aui-list-item-center aui-list-item-btn">
                <div class="aui-btn aui-btn-info aui-btn-block aui-btn-sm btn_clear">清空离线盘点单</div>
            </div>
        </div>
    </footer>
</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/localdb.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/lang.js"></script>
<script type="text/javascript" src="../script/aui-collapse.js"></script>

<script type="text/javascript">
    var host, Template1;
    apiready = function() {
        fnReady();
        api.parseTapmode();
        ajaxsetup();
        // getHost();
        host = $api.getStorage('host');
        fnInitLocal();
        getList();
        api.addEventListener({
            name: 'refreashOfflineData'
        }, function(ret, err) {
            if (ret) {
                var datartn = eval('(' + JSON.stringify(ret) + ')');
                var rtnLst = datartn['value']['msgcont'];
                if (rtnLst) {
                    customToast(rtnLst, 2000);
                }
                getList2();
            }
        });
    };
    // var host='http://61.177.28.246:8100';
    // ajaxsetup();
    // autologin();
    // getRepairList();
    function getList() {
        fnSelectPandian(function(ret, err) {
            api.hideProgress();
            // console.log(JSON.stringify(ret));
            // console.log(JSON.stringify(err));
            // if (result.ret==1) {
            // }else{
            //      customToast(lang[result.msg], 2000);
            // }

            if (ret.status && ret.data.length > 0) {
                var inq = [];
                for (var i = 0; i < ret.data.length; i++) {
                    var js = decodeURIComponent(ret.data[i].jsonCon);
                    // console.log(js);
                    inq.push(JSON.parse(js));
                }
                // console.log(inq.length);
                Template1 = doT.template($("#dotTemplate").text());
                $("#con1").html(Template1(inq));
                fnReadyOpenWin();
            }
        });
    }

    function getList2() {
        fnSelectPandian(function(ret, err) {
            api.hideProgress();
            if (ret.status && ret.data.length > 0) {

                var inq = [];
                for (var i = 0; i < ret.data.length; i++) {
                    var js = decodeURIComponent(ret.data[i].jsonCon);
                    // console.log(js);
                    inq.push(JSON.parse(js));
                }
                // console.log(inq.length);
                $("#con1").html(Template1(inq));
                fnReadyOpenWin();
            }
        });
    }

    $(".btn_clear").click(function() {

        fnDelectPandian(function() {
            customToast("已清空", 2000);
        });
        $("#con1").html('');
    });

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

</html>
