<template>
  <div>


    <el-tabs type="border-card" style="margin: 15px" @tab-click="handleTabClick">
      <el-tab-pane label="未上传单" >
        <prescribePanel
          ref="prescribePanel1"
          style="margin: -15px"
          :tagStatus="3"
          :RowType="type"
          :workPlaceCode="workPlaceCode"
          :buttonType="1"
          :status="1"
        ></prescribePanel>
      </el-tab-pane>
      <el-tab-pane label="已上传单" name="second">
        <prescribePanel
          ref="prescribePanel2"
          style="margin: -15px"
          :tagStatus="3"
          :RowType="type"
          :workPlaceCode="workPlaceCode"
          :buttonType="2"
          :status="2"
        ></prescribePanel>
      </el-tab-pane>
    </el-tabs>


  </div>
</template>

<script>

import prescribePanel from "./PanelOrderUpload";

/**
 * 已完成处方
 */
export default {
  name: "PrescribeTagCode",
  components: {
    prescribePanel
  },
  data() {
    return {
      type: 1,
      workPlaceCode: null,
    }
  },
  methods: {
    handleTabClick(tab){
      if (tab.name === 'second') {
        if (this.$refs.prescribePanel2) {
          this.$refs.prescribePanel2.getList();
        }
      }else {
        this.$refs.prescribePanel1.getList();
      }
    }
  },
  created() {
    if (this.$route.query.workplaceId != null){
      this.workPlaceCode = Number(this.$route.query.workplaceId);
    }
  }

}
</script>

<style scoped>

</style>
