| | |
| | | style="width: 240px;" |
| | | /> |
| | | |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px"> |
| | | <el-button type="primary" @click="onSearch" style="margin-left: 10px"> |
| | | 查询 |
| | | </el-button> |
| | | <el-button @click="handleReset">重置</el-button> |
| | |
| | | show-overflow-tooltip |
| | | /> |
| | | </el-table> |
| | | <pagination |
| | | :total="total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationChange" |
| | | /> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted, nextTick } from 'vue' |
| | | import { ref, reactive, onMounted, nextTick, getCurrentInstance } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import * as echarts from 'echarts' |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { |
| | | getStockInventoryInAndOutReportList, |
| | | getStockInventoryReportList |
| | |
| | | chartData: null, |
| | | tableData: [] |
| | | }) |
| | | |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | }) |
| | | |
| | | const total = ref(0) |
| | | |
| | | const stockRecordTypeOptions = ref([]) |
| | | |
| | |
| | | |
| | | // 报表类型改变 |
| | | const handleReportTypeChange = () => { |
| | | page.current = 1 |
| | | reportData.value = { |
| | | summary: null, |
| | | chartData: null, |
| | |
| | | |
| | | tableLoading.value = true |
| | | try { |
| | | const params = getQueryParams() |
| | | const baseParams = getQueryParams() |
| | | const params = { |
| | | ...baseParams, |
| | | current: page.current, |
| | | size: page.size, |
| | | } |
| | | let response |
| | | |
| | | if (searchForm.reportType === 'inout') { |
| | |
| | | response = await getStockInventoryReportList(params) |
| | | } |
| | | if (response.code === 200) { |
| | | reportData.value.tableData = response.data.records |
| | | reportData.value.tableData = response.data.records || [] |
| | | total.value = response.data.total || 0 |
| | | // reportData.value.summary = response.data.summary |
| | | // reportData.value.chartData = response.data.chartData |
| | | // nextTick(() => { |
| | |
| | | } finally { |
| | | tableLoading.value = false |
| | | } |
| | | } |
| | | |
| | | // 查询按钮:重置到第一页并查询 |
| | | const onSearch = () => { |
| | | page.current = 1 |
| | | handleQuery() |
| | | } |
| | | |
| | | // 分页变化 |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page |
| | | page.size = obj.limit |
| | | handleQuery() |
| | | } |
| | | // // 生成假数据 |
| | | // const generateMockData = () => { |
| | |
| | | ] |
| | | |
| | | fetchStockRecordTypeOptions() |
| | | // 初始化加载一次数据 |
| | | handleQuery() |
| | | }) |
| | | </script> |
| | | |