From 82cb30fb5dc3a5b9e7abb0affad40508e3448461 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Wed, 4 Sep 2024 09:12:39 +0800 Subject: [PATCH] =?UTF-8?q?HL-5809=E5=A2=9E=E5=8A=A0=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E6=B1=87=E6=80=BB=E6=9F=A5=E8=AF=A2=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8F=82=E8=80=83=E5=A4=87=E6=B3=A8=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=88=AA=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../balanceSummary/balanceSummary.data.ts | 10 +- .../inventoryManage/balanceSummary/index.vue | 142 +++++++++++------- 2 files changed, 89 insertions(+), 63 deletions(-) diff --git a/src/views/wms/inventoryManage/balanceSummary/balanceSummary.data.ts b/src/views/wms/inventoryManage/balanceSummary/balanceSummary.data.ts index 58e127dc3..1cd6491d4 100644 --- a/src/views/wms/inventoryManage/balanceSummary/balanceSummary.data.ts +++ b/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 } diff --git a/src/views/wms/inventoryManage/balanceSummary/index.vue b/src/views/wms/inventoryManage/balanceSummary/index.vue index f324e7224..a0c1526b7 100644 --- a/src/views/wms/inventoryManage/balanceSummary/index.vue +++ b/src/views/wms/inventoryManage/balanceSummary/index.vue @@ -16,7 +16,7 @@ { + 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 {