From 4e64eeb2a807adc9153fd9cd61b498b99c1f6f2c Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期二, 17 六月 2025 11:06:22 +0800 Subject: [PATCH] 完成库存管理前端页面 --- src/views/procurementManagement/invoiceEntry/index.vue | 36 ++++++++++++++++++++++++++---------- 1 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/views/procurementManagement/invoiceEntry/index.vue b/src/views/procurementManagement/invoiceEntry/index.vue index d73b5cc..88ff50c 100644 --- a/src/views/procurementManagement/invoiceEntry/index.vue +++ b/src/views/procurementManagement/invoiceEntry/index.vue @@ -119,13 +119,13 @@ <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" width="150" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" /> <el-table-column label="鏈鏉ョエ鏁�" prop="ticketsNum" width="170"> <template #default="scope"> - <el-input-number v-model="scope.row.ticketsNum" placeholder="璇烽�夋嫨" min="0" :step="0.1" clearable style="width: 100%" + <el-input-number v-model="scope.row.ticketsNum" placeholder="璇烽�夋嫨" :min="0" :step="0.1" clearable style="width: 100%" @change="invoiceNumBlur(scope.row)" /> </template> </el-table-column> - <el-table-column label="鏈鏉ョエ閲戦(鍏�)" prop="ticketsAmount" min="0" :step="0.1" :formatter="formattedNumber" @change="invoiceAmountBlur" width="170"> + <el-table-column label="鏈鏉ョエ閲戦(鍏�)" prop="ticketsAmount" :min="0" :step="0.1" :formatter="formattedNumber" @change="invoiceAmountBlur" width="170"> <template #default="scope"> - <el-input-number v-model="scope.row.ticketsAmount" placeholder="璇烽�夋嫨" min="0" :step="0.1" clearable style="width: 100%" + <el-input-number v-model="scope.row.ticketsAmount" placeholder="璇烽�夋嫨" :min="0" :step="0.1" clearable style="width: 100%" @change="invoiceAmountBlur(scope.row)" /> </template> </el-table-column> @@ -165,14 +165,14 @@ const tableLoading = ref(false) const page = reactive({ current: 1, - size: 10, + size: 100, }) const total = ref(0) const fileList = ref([]) import { addOrUpdateRegistration, delRegistration, - gePurchaseList, + gePurchaseListPage, getInfo, getProduct, getPurchaseNoById, @@ -213,16 +213,16 @@ page.current = 1 getList() } -const paginationChange = ({ current, limit }) => { - page.current = current; - page.size = limit; +const paginationChange = (obj) => { + page.current = obj.page; + page.size = obj.limit; getList() } const getList = () => { tableLoading.value = true - gePurchaseList({ ...searchForm.value, ...page }).then(res => { + gePurchaseListPage({ ...searchForm.value, ...page }).then(res => { tableLoading.value = false - tableData.value = res.rows + tableData.value = res.records; tableData.value.map(item => { item.children = [] }) @@ -412,6 +412,7 @@ row.futureTickets = row.tempFutureTickets - row.ticketsNum // 璁$畻鏈潵绁ㄩ噾棰� row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount + calculateinvoiceAmount() } // 鏈鏉ョエ閲戦澶辩劍鎿嶄綔 const invoiceAmountBlur = (row) => { @@ -429,6 +430,7 @@ row.futureTickets = row.tempFutureTickets - row.ticketsNum // 璁$畻鏈潵绁ㄩ噾棰� row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount + calculateinvoiceAmount() } // 鑾峰彇褰撳墠鏃ユ湡鍑芥暟 @@ -441,6 +443,20 @@ if (strDate < 10) strDate = `0${strDate}` // 濡傛灉鏃ユ槸涓綅鏁帮紝鍦ㄥ墠闈㈣ˉ0 return `${year}-${month}-${strDate}` } + + +function calculateinvoiceAmount() { + console.log('productData',productData.value) + var invoiceAmountTotal = 0 + productData.value.forEach(item => { + if(item.ticketsAmount){ + invoiceAmountTotal += item.ticketsAmount + } + }) + form.value.invoiceAmount = invoiceAmountTotal.toFixed(2) + +} + getList() </script> -- Gitblit v1.9.3