gaoluyang
18 小时以前 e0cb2008ffb01348b54a7370180a100f3c975877
src/views/inventoryManagement/stockReport/index.vue
@@ -48,7 +48,7 @@
          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>
@@ -230,15 +230,23 @@
             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
@@ -266,6 +274,13 @@
  chartData: null,
  tableData: []
})
const page = reactive({
  current: 1,
  size: 10,
})
const total = ref(0)
const stockRecordTypeOptions = ref([])
@@ -297,6 +312,7 @@
// 报表类型改变
const handleReportTypeChange = () => {
  page.current = 1
  reportData.value = {
    summary: null,
    chartData: null,
@@ -312,7 +328,12 @@
  
  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') {
@@ -321,7 +342,8 @@
      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(() => {
@@ -334,6 +356,19 @@
  } finally {
    tableLoading.value = false
  }
}
// 查询按钮:重置到第一页并查询
const onSearch = () => {
  page.current = 1
  handleQuery()
}
// 分页变化
const paginationChange = (obj) => {
  page.current = obj.page
  page.size = obj.limit
  handleQuery()
}
// // 生成假数据
// const generateMockData = () => {
@@ -554,6 +589,8 @@
  ]
  fetchStockRecordTypeOptions()
  // 初始化加载一次数据
  handleQuery()
})
</script>