Browse Source

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

hella_online_20240904
yufei_wang 2 months ago
parent
commit
82cb30fb5d
  1. 10
      src/views/wms/inventoryManage/balanceSummary/balanceSummary.data.ts
  2. 142
      src/views/wms/inventoryManage/balanceSummary/index.vue

10
src/views/wms/inventoryManage/balanceSummary/balanceSummary.data.ts

@ -66,30 +66,30 @@ export const BalanceSummary = useCrudSchemas(
},
{
label: '总数',
field: 'num1',
field: 'totalQty',
sort: 'custom'
},
{
label: '合格数',
field: 'num2',
field: 'qualifiedQty',
sort: 'custom',
isSearch: true
},
{
label: '待检数',
field: 'num2',
field: 'pendingQty',
sort: 'custom',
isSearch: true
},
{
label: '隔离数',
field: 'num2',
field: 'isolatedQty',
sort: 'custom',
isSearch: true
},
{
label: '不合格数',
field: 'num2',
field: 'unqualifiedQty',
sort: 'custom',
isSearch: true
}

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

@ -16,7 +16,7 @@
<el-table
:data="tableData"
style="width: 100%"
row-key="id"
row-key="uid"
border
lazy
:load="load"
@ -39,72 +39,96 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(BalanceSummary.allSchemas.tableColumns)
console.log('tableColumns',tableColumns)
const tableData= ref([
{
id: 1,
date: '2016-05-02',
name: 'wangxiaohu',
num: 1,
},
{
id: 2,
date: '2016-05-04',
name: 'wangxiaohu',
num: 2,
},
{
id: 3,
date: '2016-05-01',
name: 'wangxiaohu',
hasChildren: true,
num: 3,
},
{
id: 4,
date: '2016-05-03',
name: 'wangxiaohu',
num: 4,
},
])
// const tableData= ref([
// {
// id: 1,
// date: '2016-05-02',
// name: '',
// num: 1,
// },
// {
// id: 2,
// date: '2016-05-04',
// name: '',
// num: 2,
// },
// {
// id: 3,
// date: '2016-05-01',
// name: '',
// hasChildren: true,
// num: 3,
// },
// {
// id: 4,
// date: '2016-05-03',
// name: '',
// num: 4,
// },
// ])
const tableData= ref([])
const { tableObject, tableMethods } = useTable({
getListApi: BalanceApi.getBalanceSummaryPageAll //
})
//
const { getList, setSearchParams } = tableMethods
getList()
const itemCode = ref('253.504-00')
let defaultParams = {
level:0,
path:'',
itemCode:itemCode.value
}
const getList = async (params)=>{
let res = await BalanceApi.getBalanceSummaryPageAll(params)
tableData.value = res
console.log('库存汇总list',res)
}
/** 初始化 **/
onMounted(async () => {
getList()
onMounted(() => {
getList(defaultParams)
})
const load = ( row, treeNode,resolve) => {
const load = async ( row, treeNode,resolve) => {
console.log('load',row, treeNode,resolve)
console.log('tableData',tableData.value)
setTimeout(() => {
resolve([
{
id: Math.random(),
date: '2016-05-01',
name: 'wangxiaohu',
num: 5,
},
{
id: Math.random(),
date: '2016-05-01',
name: 'wangxiaohu',
num: 6,
hasChildren: true,
},
])
}, 1000)
let res = await BalanceApi.getBalanceSummaryPageAll({
level: row['level'],
path: row['path'],
itemCode:itemCode.value
})
if(res&&res.length>0){
resolve(res)
}
console.log('加载',res)
// setTimeout(() => {
// resolve([
// {
// id: Math.random(),
// date: '2016-05-01',
// name: '',
// num: 5,
// },
// {
// id: Math.random(),
// date: '2016-05-01',
// name: '',
// num: 6,
// hasChildren: true,
// },
// ])
// }, 1000)
}
const searchList = (model)=>{
console.log('searchList',model)
setSearchParams(model)
if(model['itemCode']){
itemCode.value = model['itemCode']
defaultParams = {
level:0,
path:'',
itemCode:itemCode.value
}
}
getList(defaultParams)
}
const searchQueryTableSuccess = (formField, searchField, val, formRef, type, row ) => {
@ -128,7 +152,7 @@ const buttonBaseClick = (val, item) => {
if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
getList(defaultParams)
}
}
/** 导出按钮操作 */
@ -139,7 +163,9 @@ const handleExport = async () => {
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await BalanceApi.exportBalanceSummary(tableObject.params)
const data = await BalanceApi.exportTotalBalanceTree({
itemCode:itemCode.value
})
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {

Loading…
Cancel
Save