|
@@ -38,7 +38,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="total-bar">
|
|
<div class="total-bar">
|
|
|
<span class="total-label">报价合计:</span>
|
|
<span class="total-label">报价合计:</span>
|
|
|
- <span class="total-value">{{ priceData?.totalCost || '--' }}</span>
|
|
|
|
|
|
|
+ <span class="total-value">{{ priceData?.totalCost ? formatArea(priceData.totalCost) : '--' }}</span>
|
|
|
<span class="total-unit">元</span>
|
|
<span class="total-unit">元</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -47,7 +47,7 @@
|
|
|
<div class="fertilizer-cost-section">
|
|
<div class="fertilizer-cost-section">
|
|
|
<div class="section-header">
|
|
<div class="section-header">
|
|
|
<div class="section-title">肥药费用</div>
|
|
<div class="section-title">肥药费用</div>
|
|
|
- <div class="section-total">{{ priceData?.pesticideFertilizerCost || '--' }}<span class="unit-text">元</span></div>
|
|
|
|
|
|
|
+ <div class="section-total">{{ priceData?.pesticideFertilizerCost ? formatArea(priceData.pesticideFertilizerCost) : '--' }}<span class="unit-text">元</span></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="cost-table">
|
|
<div class="cost-table">
|
|
|
<div class="table-header">
|
|
<div class="table-header">
|
|
@@ -132,6 +132,7 @@ import { useRouter } from "vue-router";
|
|
|
import { ElMessage } from "element-plus";
|
|
import { ElMessage } from "element-plus";
|
|
|
import wx from "weixin-js-sdk";
|
|
import wx from "weixin-js-sdk";
|
|
|
import html2canvas from "html2canvas";
|
|
import html2canvas from "html2canvas";
|
|
|
|
|
+import { formatArea } from "@/common/commonFun";
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const showPopup = ref(false);
|
|
const showPopup = ref(false);
|
|
@@ -153,6 +154,7 @@ const processedPrescriptionList = computed(() => {
|
|
|
|
|
|
|
|
// 创建价格映射表,方便快速查找
|
|
// 创建价格映射表,方便快速查找
|
|
|
const priceMap = new Map();
|
|
const priceMap = new Map();
|
|
|
|
|
+ console.log('priceData.value',priceData.value )
|
|
|
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, totalPrice: item.totalPrice });
|
|
priceMap.set(String(item.pesticideFertilizerId), { price: item.price, brand: item.brand, totalPrice: item.totalPrice });
|
|
@@ -191,12 +193,6 @@ const processedPrescriptionList = computed(() => {
|
|
|
return result;
|
|
return result;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-function formatArea(val) {
|
|
|
|
|
- const num = typeof val === 'number' ? val : parseFloat(val);
|
|
|
|
|
- if (Number.isNaN(num)) return val;
|
|
|
|
|
- return Number.isInteger(num) ? num : num.toFixed(2);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
function getServiceCost(cost, area) {
|
|
function getServiceCost(cost, area) {
|
|
|
if (!cost || !area) return '--';
|
|
if (!cost || !area) return '--';
|
|
|
return (parseFloat(cost) * parseFloat(area)).toFixed(2);
|
|
return (parseFloat(cost) * parseFloat(area)).toFixed(2);
|
|
@@ -211,13 +207,11 @@ const handleShowPopup = (data) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
function fetchPriceData() {
|
|
function fetchPriceData() {
|
|
|
- if (!quotationData.value?.orderId) {
|
|
|
|
|
|
|
+ if (!quotationData.value?.id) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- VE_API.z_farm_work_record_cost.listByOrderId({ farmWorkOrderId: quotationData.value.orderId }).then(({ data }) => {
|
|
|
|
|
- if (data && data.length > 0) {
|
|
|
|
|
- priceData.value = data[0];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ VE_API.z_farm_work_record_cost.getByRecordId({ farmWorkRecordId: quotationData.value.id }).then(({ data }) => {
|
|
|
|
|
+ priceData.value = data;
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
|
// 获取价格数据失败
|
|
// 获取价格数据失败
|
|
|
});
|
|
});
|