|
@@ -66,7 +66,7 @@
|
|
|
<div class="col-1">{{ item.typeName || '--' }}</div>
|
|
<div class="col-1">{{ item.typeName || '--' }}</div>
|
|
|
<div class="col-2">{{ item.defaultName || '--' }}</div>
|
|
<div class="col-2">{{ item.defaultName || '--' }}</div>
|
|
|
<div class="col-3">{{ item.brand || '--' }}</div>
|
|
<div class="col-3">{{ item.brand || '--' }}</div>
|
|
|
- <div class="col-4">{{ item.priceDisplay || '--' }}</div>
|
|
|
|
|
|
|
+ <div class="col-4">{{ item.price || '--' }}</div>
|
|
|
<div class="col-5">{{ item.usageDisplay || '--' }}</div>
|
|
<div class="col-5">{{ item.usageDisplay || '--' }}</div>
|
|
|
<div class="col-6">{{ item.totalDisplay === '--' ? '--' : (item.totalDisplay + '元') }}</div>
|
|
<div class="col-6">{{ item.totalDisplay === '--' ? '--' : (item.totalDisplay + '元') }}</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -155,7 +155,7 @@ const processedPrescriptionList = computed(() => {
|
|
|
const priceMap = new Map();
|
|
const priceMap = new Map();
|
|
|
if (priceData.value?.itemsList && Array.isArray(priceData.value.itemsList)) {
|
|
if (priceData.value?.itemsList && Array.isArray(priceData.value.itemsList)) {
|
|
|
priceData.value.itemsList.forEach(item => {
|
|
priceData.value.itemsList.forEach(item => {
|
|
|
- priceMap.set(String(item.pesticideFertilizerId), { price: item.price, brand: item.brand });
|
|
|
|
|
|
|
+ priceMap.set(String(item.pesticideFertilizerId), { price: item.price, brand: item.brand, totalPrice: item.totalPrice });
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
// 展平 prescriptionList 中的所有 pesticideFertilizerList
|
|
// 展平 prescriptionList 中的所有 pesticideFertilizerList
|
|
@@ -167,20 +167,18 @@ const processedPrescriptionList = computed(() => {
|
|
|
const mapped = priceMap.get(pesticideFertilizerId) || {};
|
|
const mapped = priceMap.get(pesticideFertilizerId) || {};
|
|
|
const price = mapped.price || 0;
|
|
const price = mapped.price || 0;
|
|
|
const brand = mapped.brand || item.brand || '';
|
|
const brand = mapped.brand || item.brand || '';
|
|
|
|
|
+ const total = mapped.totalPrice || item.total || '';
|
|
|
const muUsage = item.muUsage || 0;
|
|
const muUsage = item.muUsage || 0;
|
|
|
const unit = item.unit || '';
|
|
const unit = item.unit || '';
|
|
|
-
|
|
|
|
|
- // 计算总价
|
|
|
|
|
- const total = price * muUsage;
|
|
|
|
|
|
|
|
|
|
result.push({
|
|
result.push({
|
|
|
typeName: item.typeName || '--',
|
|
typeName: item.typeName || '--',
|
|
|
defaultName: item.defaultName || item.pesticideFertilizerName || '--',
|
|
defaultName: item.defaultName || item.pesticideFertilizerName || '--',
|
|
|
brand: brand,
|
|
brand: brand,
|
|
|
- price: price,
|
|
|
|
|
|
|
+ price: price ? `${price}元` : '--',
|
|
|
unit: unit,
|
|
unit: unit,
|
|
|
muUsage: muUsage,
|
|
muUsage: muUsage,
|
|
|
- total: total,
|
|
|
|
|
|
|
+ // total: total,
|
|
|
// 显示的格式化字符串
|
|
// 显示的格式化字符串
|
|
|
priceDisplay: price > 0 ? `${price}元/${unit}` : '--',
|
|
priceDisplay: price > 0 ? `${price}元/${unit}` : '--',
|
|
|
usageDisplay: muUsage > 0 ? `${muUsage}${unit}` : '--',
|
|
usageDisplay: muUsage > 0 ? `${muUsage}${unit}` : '--',
|