<template>
    <div class="platformorderPop">
        <Tooltip placement="right" transfer class="delayTooltip" delay="600">
            <div style="width: 100%;color: #2D8cF0;" @mouseenter="getLackStockList(params)">
                {{ params.value }}
            </div>
            <div slot="content">
                <div v-if="LackStockData.length > 0">
                  <div v-for="(stock,index) in LackStockData" :key="index">{{ stock.STORENAME }}仓：{{ stock.QTYFEE }}</div>
                </div>
                <div v-else>无数据</div>
            </div>
        </Tooltip>
    </div>
  </template>  
   <script type="text/ecmascript-6">
    // 折叠面板组件 
    const R3 = window.R3;
  
    const { network, urlSearchParams, store } = R3; 
    export default {     
      name: '',      
      props: {  
        params: { 
          type: Object,         
          default: () => ({})       
        }     
      }, 
      data() {
        return {
          LackStockData: [],
          isMoreFive: false,
        };
      },
      methods: {
        showPopperList() {
          if (window.location.href.indexOf('T_RB_LACKSKUDETAIL') > -1) {
            setTimeout(() => {
              this.clearPopTipList();
            }, 1);
          }
        },
        clearPopTipList() {
          let getListReturnTableList = document.getElementsByClassName('getListReturnTable');
          for (let i = 0; i < getListReturnTableList.length; i++) {
            let objNode = getListReturnTableList[i].parentElement.parentElement.parentElement.parentElement;
            objNode.style.display = 'none';
          }
        },
        getLackStockList(params) {
          let param = {
            ordershopid: params.data.ORDERSHOPID.refobjid,
            ieswarehouseid: params.data.IESWAREHOUSEID.refobjid,
            sku: params.data.IESSKUID.val
          }
          network.post('/p/cs/lackSkuDetail/query',param).then(res => {
            if(res.data.code == 0){
              if(res.data.data && res.data.data.length > 0){
                this.LackStockData = res.data.data;
              }else {
                this.LackStockData = [];
              }
            }
          })
        }
      }
    }; 
  </script>  
  <style lang="scss">
    .platformorderPop .ark-tooltip {
      width: 100%;
    }
    .platformorderPop .ark-tooltip-inner {
      max-width: 600px;
      padding: 24px;
    }
    .getListReturnTable.ark-table-wrapper {
      border: none !important;
      margin-top: -10px;
    }
  </style>  
  