采购入库修改实际进价的计算
This commit is contained in:
1 parent
1b6d271296
commit
7fdb9cec42
2 files changed
+25
-24
No files matched your search
@@ -88,7 +88,7 @@
|
||||
</el-button> -->
|
||||
<el-button type="primary" plain @click="handleClickSpuSelect">商品选择</el-button>
|
||||
<el-button @click="removeSelectRowEvent" :disabled="state.selectedRowsErpSpuIds.length <= 0">删除选中</el-button>
|
||||
<el-button type="danger" @click="clearData">清空数据</el-button>
|
||||
<el-button type="danger" plain @click="clearData">清空数据</el-button>
|
||||
</el-row>
|
||||
|
||||
<vxe-table
|
||||
|
||||
@@ -150,32 +150,31 @@
|
||||
<el-input v-model="row.quantity" />
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="unitPrice" title="原进价">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.purchasePrice
|
||||
? displayPrice(row.purchasePrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="realPrice" title="实际进价">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.real_price
|
||||
? displayPrice(row.real_price)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="unitPrice" title="原进价">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.purchasePrice
|
||||
? displayPrice(row.purchasePrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="retailPrice" title="实际进价">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.retailPrice
|
||||
? displayPrice(row.retailPrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.retailPrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="totalAmount" title="累计总金额">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
{{ displayPrice(row.quantity * parseFloat(row.purchasePrice)) }}
|
||||
{{ displayPrice(row.quantity * parseFloat(row.retailPrice)) }}
|
||||
</span>
|
||||
<span v-if="row.unitId && row.quantity && row.erpUnitVos">
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice) * row.quantity) }}
|
||||
{{ displayPrice(Number(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.retailPrice) * row.quantity) }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
@@ -486,7 +485,8 @@ const cgPlanSpuItems = computed(() => {
|
||||
erpSpuId: item.erpSpuId,
|
||||
quantity: item.quantity,
|
||||
unitPrice: unit.purchasePrice ? Number(unit?.purchasePrice) : 0,
|
||||
totalAmount: Number(unit?.purchasePrice || 0) * item.quantity,
|
||||
retailPrice: unit.retailPrice ? Number(unit?.retailPrice) : 0,
|
||||
totalAmount: Number(unit?.retailPrice || 0) * item.quantity,
|
||||
remark: item.remark,
|
||||
unitId: item.unitId,
|
||||
}
|
||||
@@ -496,7 +496,8 @@ const cgPlanSpuItems = computed(() => {
|
||||
erpSpuId: item.erpSpuId,
|
||||
quantity: item.quantity,
|
||||
unitPrice: item.purchasePrice ? Number(item.purchasePrice) : 0,
|
||||
totalAmount: item?.purchasePrice && item.quantity ? Number(item.purchasePrice) * item.quantity : 0,
|
||||
retailPrice: item.retailPrice ? Number(item.retailPrice) : 0,
|
||||
totalAmount: item?.retailPrice && item.quantity ? Number(item.retailPrice) * item.quantity : 0,
|
||||
remark: item.remark,
|
||||
unitId: item.unitId,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user