<template>
  <div class="app-container">
    <el-tabs type="border-card">
      <el-tab-pane label="申请信息" style="height:700px;overflow-y:auto;overflow-x:hidden;">
        <CCCform :action="action" @handleCommit="save" :certapp="certapp" v-if="kind=='CCC'"></CCCform>
        <QMSform :action="action" @handleCommit="save" :certapp="certapp" v-if="kind=='QMS'"></QMSform>
      </el-tab-pane>
      <el-tab-pane label="受理信息" style="height:700px;overflow-y:auto;overflow-x:hidden;" v-if="certapp&&kind=='QMS'">
        <review :action="action"  :certapp="certapp" v-if="kind=='QMS'"></review>
      </el-tab-pane>
      <el-tab-pane label="产品单元" style="height:700px;overflow-y:auto;overflow-x:hidden;" v-if="certapp">

      </el-tab-pane>
      <el-tab-pane label="原材料供应商" style="height:700px;overflow-y:auto;overflow-x:hidden;" v-if="certapp">
      </el-tab-pane>
      <el-tab-pane label="检测设备" style="height:700px;overflow-y:auto;overflow-x:hidden;" v-if="certapp">

      </el-tab-pane>
      <el-tab-pane label="资料评审" style="height:700px;overflow-y:auto;overflow-x:hidden;" v-if="certapp">

      </el-tab-pane>
      <el-tab-pane label="收费信息" style="height:700px;overflow-y:auto;overflow-x:hidden;" v-if="certapp">
        <charge :action="action" @handleCommit="save" :certapp="certapp" v-if="kind=='QMS'"></charge>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import CCCform from "@/views/certapp/cccform"
  import QMSform from "@/views/certapp/qmsform"
  import review from "@/views/certapp/review"
  import charge from "@/views/certapp/charge"
export default {
  components: { CCCform,QMSform,review ,charge},
  props: [],
  data() {
    return {
      action:null,
      certapp:null,
      kind:null
    };
  },
  computed: {},
  watch: {
    // "formData.cert_field": "changeRules"
  },
  created() {
    this.getParams()
  },
  mounted() {},
  methods: {
      getParams(){
          var action = this.$route.params.action
          var kind = this.$route.params.kind
          this.action = action
          this.kind = kind
          if(action=='update'){
            this.certapp = this.$route.query.id
          }
      },
      save(val){
        this.certapp=val.id
      }
  }
};
</script>
