From db1139a14f8e829b903a56a2f83c14f4b2f7dd87 Mon Sep 17 00:00:00 2001 From: chenqi Date: Thu, 15 Jan 2026 15:13:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(prescription):=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=A4=84=E6=96=B9=E5=88=97=E8=A1=A8=E4=B8=AD=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E7=A9=BA=E5=80=BC=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在处方列表组件中添加对unitPrice和totalPrice的空值检查,防止NaN显示 - 优化价格计算逻辑,确保无效价格值被正确处理并显示为默认值 - 更新数据库查询中的条件判断,改进UNION查询的逻辑结构 - 添加对adviceTypes参数的有效性验证,确保查询条件的正确执行 --- .../DoctorStationAdviceAppMapper.xml | 479 +++++++++--------- .../components/adviceBaseList.vue | 14 +- .../prescription/prescriptionlist.vue | 33 +- 3 files changed, 274 insertions(+), 252 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index c42fa9cf..31e63278 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -44,248 +44,247 @@ abi.dosage_instruction, abi.chrgitm_lv FROM ( - - - - - (SELECT - DISTINCT ON (T1.ID) - T1.tenant_id, - 1 AS advice_type, - T1.bus_no AS bus_no, - T1.category_code AS category_code, - T1.pharmacology_category_code AS pharmacology_category_code, - T1.part_percent AS part_percent, - T1.unit_conversion_ratio AS unit_conversion_ratio, - T1.part_attribute_enum AS part_attribute_enum, - T1.tho_part_attribute_enum AS tho_part_attribute_enum, - T1.skin_test_flag AS skin_test_flag, - T1.inject_flag AS inject_flag, - T1.ID AS advice_definition_id, - T1.NAME AS advice_name, - T1.bus_no AS advice_bus_no, - T1.py_str AS py_str, - T1.wb_str AS wb_str, - T1.yb_no AS yb_no, - T1.merchandise_name AS product_name, - 0 AS activity_type, - T1.unit_code AS unit_code, - T1.min_unit_code AS min_unit_code, - T2.total_volume AS volume, - T2.method_code AS method_code, - T2.rate_code AS rate_code, - T2.org_id AS org_id, - T2.location_id AS location_id, - CAST(T2.dose AS TEXT) AS dose, - T2.dose_unit_code AS dose_unit_code, - T3.NAME AS supplier, - T3.id AS supplier_id, - T1.manufacturer_text AS manufacturer, - T5.id AS charge_item_definition_id, - T5.instance_table AS advice_table_name, - T6.def_location_id AS position_id, - t1.restricted_flag AS restricted_flag, - t1.restricted_scope AS restricted_scope, - T1.dosage_instruction AS dosage_instruction, - T1.chrgitm_lv as chrgitm_lv - FROM med_medication_definition AS t1 - INNER JOIN med_medication AS T2 ON T2.medication_def_id = T1.ID - AND T2.delete_flag = '0' AND T2.status_enum = #{statusEnum} - LEFT JOIN adm_supplier AS T3 - ON T3.ID = T1.supply_id - AND T3.delete_flag = '0' - LEFT JOIN adm_charge_item_definition AS T5 ON T5.instance_id = T1.ID - AND T5.delete_flag = '0' AND T5.status_enum = #{statusEnum} - LEFT JOIN adm_organization_location AS T6 - ON T6.distribution_category_code = T1.category_code - AND T6.delete_flag = '0' AND T6.item_code = '1' AND T6.organization_id = #{organizationId} AND - (CURRENT_TIME :: time (6) BETWEEN T6.start_time AND T6.end_time) - WHERE T1.delete_flag = '0' - AND T2.status_enum = #{statusEnum} - - AND 1 = 2 - - - AND T1.id IN - - #{itemId} - - - AND T5.instance_table = #{medicationTableName} - ) - + + + + + (SELECT + DISTINCT ON (T1.ID) + T1.tenant_id, + 1 AS advice_type, + T1.bus_no AS bus_no, + T1.category_code AS category_code, + T1.pharmacology_category_code AS pharmacology_category_code, + T1.part_percent AS part_percent, + T1.unit_conversion_ratio AS unit_conversion_ratio, + T1.part_attribute_enum AS part_attribute_enum, + T1.tho_part_attribute_enum AS tho_part_attribute_enum, + T1.skin_test_flag AS skin_test_flag, + T1.inject_flag AS inject_flag, + T1.ID AS advice_definition_id, + T1.NAME AS advice_name, + T1.bus_no AS advice_bus_no, + T1.py_str AS py_str, + T1.wb_str AS wb_str, + T1.yb_no AS yb_no, + T1.merchandise_name AS product_name, + 0 AS activity_type, + T1.unit_code AS unit_code, + T1.min_unit_code AS min_unit_code, + T2.total_volume AS volume, + T2.method_code AS method_code, + T2.rate_code AS rate_code, + T2.org_id AS org_id, + T2.location_id AS location_id, + CAST(T2.dose AS TEXT) AS dose, + T2.dose_unit_code AS dose_unit_code, + T3.NAME AS supplier, + T3.id AS supplier_id, + T1.manufacturer_text AS manufacturer, + T5.id AS charge_item_definition_id, + T5.instance_table AS advice_table_name, + T6.def_location_id AS position_id, + t1.restricted_flag AS restricted_flag, + t1.restricted_scope AS restricted_scope, + T1.dosage_instruction AS dosage_instruction, + T1.chrgitm_lv as chrgitm_lv + FROM med_medication_definition AS t1 + INNER JOIN med_medication AS T2 ON T2.medication_def_id = T1.ID + AND T2.delete_flag = '0' AND T2.status_enum = #{statusEnum} + LEFT JOIN adm_supplier AS T3 + ON T3.ID = T1.supply_id + AND T3.delete_flag = '0' + LEFT JOIN adm_charge_item_definition AS T5 ON T5.instance_id = T1.ID + AND T5.delete_flag = '0' AND T5.status_enum = #{statusEnum} + LEFT JOIN adm_organization_location AS T6 + ON T6.distribution_category_code = T1.category_code + AND T6.delete_flag = '0' AND T6.item_code = '1' AND T6.organization_id = #{organizationId} AND + (CURRENT_TIME :: time (6) BETWEEN T6.start_time AND T6.end_time) + WHERE T1.delete_flag = '0' + AND T2.status_enum = #{statusEnum} + + AND 1 = 2 + + + AND T1.id IN + + #{itemId} + + + AND T5.instance_table = #{medicationTableName} + ) + UNION ALL + - - UNION ALL - (SELECT - DISTINCT ON (T1.ID) - T1.tenant_id, - 2 AS advice_type, - T1.bus_no AS bus_no, - T1.category_code AS category_code, - '' AS pharmacology_category_code, - T1.part_percent AS part_percent, - 0 AS unit_conversion_ratio, - null AS part_attribute_enum, - null AS tho_part_attribute_enum, - null AS skin_test_flag, - null AS inject_flag, - T1.ID AS advice_definition_id, - T1.NAME AS advice_name, - T1.bus_no AS advice_bus_no, - T1.py_str AS py_str, - T1.wb_str AS wb_str, - T1.yb_no AS yb_no, - '' AS product_name, - 0 AS activity_type, - T1.unit_code AS unit_code, - T1.min_unit_code AS min_unit_code, - T1.SIZE AS volume, - '' AS method_code, - '' AS rate_code, - T1.org_id AS org_id, - T1.location_id AS location_id, - '' AS dose, - '' AS dose_unit_code, - T2.NAME AS supplier, - T2.id AS supplier_id, - T1.manufacturer_text AS manufacturer, - T4.id AS charge_item_definition_id, - T4.instance_table AS advice_table_name, - T5.def_location_id AS position_id, - 0 AS restricted_flag, - '' AS restricted_scope, - '' AS dosage_instruction, - T1.chrgitm_lv as chrgitm_lv - FROM adm_device_definition AS T1 - LEFT JOIN adm_supplier AS T2 - ON T2.ID = T1.supply_id - AND T2.delete_flag = '0' - LEFT JOIN adm_charge_item_definition AS T4 ON T4.instance_id = T1.ID - AND T4.delete_flag = '0' AND T4.status_enum = #{statusEnum} - LEFT JOIN adm_organization_location AS T5 ON T5.distribution_category_code = T1.category_code - AND T5.delete_flag = '0' AND T5.item_code = '2' AND T5.organization_id = #{organizationId} AND - (CURRENT_TIME :: time (6) BETWEEN T5.start_time AND T5.end_time) - WHERE T1.delete_flag = '0' - - AND T1.id IN - - #{itemId} - - - AND T4.instance_table = #{deviceTableName} - AND T1.status_enum = #{statusEnum} - ) - + + (SELECT + DISTINCT ON (T1.ID) + T1.tenant_id, + 2 AS advice_type, + T1.bus_no AS bus_no, + T1.category_code AS category_code, + '' AS pharmacology_category_code, + T1.part_percent AS part_percent, + 0 AS unit_conversion_ratio, + null AS part_attribute_enum, + null AS tho_part_attribute_enum, + null AS skin_test_flag, + null AS inject_flag, + T1.ID AS advice_definition_id, + T1.NAME AS advice_name, + T1.bus_no AS advice_bus_no, + T1.py_str AS py_str, + T1.wb_str AS wb_str, + T1.yb_no AS yb_no, + '' AS product_name, + 0 AS activity_type, + T1.unit_code AS unit_code, + T1.min_unit_code AS min_unit_code, + T1.SIZE AS volume, + '' AS method_code, + '' AS rate_code, + T1.org_id AS org_id, + T1.location_id AS location_id, + '' AS dose, + '' AS dose_unit_code, + T2.NAME AS supplier, + T2.id AS supplier_id, + T1.manufacturer_text AS manufacturer, + T4.id AS charge_item_definition_id, + T4.instance_table AS advice_table_name, + T5.def_location_id AS position_id, + 0 AS restricted_flag, + '' AS restricted_scope, + '' AS dosage_instruction, + T1.chrgitm_lv as chrgitm_lv + FROM adm_device_definition AS T1 + LEFT JOIN adm_supplier AS T2 + ON T2.ID = T1.supply_id + AND T2.delete_flag = '0' + LEFT JOIN adm_charge_item_definition AS T4 ON T4.instance_id = T1.ID + AND T4.delete_flag = '0' AND T4.status_enum = #{statusEnum} + LEFT JOIN adm_organization_location AS T5 ON T5.distribution_category_code = T1.category_code + AND T5.delete_flag = '0' AND T5.item_code = '2' AND T5.organization_id = #{organizationId} AND + (CURRENT_TIME :: time (6) BETWEEN T5.start_time AND T5.end_time) + WHERE T1.delete_flag = '0' + + AND T1.id IN + + #{itemId} + + + AND T4.instance_table = #{deviceTableName} + AND T1.status_enum = #{statusEnum} + ) + UNION ALL + - - UNION ALL - (SELECT - DISTINCT ON (T1.ID) - T1.tenant_id, - 3 AS advice_type, - T1.bus_no AS bus_no, - T1.category_code AS category_code, - '' AS pharmacology_category_code, - 1 AS part_percent, - 0 AS unit_conversion_ratio, - null AS part_attribute_enum, - null AS tho_part_attribute_enum, - null AS skin_test_flag, - null AS inject_flag, - T1.ID AS advice_definition_id, - T1.NAME AS advice_name, - T1.bus_no AS advice_bus_no, - T1.py_str AS py_str, - T1.wb_str AS wb_str, - T1.yb_no AS yb_no, - '' AS product_name, - T1.type_enum AS activity_type, - '' AS unit_code, - '' AS min_unit_code, - '' AS volume, - '' AS method_code, - '' AS rate_code, - T1.org_id AS org_id, - T1.location_id AS location_id, - '' AS dose, - '' AS dose_unit_code, - '' AS supplier, - null AS supplier_id, - '' AS manufacturer, - T2.ID AS charge_item_definition_id, - T2.instance_table AS advice_table_name, - T3.organization_id AS position_id, - 0 AS restricted_flag, - '' AS restricted_scope, - '' AS dosage_instruction, - T1.chrgitm_lv as chrgitm_lv - FROM wor_activity_definition AS T1 - LEFT JOIN adm_charge_item_definition AS T2 - ON T2.instance_id = T1.ID - AND T2.delete_flag = '0' AND T2.status_enum = #{statusEnum} - AND T2.instance_table = #{activityTableName} - LEFT JOIN adm_organization_location AS T3 ON T3.activity_definition_id = T1.ID - AND T3.delete_flag = '0' AND (CURRENT_TIME :: time (6) BETWEEN T3.start_time AND T3.end_time) - WHERE T1.delete_flag = '0' - - AND (T1.pricing_flag = #{pricingFlag} OR T1.pricing_flag IS NULL) - - - AND T1.id IN - - #{itemId} - - - AND T1.status_enum = #{statusEnum} - ) - - - - - -- 当没有指定adviceTypes或adviceTypes为空时,返回空结果集但保持正确的SQL语法 - SELECT - NULL::varchar AS tenant_id, - NULL::integer AS advice_type, - NULL::varchar AS bus_no, - NULL::varchar AS category_code, - NULL::varchar AS pharmacology_category_code, - NULL::numeric AS part_percent, - NULL::numeric AS unit_conversion_ratio, - NULL::integer AS part_attribute_enum, - NULL::integer AS tho_part_attribute_enum, - NULL::integer AS skin_test_flag, - NULL::integer AS inject_flag, - NULL::bigint AS advice_definition_id, - NULL::varchar AS advice_name, - NULL::varchar AS advice_bus_no, - NULL::varchar AS py_str, - NULL::varchar AS wb_str, - NULL::varchar AS yb_no, - NULL::varchar AS product_name, - NULL::integer AS activity_type, - NULL::varchar AS unit_code, - NULL::varchar AS min_unit_code, - NULL::numeric AS volume, - NULL::varchar AS method_code, - NULL::varchar AS rate_code, - NULL::bigint AS org_id, - NULL::bigint AS location_id, - NULL::varchar AS dose, - NULL::varchar AS dose_unit_code, - NULL::varchar AS supplier, - NULL::bigint AS supplier_id, - NULL::varchar AS manufacturer, - NULL::bigint AS charge_item_definition_id, - NULL::varchar AS advice_table_name, - NULL::bigint AS position_id, - NULL::integer AS restricted_flag, - NULL::varchar AS restricted_scope, - NULL::varchar AS dosage_instruction, - NULL::integer AS chrgitm_lv - WHERE 1 = 0 -- 确保不返回任何行 - - + + (SELECT + DISTINCT ON (T1.ID) + T1.tenant_id, + 3 AS advice_type, + T1.bus_no AS bus_no, + T1.category_code AS category_code, + '' AS pharmacology_category_code, + 1 AS part_percent, + 0 AS unit_conversion_ratio, + null AS part_attribute_enum, + null AS tho_part_attribute_enum, + null AS skin_test_flag, + null AS inject_flag, + T1.ID AS advice_definition_id, + T1.NAME AS advice_name, + T1.bus_no AS advice_bus_no, + T1.py_str AS py_str, + T1.wb_str AS wb_str, + T1.yb_no AS yb_no, + '' AS product_name, + T1.type_enum AS activity_type, + '' AS unit_code, + '' AS min_unit_code, + '' AS volume, + '' AS method_code, + '' AS rate_code, + T1.org_id AS org_id, + T1.location_id AS location_id, + '' AS dose, + '' AS dose_unit_code, + '' AS supplier, + null AS supplier_id, + '' AS manufacturer, + T2.ID AS charge_item_definition_id, + T2.instance_table AS advice_table_name, + T3.organization_id AS position_id, + 0 AS restricted_flag, + '' AS restricted_scope, + '' AS dosage_instruction, + T1.chrgitm_lv as chrgitm_lv + FROM wor_activity_definition AS T1 + LEFT JOIN adm_charge_item_definition AS T2 + ON T2.instance_id = T1.ID + AND T2.delete_flag = '0' AND T2.status_enum = #{statusEnum} + AND T2.instance_table = #{activityTableName} + LEFT JOIN adm_organization_location AS T3 ON T3.activity_definition_id = T1.ID + AND T3.delete_flag = '0' AND (CURRENT_TIME :: time (6) BETWEEN T3.start_time AND T3.end_time) + WHERE T1.delete_flag = '0' + + AND (T1.pricing_flag = #{pricingFlag} OR T1.pricing_flag IS NULL) + + + AND T1.id IN + + #{itemId} + + + AND T1.status_enum = #{statusEnum} + ) + + + + + SELECT + mmd.tenant_id, + CAST(0 AS INTEGER) AS advice_type, + CAST('' AS VARCHAR) AS bus_no, + CAST('' AS VARCHAR) AS category_code, + CAST('' AS VARCHAR) AS pharmacology_category_code, + CAST(0 AS NUMERIC) AS part_percent, + CAST(0 AS NUMERIC) AS unit_conversion_ratio, + CAST(0 AS INTEGER) AS part_attribute_enum, + CAST(0 AS INTEGER) AS tho_part_attribute_enum, + CAST(0 AS INTEGER) AS skin_test_flag, + CAST(0 AS INTEGER) AS inject_flag, + CAST(0 AS BIGINT) AS advice_definition_id, + CAST('' AS VARCHAR) AS advice_name, + CAST('' AS VARCHAR) AS advice_bus_no, + CAST('' AS VARCHAR) AS py_str, + CAST('' AS VARCHAR) AS wb_str, + CAST('' AS VARCHAR) AS yb_no, + CAST('' AS VARCHAR) AS product_name, + CAST(0 AS INTEGER) AS activity_type, + CAST('' AS VARCHAR) AS unit_code, + CAST('' AS VARCHAR) AS min_unit_code, + CAST(0 AS NUMERIC) AS volume, + CAST('' AS VARCHAR) AS method_code, + CAST('' AS VARCHAR) AS rate_code, + CAST(0 AS BIGINT) AS org_id, + CAST(0 AS BIGINT) AS location_id, + CAST('' AS VARCHAR) AS dose, + CAST('' AS VARCHAR) AS dose_unit_code, + CAST('' AS VARCHAR) AS supplier, + CAST(0 AS BIGINT) AS supplier_id, + CAST('' AS VARCHAR) AS manufacturer, + CAST(0 AS BIGINT) AS charge_item_definition_id, + CAST('' AS VARCHAR) AS advice_table_name, + CAST(0 AS BIGINT) AS position_id, + CAST(0 AS INTEGER) AS restricted_flag, + CAST('' AS VARCHAR) AS restricted_scope, + CAST('' AS VARCHAR) AS dosage_instruction, + CAST(0 AS INTEGER) AS chrgitm_lv + FROM med_medication_definition mmd + WHERE 1 = 0 -- 仍然确保不返回任何行,但使用真实表确保类型正确 + ) AS abi ${ew.customSqlSegment} diff --git a/openhis-ui-vue3/src/views/doctorstation/components/adviceBaseList.vue b/openhis-ui-vue3/src/views/doctorstation/components/adviceBaseList.vue index 73abd10c..b49ce2e7 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/adviceBaseList.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/adviceBaseList.vue @@ -215,8 +215,18 @@ getList(); // 从priceList列表中获取价格 function getPriceFromInventory(row) { if (row.priceList && row.priceList.length > 0) { - const price = row.priceList[0].price || 0; - return Number(price).toFixed(2) + ' 元'; + const price = row.priceList[0].price; + // 检查价格是否为有效数字 + if (price !== undefined && price !== null && !isNaN(price) && isFinite(price)) { + return Number(price).toFixed(2) + ' 元'; + } + // 如果价格无效,尝试从其他可能的字段获取价格 + if (row.totalPrice !== undefined && row.totalPrice !== null && !isNaN(row.totalPrice) && isFinite(row.totalPrice)) { + return Number(row.totalPrice).toFixed(2) + ' 元'; + } + if (row.price !== undefined && row.price !== null && !isNaN(row.price) && isFinite(row.price)) { + return Number(row.price).toFixed(2) + ' 元'; + } } return '-'; } diff --git a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index 91251430..f49f247f 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -96,7 +96,7 @@ ' ' + scope.row.volume + ' [' + - Number(scope.row.unitPrice).toFixed(2) + + (scope.row.unitPrice !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) && isFinite(scope.row.unitPrice) ? Number(scope.row.unitPrice).toFixed(2) : '-') + ' 元' + '/' + scope.row.unitCode_dictText + @@ -145,7 +145,7 @@ 注射药品:{{ scope.row.injectFlag_enumText }} 总金额:{{ - scope.row.totalPrice + (scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice)) ? Number(scope.row.totalPrice).toFixed(2) + ' 元' : '0.00 元' }} @@ -631,7 +631,7 @@ " " + scope.row.volume + " [" + - Number(scope.row.unitPrice).toFixed(2) + + (scope.row.unitPrice !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) && isFinite(scope.row.unitPrice) ? Number(scope.row.unitPrice).toFixed(2) : '-') + " 元" + "/" + scope.row.unitCode_dictText + @@ -687,7 +687,7 @@ 总金额:{{ - scope.row.totalPrice + (scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice)) ? Number(scope.row.totalPrice).toFixed(2) + ' 元' : '0.00 元' }} @@ -702,7 +702,7 @@ {{ scope.row.adviceName }} {{ - scope.row.unitPrice + (scope.row.unitPrice !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) && isFinite(scope.row.unitPrice)) ? Number(scope.row.unitPrice).toFixed(2) + '/次' : '-' + '元' }} @@ -748,7 +748,7 @@ 总金额: {{ - scope.row.totalPrice + (scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice)) ? Number(scope.row.totalPrice).toFixed(2) + ' 元' : '0.00 元' }} @@ -907,7 +907,7 @@ @@ -2852,12 +2852,25 @@ function getGroupMarkers() { function calculateTotalPrice(row, index) { nextTick(() => { if (row.adviceType == 3) { - row.totalPrice = (row.unitPrice * row.quantity).toFixed(6); + // 检查价格是否为有效数字 + if (row.unitPrice !== undefined && row.unitPrice !== null && !isNaN(row.unitPrice) && isFinite(row.unitPrice)) { + row.totalPrice = (row.unitPrice * row.quantity).toFixed(6); + } else { + row.totalPrice = '0.000000'; // 或者设置为 0 + } } else { if (row.unitCode == row.minUnitCode) { - row.totalPrice = (row.minUnitPrice * row.quantity).toFixed(6); + if (row.minUnitPrice !== undefined && row.minUnitPrice !== null && !isNaN(row.minUnitPrice) && isFinite(row.minUnitPrice)) { + row.totalPrice = (row.minUnitPrice * row.quantity).toFixed(6); + } else { + row.totalPrice = '0.000000'; + } } else { - row.totalPrice = (row.unitPrice * row.quantity).toFixed(6); + if (row.unitPrice !== undefined && row.unitPrice !== null && !isNaN(row.unitPrice) && isFinite(row.unitPrice)) { + row.totalPrice = (row.unitPrice * row.quantity).toFixed(6); + } else { + row.totalPrice = '0.000000'; + } } } });