| | |
| | | <!-- 在你的主页面中 --> |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-tabs v-model="activeTab" @tab-change="handleTabChange"> |
| | | <el-tab-pane v-for="tab in tabs" |
| | | :label="tab.label" |
| | | :name="tab.name" |
| | | :key="tab.name"> |
| | | <record :type="tab.type" v-if="activeTab === tab.name" /> |
| | | <el-tab-pane |
| | | v-for="tab in tabs" |
| | | :label="tab.label" |
| | | :name="tab.name" |
| | | :key="tab.name" |
| | | > |
| | | <component |
| | | :is="tab.component" |
| | | v-if="activeTab === tab.name" |
| | | :stock-type="tab.name" |
| | | /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import Record from "@/views/inventoryManagement/dispatchLog/Record.vue"; |
| | | import { ref, shallowRef } from 'vue' |
| | | import QualifiedRecord from "@/views/inventoryManagement/dispatchLog/Qualified.vue"; |
| | | import UnqualifiedRecord from "@/views/inventoryManagement/dispatchLog/Unqualified.vue"; |
| | | import RawMaterialRecord from "@/views/inventoryManagement/dispatchLog/RawMaterial.vue" |
| | | |
| | | const activeTab = ref('qualified') |
| | | const type = ref(0) |
| | | const tabs = computed(() => { |
| | | return [ |
| | | { |
| | | label: '合格出库', |
| | | name: 'qualified', |
| | | type: '0' |
| | | }, |
| | | { |
| | | label: '不合格出库', |
| | | name: 'unqualified', |
| | | type: '1' |
| | | } |
| | | ] |
| | | }) |
| | | |
| | | const tabs = shallowRef([ |
| | | { |
| | | label: '成品出库', |
| | | name: 'qualified', |
| | | component: QualifiedRecord |
| | | }, |
| | | { |
| | | label: '辅材出库', |
| | | name: 'assistant', |
| | | component: UnqualifiedRecord |
| | | }, |
| | | { |
| | | label: '原材料出库', |
| | | name: 'rawMaterial', |
| | | component: RawMaterialRecord |
| | | } |
| | | ]) |
| | | |
| | | const handleTabChange = (tabName) => { |
| | | activeTab.value = tabName; |
| | | type.value = tabName === 'qualified' ? 0 : 1 |
| | | } |
| | | </script> |