<template>
  <el-collapse v-loading="loading" v-model="activeNames" v-if="baseProductList.length > 0">
    <el-collapse-item title="产品起停售申请" name="app">
      <ApplyProduct :base-product-list="baseProductList" />
    </el-collapse-item>
    <el-collapse-item title="产品起停售查看" name="query">
      <ApplyLook :base-product-list="baseProductList" />
    </el-collapse-item>
  </el-collapse>
</template>

<script setup name="Product-Apply" lang="ts">
import ApplyProduct from '@/views/product/apply/apply_product.vue';
import ApplyLook from '@/views/product/apply/apply_look.vue';
import { qeuryAllProduct } from '@/api/product/apply';

const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const activeNames = ref(['app']);
const baseProductList = ref([]);
const loading = ref(false);
/** 初始化产品下拉列表 */
const quryTemplateList = async () => {
  loading.value = true;
  const res = await qeuryAllProduct();
  baseProductList.value = res.data;
  loading.value = false;
};
onMounted(() => {
  quryTemplateList();
});
</script>
<style scoped lang="scss"></style>
