Explorar o código

fix: 更新税率字段格式化逻辑,避免不必要的乘法运算

xieyong hai 6 días
pai
achega
eb71957e05

+ 5 - 1
src/views/saleManage/saleOrder/accountPool/components/detailDialog.vue

@@ -186,7 +186,11 @@
             fields: [
               f('含税单价', this.money(d.taxSinglePrice)),
               f('不含税单价', Number(d.noTaxSinglePrice).toFixed(4)),
-              f('税率', `${Math.round(d.taxRate * 100)}%`),
+              // 接口 taxRate 已按百分数返回(如 13 表示 13%),不再乘 100
+              f(
+                '税率',
+                d.taxRate === null || d.taxRate === undefined || d.taxRate === '' ? '' : `${Math.round(d.taxRate)}%`
+              ),
               f('折扣率', d.discountRate)
             ]
           },

+ 5 - 1
src/views/saleManage/saleOrder/accountPool/index.vue

@@ -450,7 +450,11 @@
                 label: '税率',
                 width: 80,
                 align: 'right',
-                formatter: (row) => `${Math.round(row.taxRate * 100)}%`
+                // 接口 taxRate 已按百分数返回(如 13 表示 13%),不再乘 100
+                formatter: (row) =>
+                  row.taxRate === null || row.taxRate === undefined || row.taxRate === ''
+                    ? ''
+                    : `${Math.round(row.taxRate)}%`
               },
               {
                 prop: 'discountRate',