<template>
  <div>


    <el-tabs type="border-card" style="margin: 15px">

      <el-tab-pane label="待处理单据">
        <CollectOrderAllotCardComponents style="margin: -15px"
                                         :tagStatus="'1'"
                                         :workPlaceCode="workPlaceCode"
                                         @parent-method="parentMethod"
        ></CollectOrderAllotCardComponents>
      </el-tab-pane>

      <el-tab-pane label="未分配工位单据">
        <CollectOrderAllotComponents
          style="margin: -15px"
          :tagStatus="'0'"
          :viewType="1"
          :workPlaceCode="workPlaceCode"
        ></CollectOrderAllotComponents>
      </el-tab-pane>



    </el-tabs>

  </div>
</template>

<script>

import CollectOrderAllotComponents from "./CollectOrderAllotComponents.vue";
import CollectOrderAllotCardComponents from "./CollectOrderAllotCardComponents.vue";


/**
 * 已完成处方
 */
export default {
  name: "PrescribeTagCode",
  components: {
    CollectOrderAllotComponents,CollectOrderAllotCardComponents
  },
  data() {
    return {
      workPlaceCode: null,
    }
  },
  methods: {
    parentMethod(data,url) {
      // 处理从子组件传来的数据
      if (this.workPlaceCode == null){
        this.callParentMethod(url)
      }else {
        this.callParentMethodA(data)
      }

    },
    callParentMethodA(val) {
      // 触发自定义事件 'parent-method'
      this.$emit('parent-method', val); // someData 是你想要传递给父组件的数据
    },
    callParentMethod(val) {
      window.open(val, '_blank');
    },
  },
  created() {
    if (this.$route.query.workplaceId != null){
      this.workPlaceCode = Number(this.$route.query.workplaceId);
    }
  }
}
</script>

<style scoped>

</style>
