<template>
  <view class="page-css">
    <view class="page-header-txt">科研医疗建筑运维平台</view>
    <betone-list :tabList="tabList" ref="tablist"></betone-list>
    <betone-tabbar ref="tabbarRef" />
  </view>
</template>

<script>
export default {

  data() {
    return {
      tabList: [

      ],
    };
  },
  computed: {

    dataTypes() {
      return this.$store.state.dataType
    },
  },
  onReachBottom() {
    uni.$emit('onReachBottom');

  },
  onPullDownRefresh() {
    uni.$emit('onPullDownRefresh');
  },
  onShow() {
    this.$nextTick(() => {
      this.$refs.tablist.getRecordsList()
      this.$refs.tabbarRef.getPermission();
      // 2 客服  3 维修负责人  4  维修人员
      if (this.dataTypes == 2) {
        this.tabList = [
          {
            name: "全部",
            key: "9999",
          },
          {
            name: "待接单",
            key: "0",
          },
          {
            name: "待维修",
            key: "1,2,3,4",
          },
          {
            name: "维修中",
            key: "5",
          },
          {
            name: "维修完成",
            key: "6",
          },
          {
            name: "待付款",
            key: "7",
          },
          {
            name: "已完成",
            key: "8,9",
          },
          
        ]
      }
      // 维修负责人  1839537055389515777
      if (this.dataTypes == 3) {
        this.tabList = [
          {
            name: "全部",
            key: "9999",
          },
          {
            name: "已驳回",
            key: "2",
          },
          {
            name: "待审批",
            key: "3",
          },
          {
            name: "已通过",
            key: "4",
          },
          {
            name: "维修中",
            key: "5",
          },
          {
            name: "维修完成",
            key: "6",
          },
          {
            name: "待付款",
            key: "7",
          },
          {
            name: "已完成",
            key: "8,9",
          },
        ]
      }
      // 维修人员  1839552581620793346
      if (this.dataTypes == 4) {
        this.tabList = [
          {
            name: "全部",
            key: "9999",
          },
          {
            name: "待确认",
            key: "1",
          },
          {
            name: "待提交",
            key: "2",
          },
          {
            name: "待审批",
            key: "3,4",
          },
          {
            name: "已驳回",
            key: "0",
          },
          {
            name: "维修中",
            key: "5",
          },
          {
            name: "维修完成",
            key: "6,7,8,9",
          },
        ]
      }
    });
  },
  methods: {

  },
};
</script>

<style lang="scss" scoped>
.page-css {
  padding: 0;
  padding-top: var(--status-bar-height);
}
</style>