<template>
  <div>
    <div class="mobile-header mobile-center-header">
      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
      <p>应收对账
        <!--<span @click="addApCheck"><i class="icon-sousuo iconfont"></i>新增对账单</span>-->
      </p>
      <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise && user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
    </div>
    <div class="btobapCheck-wrapper">
      <div class="order-tab">
        <div class="order-tab-wrapper clearfix">
          <div class="fl active tab">B2B</div>
          <nuxt-link class="fl tab" to="/mobile/center/vendor/payCenter" tag="div" >
            商城
          </nuxt-link>
        </div>
      </div>
      <div class="order-nav">
        <div :class="activeType === 'all' ? 'active': ''" @click="ChangeList('all')"><span>未对账</span></div>
        <div :class="activeType === 'todo' ? 'active' : ''" @click="ChangeList('todo')"><span>待确认</span></div>
        <div :class="activeType === 'done' ? 'active': ''" @click="ChangeList('done')"><span>已确认</span></div>
        <div :class="activeType === 'end' ? 'active' : ''" @click="ChangeList('end')"><span>已作废</span></div>
      </div>
      <div v-show="activeType !== 'all'">
        <div class="search-content mi-search-content">
          <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="单据编号/客户名称/物料名称">
          <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
        </div>
        <div class="btobapCheck-wrapper-scroll" id="btobapCheck-wrapper-scroll">
          <div class="filter-wrapper">
            <base-filter
              v-for="filterOption in filterOptions"
              :key="filterOption.selectOption"
              :selectItems="filterOption.selectItems"
              :defaultVal="filterOption.defaultVal"
              :selectOption="filterOption.selectOption"
              @selectAction="onSelectAction"
              @valueAction="onValueAction"
              :title="filterOption.title">
            </base-filter>
          </div>
          <div v-if="resourceList.content && resourceList.content.length > 0">
            <div class="invoice-btob-list" v-for="item in resourceList.content" :key="item.id">
              <div class="invoice-btob-wrapper-top">
                <span class="read" v-if="!isUnread(item.id)" style="margin-right: 0.3rem">已读</span>
                <span class="noread" v-if="isUnread(item.id)" style="margin-right: 0.3rem">未读</span>
                <span  style="margin-right: 0.3rem">{{item.recordDate | time}}</span>
                <span class="isPut" v-if="item.status">已提交</span>
                <span class="noPut" v-else>未提交</span>
              </div>
              <div class="invoice-btob-wrapper-middle">
                <div class="invoice-btob-wrapper-middle-title">{{item.custName}}</div>
                <div @click="lookDetails(item.id)"><span>单据编号：</span><a>{{item.code}}</a></div>
              </div>
              <div class="invoice-btob-wrapper-content">
                <div><span>对账期间：</span>{{item.beginDate | time}} - {{item.endDate | time}}</div>
                <div><span>对账金额：</span>{{isUser ? '-' : item.checkAmount}}</div>
                <div><span>明细条目：</span>{{item.items && item.items.length}}条</div>
                <div><span>商品总数：</span>{{item.getTotalProd}}</div>
                <div><span>对账结果：</span>{{item.checkStatus}}</div>
              </div>
            </div>
          </div>
          <empty-status
            v-else
            :text="'暂无对账信息'"
            :showLink="false"
          ></empty-status>
          <pull-up :fixId="'btobapCheck-wrapper-scroll'" :allPage="allPage" :page="filterParams.page" @pullUpAction="onPullUpAction"></pull-up>
        </div>
      </div>

      <div v-show="activeType === 'all'">
        <div class="search-content mi-search-content">
          <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="客户名称">
          <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
        </div>
        <div class="btobapCheck-wrapper-scroll" id="btobapCheck-wrapper-scroll2">
          <div v-if="resourceList.content && resourceList.content.length > 0">
            <div class="invoice-btob-list" v-for="item in resourceList.content" :key="item.id">
              <div class="invoice-btob-wrapper-middle" style="border-top: 0">
                <div class="invoice-btob-wrapper-middle-title">{{item.myEnterprise && item.myEnterprise.enName}}</div>
              </div>
              <div class="invoice-btob-wrapper-middle">
                <div v-if="item.lastCheckDate"><span>上次对账日期：{{item.lastCheckDate | time}}</span></div>
                <div v-else><span>上次对账日期：-</span></div>
                <div><span>未对账总额：{{item.uncheckedCount || '-'}}</span></div>
              </div>
              <div class="invoice-btob-wrapper-middle" @click="showApcheckList(item)">
                <div class="middle_btn">立即对账</div>
              </div>
            </div>
          </div>
          <empty-status
            v-else
            :text="'暂无对账信息'"
            :showLink="false"
          ></empty-status>
          <pull-up :fixId="'btobapCheck-wrapper-scroll2'" :allPage="allPage" :page="filterParams.page" @pullUpAction="onPullUpAction"></pull-up>
        </div>
      </div>
    </div>

    <modal-wrapper :title="isShowApcheckList.enName" :showModal="isShowApcheckList.show" @closeAction="isShowApcheckList.show = false" :bgColor="'#f1f3f6'" :hasFooter="true">
      <div slot="header" class="modal-h">
         <span class="item inline-block" @click="checkAll()">
            <label class="mobile-cart-check" :class="{active: !isCheckAll}"></label>
         </span>
        <span class="inline-block overflowhidden">
          当前客户：深圳优软商城科技有限公司大公司哦12314
        </span>
        <div @click="isShowMonthChoose=true" style="text-indent: 0.12rem">{{isShowApcheckList.thisMonth}}<i class="iconfont icon-arrow-down" style="font-size: 0.3rem"></i></div>
        <!--<input type="month" v-model="isShowApcheckList.thisMonth" @change="showApcheckList()"/>-->
      </div>
      <div class="btobapCheck-modal">
        <div class="choosescreen-result">
          <div v-if="isShowApcheckList.list.length > 0">
          <div class="clearfix choosescreen-result-list" v-for="(item, index) in isShowApcheckList.list">
            <div>
              <div class="choosescreen-result-list-content">
                <div style="border-bottom: 1px solid #D3D3D3;padding-bottom: 0.2rem">
                  <span class="item inline-block" @click="checkItem(item, index)">
                    <label class="mobile-cart-check" :class="{active: item.check}"></label>
                  </span>
                  <div class="inline-block" style="margin-left: 0.15rem">
                    <div class="OverHidden">序号：<span>{{index + 1}}</span></div>
                    <!--<div class="OverHidden">本次对账数：<span>{{item.thischeckqty}}</span></div>-->
                    <div class="OverHidden">单据编号：<span>{{item.inoutno}}</span></div>
                    <div class="OverHidden">类型：<span>{{item.piclass}}</span></div>
                    <div class="OverHidden">单据日期：<span>{{item.pidate | time}}</span></div>
                  </div>
                </div>
                <div style="padding-top: 0.2rem">
                  <span class="item inline-block" style="opacity: 0">
                    <label class="mobile-cart-check"></label>
                  </span>
                  <div class="inline-block" style="margin-left: 0.15rem">
                    <div class="OverHidden">客户采购单：<span>{{item.ordercode}}</span></div>
                    <div class="OverHidden">发货单号：<span>{{item.sendcode}}</span></div>
                    <div class="OverHidden">客户料号：<span>{{item.prodcode}}</span></div>
                    <div class="OverHidden">客户物料名称：<span>{{item.prodtitle}}</span></div>
                    <div class="OverHidden">客户规格型号：<span>{{item.prodspec}}</span></div>
                    <div class="OverHidden">税率：<span>{{item.taxrate}}%</span></div>
                    <div class="OverHidden">数量：<span>{{item.qty}}</span></div>
                    <div class="OverHidden">单价：<span>{{item.currency}}：{{item.orderprice}}</span></div>
                    <!--<div class="OverHidden">金额：<span>{{}}</span></div>-->
                  </div>
                </div>
              </div>
              <div class="clearfix" style="border-top:1px solid #D9D9D9;padding: 0 0.15rem;line-height: 0.8rem">
                <div class="fl" style="font-size: 0.26rem">小计：</div>
                <div class="fr" style="color: #FF3208;font-size: 0.26rem">{{(item.qty || 0) * (item.orderprice || 0) | computeNum(2)}}</div>
              </div>
            </div>
          </div>
          </div>
          <empty-status
            v-else
            :text="'暂无对账信息'"
            :showLink="false"
          ></empty-status>
        </div>
      </div>
      <div slot="footer" class="footerBtn clearfix">
         <span class="item inline-block" @click="checkAll()">
            <label class="mobile-cart-check" :class="{active: !isCheckAll}"></label>全选
         </span>
        <!--<div class="fr bbgoresult" @click="goTopayfor">结算</div>-->
        <div class="fr" style="margin-right: 0.2rem">合计：<a style="color: #001408;">{{allMoney}}</a></div>
      </div>
    </modal-wrapper>
    <modal-wrapper :title="'新增对账单'" :showModal="showModal" @closeAction="showModal = false">
      <div class="btobapCheck-modal">
        <div class="search-content mi-search-content">
          <input type="text" placeholder="选择对账客户">
          <span @click="toChooseUser"><i class="iconfont icon-sousuo"></i></span>
        </div>
        <div style="padding-left: 0.15rem">
          <span class="title inline-block" style="font-size: 0.28rem;color: #666666;line-height: 0.5rem;margin-top:0.18rem">单据时间：</span>
          <div class="date-wrap">
            <label>
              <i class="iconfont icon-ico-date"></i>
              <input type="date" v-model="dateObj.fromDate" @change="setDate('fromDate')">
              <p v-if="dateObj.fromDate">{{dateObj.fromDate | date}}</p>
            </label>
            <span>—</span>
            <label>
              <i class="iconfont icon-ico-date"></i>
              <input type="date" v-model="dateObj.toDate" @change="setDate('toDate')">
              <p v-if="dateObj.toDate">{{dateObj.toDate | date}}</p>
            </label>
          </div>
        </div>
        <div class="choosescreen clearfix">
          <div class="fr">{{'收起'}}筛选条件<i class="iconfont icon-arrow-up"></i></div>
        </div>
        <div class="choosescreen-list">
          <div><span>应付供应商：</span><input type="text" v-model="screenObj.key" placeholder="可用应付供应商名称筛选" /></div>
          <div><span>物料名称：</span><input type="text" placeholder="请输入物料名称" /></div>
          <div><span>税率：</span><input type="text" placeholder="请输入税率" /></div>
          <div><span>送货工厂：</span><input type="text" placeholder="请输入送货工厂名称" /></div>
          <div><span>规格：</span><input type="text" placeholder="请输入物料规格" /></div>
        </div>
        <div class="choosescreen-result">
          <div class="clearfix choosescreen-result-list">
            <span class="item inline-block">
                <label class="mobile-cart-check"></label>
              </span>
            <div class="choosescreen-result-list-content">
              <div>本次对账数：<span>1</span></div>
              <div>客户名称：<span>1</span></div>
              <div>单据编号：<span>1</span></div>
              <div>发货单号：<span>1</span></div>
              <div>序号：<span>1</span></div>
              <div>类型：<span>1</span></div>
              <div>单据日期：<span>1</span></div>
              <div>应付供应商：<span>1</span></div>
              <div>客户采购单：<span>1</span></div>
              <div>客户料号：<span>1</span></div>
              <div>客户物料名称：<span>1</span></div>
              <div>客户规格型号：<span>1</span></div>
              <div>送货工厂：<span>1</span></div>
              <div>数量：<span>1</span></div>
              <div>单价：<span>1</span></div>
              <div>币别：<span>1</span></div>
              <div>税率：<span>1</span></div>
              <div>金额：<span>1</span></div>
              <div>本次对账金额：<span>1</span></div>
            </div>
          </div>
        </div>
      </div>
    </modal-wrapper>
    <div class="fixedPicker" v-show="isShowMonthChoose">
      <picker :slots="slots" @change="onValuesChange" :showToolbar="true" ref="picker">
        <div class="titls">选择当前时间</div>
        <div class="leftBtn" @click="isShowMonthChoose=false">取消</div>
        <div class="rightBtn" @click="resultMonth">确定</div>
      </picker>
    </div>
  </div>
</template>

<script>
  import { Picker } from 'mint-ui'
  import { ModalWrapper, BaseFilter } from '~components/mobile/base'
  import { PullUp, EmptyStatus } from '~components/mobile/common'
  function years() {
    let arr = []
    let num = 1989
    for (let i = 0; i < 99; i++) {
      num++
      arr.push(num + '年')
    }
    return arr
  }
  function getMonth() {
    let sdateTo = new Date()
    console.log(sdateTo.getMonth() - 1)
    return sdateTo.getMonth() - 1
  }
  function getYear() {
    let num = 1989
    let sdateTo = new Date()
    let _year = sdateTo.getFullYear()
    for (let i = 0; i < 99; i++) {
       num++
       if (num === Number(_year)) {
         num = i
         break
       }
    }
    return num
  }
  export default {
    layout: 'mobileNoHeader',
    middleware: 'authenticated',
    data() {
      return {
        isShowMonthChoose: false,
        slots: [
          {
            flex: 1,
            values: years(),
            className: 'slot1',
            textAlign: 'center',
            defaultIndex: getYear()
          }, {
            divider: true,
            content: '-',
            className: 'slot2'
          }, {
            flex: 1,
            values: ['01月', '02月', '03月', '04月', '05月', '06月', '07月', '08月', '09月', '10月', '11月', '12月'],
            className: 'slot3',
            textAlign: 'center',
            defaultIndex: getMonth()
          }
        ],
        activeType: 'all',
        filterParams: {
          keyword: '',
          page: 1,
          count: 10
        },
        filterOptions: [
          {
            title: '交易时间',
            selectOption: 'date',
            selectItems: [{
              key: '30天',
              val: 1
            }, {
              key: '90天',
              val: 2
            }, {
              key: '180天',
              val: 3
            }, {
              key: '自定义',
              val: 4
            }],
            defaultVal: 1
          }
        ],
        resourceList: {
          content: []
        },
        isUser: false,
        unreadCode: [],
        showModal: false,
        dateObj: {},
        screenObj: {},
        isShowApcheckList: {
          show: false,
          enName: '深圳市优软科技有限公司',
          thisMonth: '',
          list: [{
            qty: 1,
            orderprice: 20
          }, {
            qty: 3,
            orderprice: 20
          }]
        }
      }
    },
    created() {
      this.$http.get('/account/role/isUser').then(res => {
        this.isUser = res.data.isUser
      })
      this.getUnread()
      let sdateTo = new Date()
      this.isShowApcheckList.thisMonth = sdateTo.getFullYear() + '-' + sdateTo.getMonth()
    },
    // mounted() {
    //   this.$nextTick(() => {
    //     this.$refs.picker.change()
    //   })
    // },
    methods: {
      onValuesChange(picker, value) {
        // console.log(picker.getValues())
        if (!this.$value) {
          picker.setSlotValue(0, '2018年')
          picker.setSlotValue(1, '11月')
        }
        let _ns = value[0].replace('年', '')
        let _my = value[1].replace('月', '')
        this.$value = _ns + '-' + _my
      },
      resultMonth() {
        this.isShowMonthChoose = false
        this.isShowApcheckList.thisMonth = this.$value
          this.showApcheckList()
      },
      addApCheck() {
        this.showModal = true
      },
      setDate (type) {
        if (this.dateObj[type]) {
          // 初始化为00:00:00
          this.dateObj[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
          if (this.dateObj.fromDate && this.dateObj.toDate && this.dateObj.fromDate > this.dateObj.toDate) {
            if (type === 'fromDate') {
              this.setRemindText('起始时间不能大于结束时间')
            } else {
              this.setRemindText('结束时间不能小于起始时间')
            }
            this.dateObj[type] = null
          }
//          else {
//            if (this.dateObj.fromDate && this.dateObj.toDate && this.dateObj.fromDate === this.dateObj.toDate) {
//              // 23:59:59
//              this.dateObj.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
//            }
//          }
          // 23:59:59
          if (this.dateObj.toDate && type === 'toDate') {
            this.dateObj.toDate += (23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000)
          }
        } else {
          this.dateObj[type] = null
        }
      },
      toChooseUser() {
        console.log('选择客户')
      },
      onPullUpAction () {
        this.filterParams.page++
        this.setSelect(this.$selectObj.key, this.$selectObj.value, false)
      },
      getUnread() {
        this.$http.get('/sale/apCheck/unread').then(res => {
          this.unreadCode = res.data.content
        })
      },
      lookDetails(id) {
        console.log('前往详情并且设置为已读')
        // if (!this.isUnread(id)) { } else {
        //   let sourceId = []
        //   sourceId.push(id)
        //   this.$http.post('/sale/tender/setRead', sourceId).then(res => {
        //     this.getUnread()
        //   })
        // }
      },
      isUnread: function (id) {
        for (let i in this.unreadCode) {
          if (id === this.unreadCode[i]) {
            return true
          }
        }
      },
      ChangeList(tp) {
        this.activeType = tp
        this.filterParams.page = 1
        this.setSelect(this.$selectObj.key, this.$selectObj.value, true)
      },
      onFilter() {
        this.filterParams.page = 1
        this.setSelect(this.$selectObj.key, this.$selectObj.value, true)
      },
      onSelectAction(selectObj) {
        this.$selectObj = selectObj
        this.setSelect(selectObj.key, selectObj.value, true)
      },
      onValueAction(selectObj) {
        this.$selectObj = selectObj
        this.setSelect(selectObj.key, selectObj.value, true)
      },
      // B2B未对账
      // NotapCheck () {
      //   console.log('未对账')
      // },
      // 未对账详情
      showApcheckList(item) {
        this.isShowApcheckList.show = true
        this.isShowApcheckList.enName = item ? item.myEnterprise.enName : this.isShowApcheckList.enName
        this.$http.get('/sale/apCheck/getAllByKeywords', {
          params: {
            checkDate: this.isShowApcheckList.thisMonth,
            suuorname: item ? item.myEnterprise.enName : this.isShowApcheckList.enName
          }
        }).then(res => {
          res.data.forEach(item => {
            item.check = true
          })
          this.isShowApcheckList.list = res.data
          this.$nextTick(() => {
            this._initscroll()
          })
        })
      },
      checkAll() {
        let fl = true
        if (this.isCheckAll === 0) {
          fl = false
        }
        this.isShowApcheckList.list.forEach(item => {
          item.check = fl
        })
      },
      checkItem(item, index) {
        if (item.check) {
          item.check = false
        } else {
          this.$set(this.isShowApcheckList.list[index], 'check', true)
        }
      },
      goTopayfor() {
        console.log('结算')
      },
      async setSelect(...val) {
        let _url = '/sale/apCheck/info/search'
        let itemL = {
          params: {
            count: this.filterParams.count,
            page: this.filterParams.page,
            searchFilter: {'keyword': this.filterParams.keyword || '', 'fromDate': val[1].fromDate, 'endDate': val[1].toDate},
            sorting: {'recordDate': 'desc'},
            _state: this.activeType
          }
        }
        if (this.activeType === 'all') {
           _url = '/sale/apCheck/customer'
          itemL = {
            params: {
              count: 20,
              page: 1,
              keyword: this.filterParams.keyword,
              searchFilter: {'fromDate': null, 'endDate': 1543981513949},
              sorting: { 'recordDate': 'desc' }
            }
          }
        }
        let { data } = await this.$http.get(_url, itemL)
        if (!this.resourceList.content) {
          this.resourceList.content = []
        }
        data.content = data.content || []
        if (this.activeType !== 'all') {
          data.content.forEach(item => {
            item.checkAmount = item.checkAmount.toFixed(2)
            item.getTotalProd = 0
            item.items.forEach(im => {
              item.getTotalProd += im.checkQty
            })
          })
        }
        if (!val[2]) {
          this.resourceList.content.push(...data.content)
          data.content = this.resourceList.content
        } else {
          this.resourceList.content = []
        }
        this.resourceList = data
      }
    },
    computed: {
      allPage () {
        return Math.ceil(this.resourceList.totalElement / 10)
      },
      isEmpty () {
        return this.resourceList.content.length === 0
      },
      allMoney() {
        let sum = 0
        this.isShowApcheckList.list.forEach(obj => {
          if (obj.check) {
            sum += obj.qty * obj.orderprice
          }
        })
        return sum
      },
      isCheckAll() {
        if (this.isShowApcheckList.list.length === 0) {
          return true
        }
        return this.isShowApcheckList.list.filter(item => {
          return item.check === false
        }).length
      }
    },
    components: {
      ModalWrapper,
      BaseFilter,
      PullUp,
      EmptyStatus,
      Picker
    },
    filters: {
      time: function (time) {
        if (typeof time === 'number') {
          if (!time) {
            return '无'
          } else {
            let d = new Date(time)
            let year = d.getFullYear()
            let month = d.getMonth() + 1
            let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
            return year + '-' + month + '-' + day
          }
        }
      },
      computeNum: function(price, num) {
        return price.toFixed(num)
      }
    }
  }
</script>

<style lang="scss" scoped>
  @mixin overFlowHidden {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fixedPicker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0,0,0,0.5);
    .picker {
      width: 100%;
      left: 0;
      bottom: 0;
      position: absolute;
      background: #fff;
    }
    .titls {
      text-align: center;
      font-size: 0.24rem;
      line-height: 0.5rem
    }
    .leftBtn {
      color: #666;
      font-size: 0.24rem;
      position: absolute;
      left: 0.2rem;
      top: 0.1rem
    }
    .rightBtn {
      top: 0.1rem;
      color: #3e82f5;
      font-size: 0.24rem;
      position: absolute;
      right: 0.2rem;
    }
  }
  .mobile-header{
    position: fixed;
    top: 0;
    z-index: 100;
    width:100%;
    height: 1.26rem;
    line-height: 1.26rem;
    /*border-bottom:.01rem solid #ccc;*/
    background: #3e82f5;
    padding:0 .2rem 0 .1rem;
    color:#fff;
  }
  .mobile-header p{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size:.36rem;
    text-align: center;
    width: 6rem;
    padding-left: 1rem;
  }
  .mobile-center-header p.en-name {
    font-size: .3rem;
  }
  .mobile-header a{
    font-size:.28rem;
    color:#fff;
    position: absolute;
  }
  .mobile-header a i{
    font-size: .48rem;
    margin-right: -.1rem;
  }
  .mobile-header p span {
    position: absolute;
    right: .4rem;
    font-size: .28rem;
  }
  .mobile-header p span i {
    font-size: .28rem;
  }
  .btobapCheck-wrapper {
    background: #f1f3f6;
    margin: 1.26rem 0 0.98rem 0;
    .search-content {
      padding: .24rem 0;
      text-align: center;
      background: #f1f3f6;
      input {
        width: 6.48rem;
        height: .58rem;
        line-height: .58rem;
        border-radius: .14rem;
        margin: 0 0 0 .11rem;
        font-size: .26rem;
        padding: 0 .71rem 0 .21rem;
        border: 1px solid #3f84f6;
      }
    }
    .order-tab {
      background: #3f84f6;
      padding-bottom: 0.2rem;
      .order-tab-wrapper {
        border: solid 1px #ffffff;
        width: 7.06rem;
        margin: 0 auto;
        border-radius: 0.04rem;
        line-height: 0.72rem;
        height: 0.72rem;
        overflow: hidden;
        div {
          color: #ffffff;
          font-size: 0.28rem;
          text-align: center;
          width: 50%;
          &.active {
            background-color: #ffffff;
            color: #3f84f6;
          }
        }
      }
    }
    .order-nav {
      background: #fff;
      div {
        height: 0.82rem;
        line-height: 0.82rem;
        display: inline-block;
        width: 25%;
        text-align: center;
        font-size: .28rem;
        color: #666;
        &.active span{
          color: #3f84f6;
          border-bottom: 0.04rem solid #3f84f6;
          padding-bottom: 0.2rem;
        }
      }
    }
    .btobapCheck-wrapper-scroll {
      height: calc(100vh - 1.26rem - 0.98rem - 0.82rem - 1.06rem - 0.92rem);
      overflow-y: auto;
    }
    .filter-wrapper{
      width: 7.1rem;
      margin: 0 auto 0.27rem;
      background: #fff;
      padding: 0.27rem 0.2rem;
      border-radius: 0.05rem;
    }
    .invoice-btob-list {
      width: 7.1rem;
      margin: 0 auto 0.2rem;
      background: #FFFFFF;
      border-radius: 0.05rem;
      padding: 0 0.24rem;
    }
    .invoice-btob-wrapper-top {
      height: 0.8rem;
      span{
        margin-top: 0.24rem;
        display: inline-block;
        font-size: 0.28rem;
        color: #333333;
        height:0.25rem;
        &.read {
          color: #15B262;
        }
        &.noread {
          color: #DE4545;
        }
        &.isPut {
          background: #15B262;
          color: #FFFFFF;
          font-size: 0.24rem;
          border-radius: 0.04rem;
        }
        &.noPut {
          font-size: 0.24rem;
          background: #DE4545;
          color: #FFFFFF;
          border-radius: 0.04rem;
        }
      }
    }
    .invoice-btob-wrapper-middle {
      border-top: 1px solid #D9D9D9;
      @include overFlowHidden();
      padding-top: 0.15rem;
      font-size: 0.28rem;
      color: #151515;
      line-height: 0.5rem;
      padding-bottom: 0.15rem;
      span {
        color: #666666;
      }
      .invoice-btob-wrapper-middle .tilte{
        color: #333333;
      }
      .middle_btn {
        text-align: center;
        font-size: 0.26rem;
        color: #333333;
      }
    }
    .invoice-btob-wrapper-content {
      border-top: 1px solid #D9D9D9;
      @include overFlowHidden();
      padding-top: 0.15rem;
      font-size: 0.28rem;
      color: #151515;
      line-height: 0.5rem;
      padding-bottom: 0.15rem;
      span {
        color: #666666;
      }
    }
  }
  .btobapCheck-modal {
    .search-content input {border: 1px solid #3f84f6;}
    .date-wrap{
      text-align: center;
      display: inline-block;
      label {
        width: 2.3rem;
        height: .5rem;
        line-height: .5rem;
        border-radius: .04rem;
        border: 1px solid #bfbfbf;
        background: url(/images/mobile/select-arrow.png) no-repeat;
        background-size: .12rem .06rem;
        vertical-align: middle;
        background-color: #fff;
        background-position: 2.1rem .2rem;
        position: relative;
        margin: .2rem 0 0 0;
        i {
          font-size: .28rem;
          color: #3f84f6;
          margin-left: .1rem;
          float: left;
        }
        input {
          opacity: 0;
          width: 2.22rem;
          height: .5rem;
          position: absolute;
          left: 0;
          z-index: 1;
        }
        p {
          font-weight: normal;
          font-size: .22rem;
          color: #3E81F6;
          text-align: left;
          text-indent: 10px;
        }
      }
      span {
        color: #a0a0a0;
        margin: 0.3rem .05rem 0;
        width: .3rem;
        display: inline-block;
        text-align: center;
        vertical-align: top;
      }
    }
    .choosescreen {
      padding: 0 0.15rem;
      font-size: 0.28rem;
      color: #418DF6;
      line-height: 0.52rem;
      i {
        font-size: 0.28rem;
      }
    }
    .choosescreen-list {
      margin: 0 0.15rem;
      padding-bottom: 0.28rem;;
      border-bottom: 1px solid #D9D9D9;
      div {
        line-height: 0.76rem;
        span {
          font-size: 0.28rem;
          color: #666666;
          display: inline-block;
          width: 1.68rem;
        }
        input {
          height: 0.5rem;
          line-height: 0.5rem;
          width: 4.44rem;
          margin-left: 0.18rem;
          font-size: 0.28rem;
          color: #333;
          border: 1px solid #AEAEAE;
          text-indent: 0.12rem;
        }
      }
    }
    .choosescreen-result {
      .choosescreen-result-list {
        /*padding: 0 0.15rem 0rem;*/
        background: #fff;
        margin:0 0 0.2rem;
      }
      .choosescreen-result-list-content {
        /*display: inline-block;*/
        vertical-align: middle;
        margin: 0 0.15rem;
        div.OverHidden {
          @include overFlowHidden();
          width: 5.5rem;
        }
        padding-top: 0.15rem;
        font-size: 0.28rem;
        color: #151515;
        line-height: 0.5rem;
        padding-bottom: 0.15rem;
        span {
          color: #666666;
        }
      }
    }
  }
  .modal-h {
    background: #F3F3F3;
    padding: 0.15rem;
    .overflowhidden {
      @include overFlowHidden();
      width: 4.1rem;
      font-size: 0.28rem;
      color: #333333;
      margin: 0 0.1rem;
    }
    div {
      background: #FFFFFF;
      border: 1px solid #BFBFBF;
      border-radius: 4px;
      font-size: 0.28rem;
      color: #3E81F6;
      width: 1.7rem;
      display: inline-block;
    }
  }
  .footerBtn {
    padding: 0 0 0 0.15rem;
    height: 1rem;
    line-height: 1rem;
    background: #fff;
    font-size: 0.26rem;
    color: #666666;
    border-top: 1px solid #D3D3D3;
    .bbgoresult {
      background: #008BF7;
      color: #fff;
      width: 1.3rem;
      text-align: center;
    }
  }
</style>
