Browse Source

HL-5809增加库存汇总查询页面,页面参考备注中的截图

hella_online_20240904
yufei_wang 3 months ago
parent
commit
ff01c82eb6
  1. 10
      src/api/wms/balance/index.ts
  2. 67
      src/views/wms/inventoryManage/balanceSummary/index.vue

10
src/api/wms/balance/index.ts

@ -53,6 +53,16 @@ export const getBalancePageAll = async (params) => {
} }
} }
// 查询库存余额列表(包括已冻结,已失效的物料)
export const getBalanceSummaryPageAll = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/balance/seniorAll', data })
} else {
return await request.get({ url: `/wms/balance/pageAll`, params })
}
}
// 查询库存余额列表 // 查询库存余额列表
export const getBalancePageReturn= async (params) => { export const getBalancePageReturn= async (params) => {
if (params.isSearch) { if (params.isSearch) {

67
src/views/wms/inventoryManage/balanceSummary/index.vue

@ -3,6 +3,16 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="BalanceSummarySearch.allSchemas.searchSchema" @search="searchList" @reset="searchList" @searchTableSuccess="searchQueryTableSuccess"/> <Search :schema="BalanceSummarySearch.allSchemas.searchSchema" @search="searchList" @reset="searchList" @searchTableSuccess="searchQueryTableSuccess"/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:route-name="routeName"
:allSchemas="BalanceSummary.allSchemas"
/>
<!-- 用于查看前端页面的测试数据 -->
<!-- :data="tableData" -->
<el-table <el-table
:data="tableData" :data="tableData"
style="width: 100%" style="width: 100%"
@ -16,7 +26,16 @@
</el-table> </el-table>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import * as BalanceApi from '@/api/wms/balance'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { BalanceSummary,BalanceSummarySearch } from './balanceSummary.data' import { BalanceSummary,BalanceSummarySearch } from './balanceSummary.data'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
import download from '@/utils/download'
const message = useMessage() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(BalanceSummary.allSchemas.tableColumns) const tableColumns = ref(BalanceSummary.allSchemas.tableColumns)
console.log('tableColumns',tableColumns) console.log('tableColumns',tableColumns)
const tableData= ref([ const tableData= ref([
@ -46,8 +65,23 @@ const tableData= ref([
num: 4, num: 4,
}, },
]) ])
const { tableObject, tableMethods } = useTable({
getListApi: BalanceApi.getBalanceSummaryPageAll //
})
//
const { getList, setSearchParams } = tableMethods
getList()
/** 初始化 **/
onMounted(async () => {
getList()
})
const load = ( row, treeNode,resolve) => { const load = ( row, treeNode,resolve) => {
console.log('load',row, treeNode,resolve) console.log('load',row, treeNode,resolve)
console.log('tableData',tableData.value)
setTimeout(() => { setTimeout(() => {
resolve([ resolve([
{ {
@ -69,7 +103,7 @@ const load = ( row, treeNode,resolve) => {
const searchList = (model)=>{ const searchList = (model)=>{
console.log('searchList',model) console.log('searchList',model)
setSearchParams(model)
} }
const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => {
@ -81,5 +115,36 @@ const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:balance:export'}), //
defaultButtons.defaultFreshBtn(null),//
]
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await BalanceApi.exportBalance(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
Loading…
Cancel
Save