<template>
    <section class="bg">
      <t-header title="宜宾高测原料入库看板">
      </t-header>
      <div class="container">
        <div class="sec sec1">
          <div class="four_wrap four_wrap_1">
              <div class="item_tip item_tip_bg_s">
                <div class="item_tip_left">库存情况</div>
              </div>
              <div class="item_content">
                <div class="scroll_wrap">
                  <ul class="scroll_tab_1">
                    <li style="width: 20%;">客户名称</li>
                    <li style="width: 20%">规格型号</li>
                    <li style="width: 8%">总根数</li>
                    <li style="width: 8%">总托数</li>
                    <li style="width: 13%">总重量/吨</li>
                    <li style="width: 13%">总长度/毫米</li>
                    <li style="width: 18%">批次</li>
                  </ul>
                  <div class="scroll_container_1">
                    <vue-seamless-scroll :data="kc.list" :class-option="defaultOption1">
                      <ul class="scroll-ul_1">
                        <li v-for="(e, i) in kc.list" :key="i">
                          <div class="scroll-ul_2_div" style="width: 20%;">{{e.supplierName}}</div>
                          <div class="scroll-ul_2_div" style="width: 20%">{{e.productDescription}}</div>
                          <div class="scroll-ul_2_div" style="width: 8%">{{e.count1}}</div>
                          <div class="scroll-ul_2_div" style="width: 8%">{{e.count2}}</div>
                          <div class="scroll-ul_2_div" style="width: 13%">{{e.count3}}</div>
                          <div class="scroll-ul_2_div" style="width: 13%">{{e.count4}}</div>
                          <div class="scroll-ul_2_div" style="width: 18%">{{e.ingotBatch}}</div>
                        </li>
                      </ul>
                    </vue-seamless-scroll>
                  </div>
                </div>
                <!-- <div class="rbox">
                  <div class="rbox-con">
                    <div class="title">总库存</div>
                    <div class="desc"><span>{{ kc.sum }}</span><span>条</span></div>
                    <div class="desc"><span>{{ kc.weight }}</span><span>吨</span></div>
                  </div>
                  <div class="rbox-con">
                    <div class="title">待入库存</div>
                    <div class="desc"><span>{{ kc.pendSum }}</span><span>条</span></div>
                    <div class="desc"><span>{{ kc.pendWeight }}</span><span>吨</span></div>
                  </div>
                </div> -->
              </div>
          </div>
          <div class="four_wrap">
              <div class="item_tip item_tip_bg_s">
                <div class="item_tip_left">货位占用</div>
              </div>
              <div class="item_content item_content_1">
                <div class="li">
                  <div class="li-left">
                    <div class="hwz_n">货位数</div>
                    <div class="hwz_num"><span>{{ hw.pointNumber }}</span><span>个</span></div>
                  </div>
                  <div class="li-right">
                    <div class="hwz_n">已使用</div>
                    <div class="hwz_num"><span>{{ hw.pointUsed }}</span><span>个</span></div>
                  </div>
                </div>
                <div class="li">
                  <div class="li-left">
                    <div class="hwz_n">剩余数</div>
                    <div class="hwz_num"><span>{{ hw.pointRemain }}</span><span>个</span></div>
                  </div>
                </div>
                <div class="li">
                  <div class="li-left">
                    <div class="hwz_n">空托位数</div>
                    <div class="hwz_num"><span>{{ hw.emptyNumber }}</span><span>个</span></div>
                  </div>
                  <div class="li-right">
                    <div class="hwz_n">剩余</div>
                    <div class="hwz_num"><span>{{ hw.emptyRemain }}</span><span>个</span></div>
                  </div>
                </div>
                <div class="li">
                  <div class="li-left">
                    <div class="hwz_n">空托盘垛</div>
                    <div class="hwz_num"><span>{{ hw.emptyUsed }}</span><span>垛</span></div>
                  </div>
                  <div class="li-right">
                    <div class="hwz_n">数量</div>
                    <div class="hwz_num"><span>{{ hw.emptyQty }}</span><span>个</span></div>
                  </div>
                </div>
                <!-- <div class="rbox">
                  <div class="rbox-con">
                    <div class="title">总库存</div>
                    <div class="desc"><span>12000</span><span>条</span></div>
                    <div class="desc"><span>2000</span><span>吨</span></div>
                  </div>
                  <div class="rbox-con">
                    <div class="title">待入库存</div>
                    <div class="desc"><span>2000</span><span>条</span></div>
                    <div class="desc"><span>50</span><span>吨</span></div>
                  </div>
                </div> -->
              </div>
          </div>
        </div>
        <div class="sec">
          <div class="bottom_wrap">
              <div class="item_tip item_tip_bg_m">
                <div class="item_tip_left">库内物料</div>
              </div>
              <div class="item_content">
                <div class="scroll_wrap">
                  <ul class="scroll_tab_2">
                    <li style="width: 7%;">序号</li>
                    <li style="width: 17%;">托盘号</li>
                    <li style="width: 17%;">物料编码</li>
                    <li>名称</li>
                    <!-- <li>数量(条)</li> -->
                    <li style="width: 13%;">重量(kg)</li>
                    <li>供应商</li>
                  </ul>
                  <div class="scroll_container_2">
                    <vue-seamless-scroll :data="kn" :class-option="defaultOption2">
                      <ul class="scroll-ul_2">
                        <li v-for="(e, i) in kn" :key="i">
                          <div class="scroll-ul_2_div" style="width: 7%;">{{i + 1}}</div>
                          <div class="scroll-ul_2_div" style="width: 17%;">{{e.palletSN}}</div>
                          <div class="scroll-ul_2_div" style="width: 17%;">{{e.productName}}</div>
                          <div class="scroll-ul_2_div">{{e.productDescription}}</div>
                          <!-- <div class="scroll-ul_2_div">{{e.qty}}</div> -->
                          <div class="scroll-ul_2_div" style="width: 13%;">{{e.incomingWeight}}</div>
                          <div class="scroll-ul_2_div">{{e.supplierName}}</div>
                        </li>
                      </ul>
                    </vue-seamless-scroll>
                  </div>
                </div>
              </div>
          </div>
        </div>
      </div>
      <section class="bottom"></section>
    </section>
</template>

<script>
import THeader from '@components/header3.vue'
import { rk } from '@js/getData1'
// import {rk} from '@js/mork00.js'
export default {
  name: 'InStore',
  components: {
    THeader
  },
  data () {
    return {
      interTime: this.$store.getters.setTime,
      timer: null,
      kn: [],
      wrk: [],
      kc: {},
      hw: {},
      resData: {}
    }
  },
  computed: {
    defaultOption1 () {
      return {
        step: 0.4, // 数值越大速度滚动越快
        limitMoveNum: 5, // 开始无缝滚动的数据量 this.dataList.length
        hoverStop: true, // 是否开启鼠标悬停stop
        direction: 1, // 0向下 1向上 2向左 3向右
        openWatch: true, // 开启数据实时监控刷新dom
        singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
        waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
      }
    },
    defaultOption2 () {
      return {
        step: 0.4, // 数值越大速度滚动越快
        limitMoveNum: 5, // 开始无缝滚动的数据量 this.dataList.length
        hoverStop: true, // 是否开启鼠标悬停stop
        direction: 1, // 0向下 1向上 2向左 3向右
        openWatch: true, // 开启数据实时监控刷新dom
        singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
        waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
      }
    }
  },
  mounted () {
    this.initData()
    this.refresh()
  },
  beforeDestroy () {
    clearInterval(this.timer)
  },
  methods: {
    refresh () {
      this.timer = setInterval(() => {
        this.initData()
      }, this.interTime)
    },
    async initData () {
      let res = await rk()
      this.resData = res
      this.kn = [...res.kn]
      this.wrk = [...res.wrk]
      this.kc = res.kc
      this.hw = res.hw
    }
  }
}
</script>

<style lang="stylus" scoped>
// @import '~@css/mixin'
@import '../../css/mixin'
// @import '~@style/mixin'
.bg
  _wh(100%, 100%)
  overflow hidden
.container
  _wh(100%, 86%)
  padding 1.5% 25px 0
  overflow hidden
  clear both
.bottom_wrap
  width 100%
  height 100%
.sec
  _fj()
  width 100%
  height 50%
.sec1
  padding-bottom 1.5%
.bottom
  position: fixed;
  bottom: 0;
  _wh(100%, 6%)
  background center bottom / 100% 100% url(../../images/screen1/bottom.png) no-repeat
.cblue
  color #32C5FF !important
.cgreen
  color #6ce64e !important
.cgray
  color #516282 !important
.cyellow
  color #E2BB0E !important
.corange
  color #F96700 !important
.cred
  color #FF0000 !important
.four_wrap
  height 100%
  width 32%
.four_wrap_1
  width 67%
.scroll-ul_1
  width 100%
  li
    width 100%
    line-height 40px
    span
     _font(12px, 12px, #fff,,)
     transform scale(0.8)
     transform-origin bottom
.item_tip
    _wh(100%, 32px)
    line-height 32px
    padding 0 10px
.item_tip_bg_l
    background center center / 100% 100% url(../../images/screen1/bg_title_j.png) no-repeat
.item_tip_bg_s
    background center center / 100% 100% url(../../images/screen1/bg_title_s.png) no-repeat
.item_tip_bg_m
    background center center / 100% 100% url(../../images/screen1/bg_title_l.png) no-repeat
.item_tip_left
    _wh(60%, 100%)
    font-family "SourceHanSansCN"
    _font(16px, inherit, #fff, 700, left)
    letter-spacing 2px
    text-shadow 0 0 9px #159AFF
    padding-left 34px
    background center left / 22px 22px url(../../images/screen1/bg_title_tip.png) no-repeat
.item_content
    _wh(100%, calc(100% - 38px))
    margin-top 7px
    overflow hidden
.item_content_1
  _fj()
  flex-direction column
.scroll_wrap
    _wh(100%, 100%)
    overflow hidden
    border 1px solid rgba(8,205,248,0.3)
.scroll_tab_1
    _wh(100%, 30px)
    border-bottom 1px solid rgba(8,205,248,0.3)
    li
      float left
      width 23%
      _font(12px,30px,#78B1DE,,center)
      word-wrap break-word
      word-break break-all
      white-space nowrap
      padding 0 2px
      overflow hidden
      box-sizing border-box
.scroll_tab_2
    _wh(100%, 30px)
    border-bottom 1px solid rgba(8,205,248,0.3)
    li
      float left
      width 23%
      _font(13px,30px,#78B1DE,,center)
      word-wrap break-word
      word-break break-all
      white-space nowrap
      padding 0 2px
      overflow hidden
      box-sizing border-box
.scroll_container_1
    width 100%
    overflow hidden
.scroll-ul_1
    li
      _wh(100%, 32px)
      border-bottom 1px solid rgba(8,205,248,0.3)
      &:nth-child(even)
          background rgba(1,24,52,0.60)
          box-shadow inset 0px 1px 0px 0px rgba(13,89,115,0.3)
    .scroll-ul_2_div
        float left
        _wh(23%, 32px)
        _fj(center)
        font-size: 12px;
        line-height: 13px;
        text-align: center;
        color: #fff;
        padding 0 5px
        word-break break-all
.scroll_container_2
    width 100%
    overflow hidden
.scroll-ul_2
    li
      _wh(100%, 32px)
      border-bottom 1px solid rgba(8,205,248,0.3)
      &:nth-child(even)
          background rgba(1,24,52,0.60)
          box-shadow inset 0px 1px 0px 0px rgba(13,89,115,0.3)
    .scroll-ul_2_div
        float left
        _wh(23%, 32px)
        _fj(center)
        font-size: 13px;
        line-height: 14px;
        text-align: center;
        color: #fff;
        padding 0 2px
        word-wrap break-word
        overflow-wrap break-word
.li
  _fj()
  _wh(100%, 36px)
  .li-right
    margin-left 20px
.li-left, .li-right
  _fj()
  width 49%
  background center / 100% 100% url(../../images/screen1/item_5.png) no-repeat
  padding 0 4%
.hwz_n
  _font(14px, 36px, #fff,,left)
.hwz_num
  _fj(flex-end)
  _font(12px, 36px, #fff, 700, right)
  span
    &:first-child
      color #f7b502
      margin-right 10px
      font-size 18px
.three_w_item
  // _wh(calc(50% - 15px), 100%)
  width 100%
  // height 200px
  background-image linear-gradient(to bottom, #040b1a, #050919)
  overflow hidden
  &:first-child
    margin-right 30px
.three_w_item
  height 130px
  overflow hidden
  .scroll-ul_1
    li
      line-height 26px
    span
      font-size 12px
      scale 0.9
</style>
