2026-03-18 17:47:15 +08:00

119 lines
2.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="container">
<el-button-group class="toolbar-btn-group">
<el-button
type="primary"
size="small"
icon="Refresh"
@click="loadData"
title="刷新"
:loading="loading"
class="toolbar-btn"
>
刷新
</el-button>
<el-button
type="success"
size="small"
icon="Download"
@click="goToStorageLog"
title="库存流水"
class="toolbar-btn"
>
库存流水
</el-button>
</el-button-group>
<el-table
:data="tableData"
border
style="width: 100%"
:height="tableHeight"
v-loading="loading"
>
<el-table-column
fixed
prop="zone_name"
label="库区"
width="150"
/>
<el-table-column
prop="location_code"
label="库位"
width="120"
/>
<el-table-column
prop="quantity"
label="数量"
/>
<el-table-column
prop="batch_no"
label="批次"
/>
<el-table-column
prop="production_date"
label="生产日期"
/>
<el-table-column
prop="expiration_date"
label="过期日期"
/>
<el-table-column
prop="stock_type"
label="库存类型"
/>
</el-table>
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import { Refresh, Download } from '@element-plus/icons-vue'
// import * as stockApi from '@/api/stock'
const router = useRouter()
const loading = ref(false)
const tableData = ref<any[]>([])
const tableHeight = computed(() => {
return window.innerHeight - 300
})
function loadData() {
loading.value = true
// 暂无库存详情接口,保持与Vue2一致
setTimeout(() => {
loading.value = false
}, 500)
}
function goToStorageLog() {
router.push('/storage/log')
}
function handleClick(row: any) {
console.log(row)
}
</script>
<style scoped lang="scss">
.container {
height: 100%;
padding: 20px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.toolbar-btn-group {
margin-bottom: 10px;
}
.el-table {
flex: 1;
overflow-y: auto;
}
</style>