<template lang="html">
    <div class="sheet_demo">
         <div class='header' v-if='login'>
             欢迎您,{{info.sFullName}}。上次登录时间: {{login.login_time}}
        </div>
        <div class='body'>
             <div class='relevance' style='margin-top:30px'>
                       <el-row style='margin-top:35px;'>
                        <h5 style='color:#c0585e'>我的关联</h5>
                        <el-col :span="12">
                            <div class="box3">
                                 <h5>我的客户</h5>
                                 <div @click="go_relevance('1')">
                                        <a class='go_pae' style='font-size:19px;'>{{userInfo.customer_quantity}}</a>
                                  </div>
                            </div>
                        </el-col>
                        <el-col :span="12">
                             <div class="box3">
                                 <h5>我的供应商</h5>
                                 <div  @click="go_relevance('0')">
                                        <a style='font-size:19px;' class='go_pae'>{{userInfo.provider_quantity}}</a>
                                  </div>
                            </div>
                        </el-col>
                      </el-row>
                      <el-row style='margin-top:35px;'>
                        <h5 style='color:#c0585e'>本周订单发送详情</h5>
                        <el-col :span="24">
                            <div class="box2">
                                 <h5>采购订单</h5>
                                 <div class='min-box'>
                                        <div>{{userInfo.order_total}}</div>
                                        <div>总量</div>
                                  </div>
                                  <div class='min-box'>
                                        <div>{{userInfo.send_order_total}}</div>
                                        <div>已发送</div>
                                  </div>
                                  <div class='min-box'>
                                        <div>{{userInfo.unsend_order_total}}</div>
                                        <div>未发送</div>
                                  </div>
                                  <div class='min-box'>
                                        <div>{{userInfo.finish_order_total}}</div>
                                        <div>已完结</div>
                                  </div>
                                  <div class='min-box'>
                                        <div>{{userInfo.onorder_total}}</div>
                                        <div>在途订单</div>
                                  </div>
                            </div>
                            <div class="box2">
                                 <h5>出货单</h5>
                                 <div class='min-box'>
                                        <div>{{userInfo.shipment_total}}</div>
                                        <div>总量</div>
                                  </div>
                                  <div class='min-box'>
                                        <div>{{userInfo.send_shipment_total}}</div>
                                        <div>已发送</div>
                                  </div>
                                  <div class='min-box'>
                                        <div>{{userInfo.unsend_shipment_total}}</div>
                                        <div>未发送</div>
                                  </div>
                                  <div class='min-box'>
                                        <div>{{userInfo.finish_shipment_total}}</div>
                                        <div>已完结</div>
                                  </div>
                                  <div class='min-box'>
                                        <div>{{userInfo.onshipment_total}}</div>
                                        <div>在途出货单</div>
                                  </div>
                            </div>
                        </el-col>
                      </el-row>
                </div>
        </div>
    </div>
</template>
<script scoped>
import utilSingeUc from '@basicClass/util_singe_uc.js'
import axios from 'axios'
export default {
  mixins: [utilSingeUc],
  data() {
    return {
      login: '',
      info: {},
      tableData: [],
      userInfo: {}
    }
  },
  methods: {
    //   去关联
    go_relevance(val) {
      this.$router.push({ path: '/hsEdi/relevance', query: { type: val }})
    },
    // 获取公司关联的
    get_c_list() {
      axios.get('mesAPI/home/').then(res => {
        this.userInfo = res.data
      })
    }
  },
  computed: {},
  activated() {
    if (sessionStorage.mes_token) {
      const user = JSON.parse(sessionStorage.user)
      const login = JSON.parse(sessionStorage.loginlog)
      this.info = user
      if (login) {
        this.login = login
      }
      // this.get_c_list()
    } else {
      this.$router.push({ path: '/login' })
    }
  }
}
</script>
<style scoped>
.box3 {
  min-height: 150px;
  border: 1px solid #d2d0d0;
  background: #f0f1f5;
  margin: 0 auto;
  width: 100%;
  display: inline-block;
}
.box2 {
  width: 100%;
  min-height: 150px;
  border: 1px solid #d2d0d0;
  background: #f0f1f5;
  margin: 0 auto;
}
.min-box {
  width: 19%;
  border-right: 1px solid #d2d0d0;
  font-size: 18px;
  color: #333333;
  padding-bottom: 10px;
  display: inline-block;
}
.relevance {
  width: 90%;
  margin: auto;
}
.relevance >>> h5 {
  color: #89b4f6;
  text-align: left;
  margin-bottom: 30px;
  font-size: 16px;
}
.go_pae {
  color: #89b4f6;
  font-size: 16px;
}
.box2 >>> h5 {
  margin-left: 8px;
  margin-top: 5px;
  font-size: 14px;
}
.box3 >>> h5 {
  color: #89b4f6;
  text-align: left;
  margin-left: 8px;
  margin-top: 5px;
  margin-bottom: 30px;
  font-size: 14px;
}
.count {
  font-size: 24px;
  margin: 40px auto;
  color: #89b4f6;
}
.header {
  width: 100%;
  height: 30px;
  text-align: center;
  background: #f1f2f6;
  margin: auto;
  font-size: 16px;
  color: #9d9da1;
  line-height: 30px;
}
.body {
  width: 95%;
  background: #fff;
  margin: auto;
  padding-top: 10px;
}
.b_head {
  widows: 100%;
  height: 60px;
  border-bottom: 1px dashed #9d9da1;
  font-size: 14px;
  color: #9d9da1;
}
.b_head > span {
  color: #009bdb;
  line-height: 70px;
}
.sheet_demo >>> .relevance {
  widows: 98%;
  text-align: center;
}
.relevance >>> .el-input-group {
  width: 40%;
  margin: 45px auto;
}
.relevance >>> .el-button {
  background: #169bd5;
  color: #fff;
}
</style>
