This commit is contained in:
gyq
2024-07-10 09:48:24 +08:00
parent c1eda32f29
commit 66f8f95cda

View File

@@ -7,18 +7,24 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getTableData">查询</el-button> <el-button type="primary" @click="getTableData">查询</el-button>
<el-button>重置</el-button> <el-button @click="resetHandle">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="head-container"> <div class="head-container">
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id" <el-table
height="66vh"> ref="table"
:data="clickseetableData.data"
v-loading="clickseetableData.loading"
row-key="id"
height="66vh"
>
<el-table-column label="耗材名称" prop="conName" /> <el-table-column label="耗材名称" prop="conName" />
<el-table-column label="变动库存" prop="amount"> <el-table-column label="变动库存" prop="amount">
<template v-slot="scope"> <template v-slot="scope">
<span :class="{ red: scope.row.bizType == '-' }">{{ scope.row.bizType }}{{ scope.row.amount <span :class="{ red: scope.row.bizType == '-' }"
}}</span> >{{ scope.row.bizType }}{{ scope.row.amount }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="现有库存" prop="balance" /> <el-table-column label="现有库存" prop="balance" />
@@ -36,21 +42,31 @@
</el-table> </el-table>
</div> </div>
<div class="head-container"> <div class="head-container">
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1" <el-pagination
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper" :total="clickseetableData.total"
:current-page="clickseetableData.page + 1"
:page-size="clickseetableData.size"
layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChangetype" @current-change="paginationChangetype"
@size-change="e => { clickseetableData.size = e; clickseetableData.page = 0; getTableData() }" /> @size-change="
e => {
clickseetableData.size = e;
clickseetableData.page = 0;
getTableData();
}
"
/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { gettbConsInfoFlow } from '@/api/consumable' import { gettbConsInfoFlow } from "@/api/consumable";
export default { export default {
data() { data() {
return { return {
query: { query: {
conName: '' conName: ""
}, },
clickseetableData: { clickseetableData: {
data: [], data: [],
@@ -58,39 +74,45 @@ export default {
size: 30, size: 30,
loading: false, loading: false,
total: 0 total: 0
},
} }
};
}, },
mounted() { mounted() {
this.getTableData() this.getTableData();
}, },
methods: { methods: {
resetHandle() {
this.clickseetableData.page = 0;
this.clickseetableData.size = 30;
this.query.conName = "";
this.getTableData();
},
pageSizeChange(e) { pageSizeChange(e) {
this.clickseetableData.size = e this.clickseetableData.size = e;
this.getTableData() this.getTableData();
}, },
paginationChangetype(e) { paginationChangetype(e) {
this.clickseetableData.page = e - 1 this.clickseetableData.page = e - 1;
this.getTableData() this.getTableData();
}, },
// 查看查询耗材流水信息 // 查看查询耗材流水信息
async getTableData() { async getTableData() {
try { try {
this.clickseetableData.loading = true this.clickseetableData.loading = true;
const res = await gettbConsInfoFlow({ const res = await gettbConsInfoFlow({
page: this.clickseetableData.page, page: this.clickseetableData.page,
size: this.clickseetableData.size, size: this.clickseetableData.size,
consId: '', consId: "",
conName: this.query.conName, conName: this.query.conName,
shopId: localStorage.getItem('shopId') shopId: localStorage.getItem("shopId")
}) });
this.clickseetableData.loading = false this.clickseetableData.loading = false;
this.clickseetableData.data = res.content this.clickseetableData.data = res.content;
this.clickseetableData.total = res.totalElements this.clickseetableData.total = res.totalElements;
} catch (error) { } catch (error) {
console.log(error) console.log(error);
} }
} }
} }
} };
</script> </script>