<template>
  <div style="background-color: #eeeeee;min-height: 100vh;">
    <div style="display: flex;padding: 4% 1% 4% 1%;">
      <button disabled style="color: #d9d9d9" type="button" class="btn" size="mini">提前计划</button>
      <button disabled style="color: #d9d9d9" type="button" class="btn" size="mini">未总结
      </button>
      <button disabled style="color: #d9d9d9" type="button" class="btn" size="mini">完工总结
      </button>
      <button type="button" class="btn" style="background-color: #fde866;" size="mini">状态查询
      </button>
      <button disabled style="color: #d9d9d9" type="button" class="btn" size="mini">2周计划</button>
    </div>
    <div style="padding: 0 0 10% 4%;width: 92%">
      <div style="background-color: white;border-radius: 10px;padding: 4% 4% 5% 4%;min-height: 78vh">
        <!--        列表部分-->
        <div>
          <div>
            <tr class="th-row"
                style="display: flex;font-size: 12px;border: 2px solid #FDE866;font-weight: bold">
              <td class="th-td" style="width: 30%;">序号</td>
              <td class="th-td" style="width: 70%;">未总结时间</td>
            </tr>
          </div>
          <div v-for="(item,index) in dataList" :key="index"
               style="border-right: 2px solid #fde866;border-left: 2px solid #fde866;">
            <tr class="th-row">
              <td class="th-td" style="width: 30%;">{{ index + 1 }}</td>
              <td class="th-td" style="width: 70%;">{{ item.planTime }}</td>
            </tr>
          </div>
          <div v-if="!dataList.length > 0" style="text-align: center;font-size: 14px;">
            暂无数据
          </div>
          <div style="border-bottom: 2px solid #fde866"></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name: "状态查询",
  data() {
    return {
      //获取的列表包括查询出来的
      dataList: []
    }
  },
  methods: {
    addEdit(url) {
      //console.log(url);
      wx.navigateTo({
        url: url
      })
    },
    closePage() {
      wx.navigateBack({
        delta: 1
      })
    },
    //获取所有的提料列表 未含有翻页 包含数据处理
    searList() {
      this.dataList = [];
      this.$http.request({
        url: this.$http.adornUrl('/business/businessplan/uncommittedList'),
        method: 'get',
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.dataList = data.page;
        } else {
          this.closePage();
        }
      })
    }
  },
  onLoad() {
    wx.setNavigationBarTitle({
      title: '明日计划-状态查询'
    })
    this.searList();
  },
  onShow () {
    this.searList();
  }
}
</script>

<style scoped>
.btn {
  text-align: center;
  border-radius: 8px;
  width: 20%;
  height: 25px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
}

/************** 列表 ****************/
.th-row {
  display: flex;
  font-size: 12px;
  border: 1px solid #efeded;
}

.th-td {
  min-height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  border-right: 2px solid #efeded;
}

</style>
