|
|
@ -3,6 +3,16 @@ |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="BalanceSummarySearch.allSchemas.searchSchema" @search="searchList" @reset="searchList" @searchTableSuccess="searchQueryTableSuccess"/> |
|
|
|
</ContentWrap> |
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:route-name="routeName" |
|
|
|
:allSchemas="BalanceSummary.allSchemas" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 用于查看前端页面的测试数据 --> |
|
|
|
<!-- :data="tableData" --> |
|
|
|
<el-table |
|
|
|
:data="tableData" |
|
|
|
style="width: 100%" |
|
|
@ -16,7 +26,16 @@ |
|
|
|
</el-table> |
|
|
|
</template> |
|
|
|
<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 { 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) |
|
|
|
console.log('tableColumns',tableColumns) |
|
|
|
const tableData= ref([ |
|
|
@ -46,8 +65,23 @@ const tableData= ref([ |
|
|
|
num: 4, |
|
|
|
}, |
|
|
|
]) |
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: BalanceApi.getBalanceSummaryPageAll // 分页接口 |
|
|
|
}) |
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList, setSearchParams } = tableMethods |
|
|
|
getList() |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|
}) |
|
|
|
|
|
|
|
const load = ( row, treeNode,resolve) => { |
|
|
|
console.log('load',row, treeNode,resolve) |
|
|
|
console.log('tableData',tableData.value) |
|
|
|
setTimeout(() => { |
|
|
|
resolve([ |
|
|
|
{ |
|
|
@ -69,7 +103,7 @@ const load = ( row, treeNode,resolve) => { |
|
|
|
|
|
|
|
const searchList = (model)=>{ |
|
|
|
console.log('searchList',model) |
|
|
|
|
|
|
|
setSearchParams(model) |
|
|
|
} |
|
|
|
|
|
|
|
const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
@ -81,5 +115,36 @@ const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row |
|
|
|
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> |
|
|
|
<style lang="scss" scoped></style> |