<template>
  <div class="skuForm">
    <div class="content">
      <template v-if="MonthDayList&&MonthDayList.length>0">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane v-for="(item,index) in MonthDayList" :key='index' :label="item.YearMonth">
            <template v-if="item.DateList && item.DateList.length>0">
              <table>
                <thead>
                  <tr>
                    <th>日期</th>
                    <th>价格</th>
                    <th>库存</th>
                    <th>成本</th>
                  </tr>
                </thead>
                <tbody v-for="(subItem,subIndex) in item.DateList">
                  <tr>
                    <td>
                      {{subItem.Day}}
                    </td>
                    <td>
                      <el-input v-model="subItem.SellingPrice" @keyup.native="checkPrice(subItem,'SellingPrice')"
                        size="small" style="width:100px;"></el-input>
                    </td>
                    <td>
                      <el-input v-model="subItem.InventoryNum" @keyup.native="checkPrice(subItem,'InventoryNum')"
                        size="small" style="width:100px;"></el-input>
                    </td>
                    <td>
                      <el-input v-model="subItem.CostMoney" @keyup.native="checkPrice(subItem,'CostMoney')"
                        size="small" style="width:100px;"></el-input>
                    </td>
                  </tr>
                </tbody>
              </table>
            </template>
          </el-tab-pane>
        </el-tabs>
      </template>
    </div>
  </div>
</template>

<script>
  export default {
    components: {},
    name: "skuForm",
    props: ["addMsg", "SpecificationValueList", "SpecificationList", "SpecificationPriceList"],
    data() {
      return {
        QMsg: {
          StartDate: "2024-01-01",
          EndDate: '2024-05-20'
        },
        MonthDayList: [], //
        activeName: ""
      }
    },
    created() {

    },
    mounted() {
      this.getDayData();
    },
    methods: {
      handleClick() {

      },
      getDayData() {
        this.apipost('/api/product/CreateSkuCalendar', this.QMsg,
          res => {
            if (res.data.resultCode === 1) {
              this.MonthDayList = res.data.data;
              this.Success(res.data.message)
            } else {
              this.Error(res.data.message);
            }
          },
          null
        );
      }
    },
  };

</script>

<style>

</style>
