src/views/salesManagement/salesQuotation/index.vue
@@ -65,7 +65,7 @@
        </el-table-column>
        <el-table-column prop="totalAmount" label="报价金额" width="120">
          <template #default="scope">
            ¥{{ scope.row.totalAmount.toFixed(2) }}
            ¥{{ formatDecimal(scope.row.totalAmount) }}
          </template>
        </el-table-column>
        <el-table-column label="操作" width="200" fixed="right" align="center">
@@ -215,7 +215,7 @@
            <el-table-column prop="unitPrice" label="单价">
              <template #default="scope">
                <el-form-item :prop="`products.${scope.$index}.unitPrice`" class="product-table-form-item">
                  <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="2" style="width: 100%" />
                  <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="6" :step="0.000001" style="width: 100%" />
                </el-form-item>
              </template>
            </el-table-column>
@@ -267,7 +267,7 @@
<!--          <el-tag :type="getStatusType(currentQuotation.status)">{{ currentQuotation.status }}</el-tag>-->
<!--        </el-descriptions-item>-->
        <el-descriptions-item label="报价总额" :span="2">
          <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">¥{{ currentQuotation.totalAmount?.toFixed(2) }}</span>
          <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">¥{{ formatDecimal(currentQuotation.totalAmount) }}</span>
        </el-descriptions-item>
      </el-descriptions>
@@ -279,7 +279,7 @@
          <el-table-column prop="unit" label="单位" />
          <el-table-column prop="unitPrice" label="单价">
            <template #default="scope">
              ¥{{ scope.row.unitPrice.toFixed(2) }}
              ¥{{ formatDecimal(scope.row.unitPrice) }}
            </template>
          </el-table-column>
        </el-table>
@@ -303,6 +303,7 @@
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {listCustomer} from "@/api/basicData/customer.js";
import { userListNoPage } from "@/api/system/user.js";
import { formatDecimal, roundAmount } from '@/utils/numberFormat';
// 响应式数据
const loading = ref(false)
@@ -686,11 +687,11 @@
        return
      }
      // 计算所有产品的单价总和
      form.totalAmount = form.products.reduce((sum, product) => {
      // 计算所有产品的单价总和,保留六位小数
      form.totalAmount = roundAmount(form.products.reduce((sum, product) => {
        const price = Number(product.unitPrice) || 0
        return sum + price
      }, 0)
      }, 0))
      form.customer = customerOption.value.find(item => item.id === form.customerId)?.customerName || ''
      if (isEdit.value) {