From 5929167e8fb9577df9502ba091e7c8071e79b717 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 17 十二月 2025 16:25:03 +0800
Subject: [PATCH] 1.海川开心-回款登记不要产品大类
---
src/views/inventoryManagement/receiptManagement/components/formDia.vue | 58 +++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/src/views/inventoryManagement/receiptManagement/components/formDia.vue b/src/views/inventoryManagement/receiptManagement/components/formDia.vue
index 7825e1e..3bd3390 100644
--- a/src/views/inventoryManagement/receiptManagement/components/formDia.vue
+++ b/src/views/inventoryManagement/receiptManagement/components/formDia.vue
@@ -8,8 +8,6 @@
placeholder="璇烽�夋嫨閲囪喘璁㈠崟鍙�"
clearable
filterable
- remote
- :remote-method="loadPurchaseOptions"
:loading="loadingPurchaseOptions"
@change="handlePurchaseChange"
:disabled="operationType === 'edit'"
@@ -44,28 +42,22 @@
<el-table-column label="寰呭叆搴撴暟閲�" prop="quantity0" width="100" />
<el-table-column label="鏈鍏ュ簱鏁伴噺" prop="quantityStock" width="150">
<template #default="scope">
- <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" />
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" @change="() => calculateTotalPrice(scope.row)" />
</template>
</el-table-column>
-<!-- <el-table-column label="绋庣巼(%)" prop="taxRate" width="120" />-->
-<!-- <el-table-column-->
-<!-- label="鍚◣鍗曚环(鍏�)"-->
-<!-- prop="taxInclusiveUnitPrice"-->
-<!-- :formatter="formattedNumber"-->
-<!-- width="150"-->
-<!-- />-->
-<!-- <el-table-column-->
-<!-- label="鍚◣鎬讳环(鍏�)"-->
-<!-- prop="taxInclusiveTotalPrice"-->
-<!-- :formatter="formattedNumber"-->
-<!-- width="150"-->
-<!-- />-->
-<!-- <el-table-column-->
-<!-- label="涓嶅惈绋庢�讳环(鍏�)"-->
-<!-- prop="taxExclusiveTotalPrice"-->
-<!-- :formatter="formattedNumber"-->
-<!-- width="150"-->
-<!-- />-->
+ <el-table-column label="绋庣巼(%)" prop="taxRate" width="120" />
+ <el-table-column label="鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150">
+ <template #default="scope">
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="() => calculateTotalPrice(scope.row)" :disabled="operationType === 'edit'"/>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鎬讳环(鍏�)"
+ :formatter="formattedNumber"
+ prop="taxInclusiveTotalPrice"
+ width="150"
+ >
+ </el-table-column>
</el-table>
</el-form>
<template #footer>
@@ -199,6 +191,18 @@
return parseFloat(cellValue).toFixed(2);
};
+// 璁$畻鎬讳环
+const calculateTotalPrice = (row) => {
+ const quantityStock = Number(row?.quantityStock ?? 0);
+ const taxInclusiveUnitPrice = Number(row?.taxInclusiveUnitPrice ?? 0);
+
+ if (Number.isFinite(quantityStock) && Number.isFinite(taxInclusiveUnitPrice)) {
+ row.taxInclusiveTotalPrice = quantityStock * taxInclusiveUnitPrice;
+ } else {
+ row.taxInclusiveTotalPrice = 0;
+ }
+};
+
const fetchProductsByContract = async () => {
if (!form.value.purchaseContractNumber) {
proxy.$modal.msgWarning('璇烽�夋嫨鍚堝悓鍙�')
@@ -217,6 +221,8 @@
productList.value = productRes.data.map(item => ({
...item,
quantityStock: 0,
+ taxInclusiveUnitPrice: Number(item?.taxInclusiveUnitPrice ?? 0),
+ taxInclusiveTotalPrice: 0,
originalQuantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? 0),
}))
} catch (error) {
@@ -283,7 +289,9 @@
nickName: userStore.nickName,
details: selectedRows.value.map(product => ({
id: product.id,
- inboundQuantity: Number(product.quantityStock)
+ inboundQuantity: Number(product.quantityStock),
+ taxInclusiveUnitPrice: Number(product.taxInclusiveUnitPrice),
+ taxInclusiveTotalPrice: Number(product.taxInclusiveTotalPrice)
})),
};
loading.value = true
@@ -365,6 +373,8 @@
productList.value = res.data.map(item => ({
...item,
quantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? row.inboundNum ?? 0),
+ taxInclusiveUnitPrice: Number(item?.taxInclusiveUnitPrice ?? 0),
+ taxInclusiveTotalPrice: Number(item?.quantityStock ?? 0) * Number(item?.taxInclusiveUnitPrice ?? 0),
originalQuantityStock: Number(item.quantityStock ?? item.inboundQuantity ?? row.inboundNum ?? 0),
}))
selectedRows.value = productList.value
@@ -385,3 +395,5 @@
<style scoped lang="scss"></style>
+
+
--
Gitblit v1.9.3