diff --git a/src/components/Select/SelectSupermarketSupplier.vue b/src/components/Select/SelectSupermarketSupplier.vue
index dba3e01..811408a 100644
--- a/src/components/Select/SelectSupermarketSupplier.vue
+++ b/src/components/Select/SelectSupermarketSupplier.vue
@@ -1,201 +1,86 @@
e && getOptions()"
+ @change="change"
>
-
-
- 加载中...
-
-
- 没有更多数据了
-
+
-
-
diff --git a/src/views/supermarketerp/purchaseManagement/smErpCgInventory/form.vue b/src/views/supermarketerp/purchaseManagement/smErpCgInventory/form.vue
index b67ad66..0959a74 100644
--- a/src/views/supermarketerp/purchaseManagement/smErpCgInventory/form.vue
+++ b/src/views/supermarketerp/purchaseManagement/smErpCgInventory/form.vue
@@ -113,9 +113,19 @@
-
-
-
+
+
+
+
+
+
@@ -265,7 +285,11 @@ const getInitData = async () => {
const selectedUnitObj = item.erpUnitVos.find((unit: any) => unit.id === item.unitId)
return {
...item,
- selectedUnitObj: { ...selectedUnitObj, realPrice: displayPrice(item?.realPrice, "") || 0 },
+ selectedUnitObj: {
+ ...selectedUnitObj,
+ realPrice: Number(displayPrice(item?.realPrice, "")) || 0,
+ totalAmount: Number(displayPrice(item?.totalAmount, "")),
+ },
}
})
}
@@ -315,8 +339,12 @@ const getSelectedRows = (selectionRows: any) => {
// if (index !== -1) return state.erpSpuItemsMemo[index]
return {
...addItem,
- erpUnitVos: addItem.erpUnitVos.map((item: any) => ({ ...item, realPrice: displayPrice(item.purchasePrice, "") })),
- selectedUnitObj: addItem.erpUnitVos[0],
+ erpUnitVos: addItem.erpUnitVos.map((item: any) => ({ ...item, realPrice: Number(displayPrice(item.purchasePrice, "")) })),
+ selectedUnitObj: {
+ ...addItem.erpUnitVos[0],
+ realPrice: parseFloat(displayPrice(addItem.erpUnitVos[0].purchasePrice, "")),
+ totalAmount: 1 * parseFloat(displayPrice(addItem.erpUnitVos[0].purchasePrice, "")),
+ },
unitId: addItem.erpUnitVos[0].id,
quantity: 1,
isNew: true,
@@ -347,6 +375,11 @@ const removeRow = () => {
}
}
+// 重新计算累计总金额
+const reComputeTotalAmount = (row: any, index: number) => {
+ vxeTableData.value[index].selectedUnitObj.totalAmount = Number((row.quantity * parseFloat(row.selectedUnitObj.realPrice || 0)).toFixed(2))
+}
+
// 整理table数据
const settledTableItems = computed(() => {
return vxeTableData.value.map((item: any) => {
@@ -357,7 +390,7 @@ const settledTableItems = computed(() => {
quantity: item.quantity,
unitPrice: selectedUnitObj.purchasePrice ? Number(selectedUnitObj?.purchasePrice) : 0,
realPrice: selectedUnitObj.realPrice ? storePrice(selectedUnitObj?.realPrice) : 0,
- totalAmount: storePrice(Number(selectedUnitObj?.realPrice || 0) * item.quantity),
+ totalAmount: storePrice(Number(selectedUnitObj?.totalAmount || 0)),
remark: item.remark,
unitId: selectedUnitObj.id,
orderType: baseDataForm.orderType,