<template>
|
<div class="app-container">
|
<div class="search_form">
|
<div>
|
<span class="search_title ml10">产品名称:</span>
|
<el-input
|
v-model="searchForm.productName"
|
style="width: 240px"
|
placeholder="请输入"
|
clearable
|
@keyup.enter="handleQuery"
|
/>
|
<el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button>
|
</div>
|
</div>
|
|
<div class="table_list">
|
<el-table
|
:data="tableData"
|
border
|
v-loading="tableLoading"
|
style="width: 100%"
|
height="calc(100vh - 18.5em)"
|
>
|
<el-table-column align="center" label="序号" type="index" width="60" />
|
<el-table-column label="产品名称" prop="productName" min-width="180" show-overflow-tooltip />
|
<el-table-column label="规格型号" prop="model" min-width="160" show-overflow-tooltip />
|
<el-table-column label="单位" prop="unit" width="100" show-overflow-tooltip />
|
<el-table-column label="库存数量" prop="qualitity" width="110" show-overflow-tooltip />
|
<el-table-column label="冻结数量" prop="lockedQuantity" width="110" show-overflow-tooltip />
|
<el-table-column label="最近更新时间" prop="updateTime" width="180" show-overflow-tooltip />
|
<el-table-column label="备注" prop="remark" min-width="140" show-overflow-tooltip />
|
</el-table>
|
|
<Pagination
|
v-show="total > 0"
|
:total="total"
|
:page="page.current"
|
:limit="page.size"
|
@pagination="paginationChange"
|
/>
|
</div>
|
</div>
|
</template>
|
|
<script setup>
|
import { reactive, ref, toRefs } from "vue";
|
import Pagination from "@/components/PIMTable/Pagination.vue";
|
import { getConsumablesUninventoryListPage } from "@/api/consumablesLogistics/consumablesUninventory.js";
|
|
const tableData = ref([]);
|
const tableLoading = ref(false);
|
|
const page = reactive({
|
current: 1,
|
size: 100,
|
});
|
const total = ref(0);
|
|
const data = reactive({
|
searchForm: {
|
productName: "",
|
},
|
});
|
const { searchForm } = toRefs(data);
|
|
const handleQuery = () => {
|
page.current = 1;
|
getList();
|
};
|
|
const paginationChange = obj => {
|
page.current = obj.page;
|
page.size = obj.limit;
|
getList();
|
};
|
|
const getList = () => {
|
tableLoading.value = true;
|
getConsumablesUninventoryListPage({ ...searchForm.value, ...page })
|
.then(res => {
|
tableData.value = res?.data?.records || [];
|
total.value = res?.data?.total || 0;
|
})
|
.finally(() => {
|
tableLoading.value = false;
|
});
|
};
|
|
getList();
|
</script>
|