From 0a251e40e30e7c8a96d71b3b9b6c459d4dfa4b22 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 08 七月 2026 23:04:45 +0800
Subject: [PATCH] 暂存

---
 src/views/salesManagement/salesQuotation/index.vue |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index c79dd4c..455f686 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/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(6) }}
+            楼{{ 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="6" 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(6) }}</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(6) }}
+              楼{{ 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)
@@ -346,6 +347,7 @@
 
 const baseRules = {
   customer: [{ required: true, message: '璇烽�夋嫨瀹㈡埛', trigger: 'change' }],
+  customerId: [{ required: true, message: '璇烽�夋嫨瀹㈡埛', trigger: 'change' }],
   salesperson: [{ required: true, message: '璇烽�夋嫨涓氬姟鍛�', trigger: 'change' }],
   quotationDate: [{ required: true, message: '璇烽�夋嫨鎶ヤ环鏃ユ湡', trigger: 'change' }],
   validDate: [{ required: true, message: '璇烽�夋嫨鏈夋晥鏈�', trigger: 'change' }],
@@ -536,7 +538,6 @@
 }
 
 const handleEdit = async (row) => {
-  console.log("1111111111111111111", row)
   dialogTitle.value = '缂栬緫鎶ヤ环'
   isEdit.value = true
   editId.value = row.id
@@ -687,11 +688,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) {

--
Gitblit v1.9.3