<ion-view view-title="{{title}}" ng-init="init()">
    <ion-nav-buttons side="right">
        <button class="button button-clear" ng-click="save()">完成</button>
    </ion-nav-buttons>
    <ion-content>
        <div class="item item-divider"></div>
        <div class="item item-toggle">
            上午上班
            <span class="item-note">{{settingdetail.am_ontime|strtimeformat:settingdetiil.am_ontime}}</span>
            <label class="icon toggle">
                <input type="checkbox" ng-model="settingdetail.ischeckamon" ng-change="choosedate('am_ontime', 'ischeckamon')">
                <div class="track">
                    <div class="handle"></div>
                </div>
            </label>
        </div>
        <div class="item item-toggle" ng-if="settingdetail.isdoublecheck == 1">
            上午下班
            <span class="item-note" ng-click="choosedate('am_offtime', 'ischeckamoff')">{{settingdetail.am_offtime|strtimeformat:settingdetiil.am_offtime}}</span>
            <label class="icon toggle">
                <input type="checkbox" ng-model="settingdetail.ischeckamoff" ng-change="choosedate('am_offtime', 'ischeckamoff')">
                <div class="track">
                    <div class="handle"></div>
                </div>
            </label>
        </div>
        <div class="item item-toggle" ng-if="settingdetail.isdoublecheck == 1">
            下午上班
            <span class="item-note" ng-click="choosedate('3')">{{settingdetail.pm_ontime|strtimeformat:settingdetiil.pm_ontime}}</span>
            <label class="icon toggle">
                <input type="checkbox" ng-model="settingdetail.ischeckpmon" ng-change="choosedate('pm_ontime', 'ischeckpmon')">
                <div class="track">
                    <div class="handle"></div>
                </div>
            </label>
        </div>
        <div class="item item-toggle">
            下午下班
            <span class="item-note" ng-click="choosedate('4')">{{settingdetail.pm_offtime|strtimeformat:settingdetiil.pm_offtime}}</span>
            <label class="icon toggle">
                <input type="checkbox" ng-model="settingdetail.ischeckpmoff" ng-change="choosedate('pm_offtime', 'ischeckpmoff')">
                <div class="track">
                    <div class="handle"></div>
                </div>
            </label>
        </div>
        <a class="item item-icon-right" href="#/workatd-settingweek/{{currentid}}">
            日期
            <span class="item-note" ng-if="settingdetail.ischeckmonday == 1 && settingdetail.ischecktuesday == 1 && settingdetail.ischeckwednesday == 1 && settingdetail.ischeckthursday == 1 && settingdetail.ischeckmonday == 1 && settingdetail.ischecksaturday == 0 && settingdetail.ischecksunday == 0">工作日</span>
            <i class="icon ion-chevron-right icon-accessory"></i>
        </a>
        <button class="button button-full" ng-if="settingdetail.isdoublecheck == 1" ng-click="singlecheck()">切换到一天一次上下班</button>
        <button class="button button-full" ng-if="settingdetail.isdoublecheck != 1" ng-click="doublecheck()">切换到一天两次上下班</button>
        <a class="item item-icon-right" ng-click="settingdetail.workatdreportusr.length == 0 ? showModalSettingReportusr() : toSetPerson(1)">
            允许谁看考勤统计
            <span class="item-note">{{settingdetail.workatdreportusr.length}}人</span>
            <i class="icon ion-chevron-right icon-accessory"></i>
        </a>
        <a class="item item-icon-right" ng-click="showModalSettingDept()">
            考勤部门
            <span class="item-note" ng-if="settingdetail.isallcheck == 1">全部成员</span>
            <span class="item-note" ng-if="settingdetail.isallcheck != 1">共{{settingdetail.workatddept.length}}个部门</span>
            <i class="icon ion-chevron-right icon-accessory"></i>
        </a>
        <a class="item item-icon-right" ng-click="settingdetail.workatdwithoutusr.length == 0 ? showModalSettingWithoutusr() : toSetPerson(0)">
            无需考勤成员
            <span class="item-note">{{settingdetail.workatdwithoutusr.length}}人</span>
            <i class="icon ion-chevron-right icon-accessory"></i>
        </a>
        <div class="item item-divider"></div>
        <a class="item item-icon-right" ng-click="showModalSettingMap()">
            考勤地点
            <span class="item-note">{{settingdetail.workaddress}}</span>
            <i class="icon ion-chevron-right icon-accessory"></i>
        </a>
        <a class="item item-icon-right" ng-click="showModalSettingOffset()">
            允许偏差
            <span class="item-note">{{settingdetail.offset}}米</span>
            <i class="icon ion-chevron-right icon-accessory"></i>
        </a>
        <div class="item item-divider hide"></div>
        <div class="item item-toggle hide">
            使用wi-fi签到/签退
            <label class="icon toggle">
                <input type="checkbox">
                <div class="track">
                    <div class="handle"></div>
                </div>
            </label>
        </div>
        <div class="item item-divider hide">员工在考勤地点内，必须连上指定wi-fi后，才算在公司签到</div>
        <div class="item item-divider"></div>
        <div class="item item-toggle">
            自动签到
            <label class="icon toggle">
                <input type="checkbox" ng-model="settingdetail.isallowauto">
                <div class="track">
                    <div class="handle"></div>
                </div>
            </label>
        </div>
        <div class="item item-divider"></div>
        <button class="button button-full button-assertive" ng-if="currentid != -1" ng-click="delete()">删除</button>

    </ion-content>
</ion-view>