Pārlūkot izejas kodu

fix(forecast): 确保客户ID和年份字段为字符串类型

yz 1 nedēļu atpakaļ
vecāks
revīzija
8130d46527
1 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. 7 2
      src/views/forecast/forecastIndex.js

+ 7 - 2
src/views/forecast/forecastIndex.js

@@ -295,7 +295,7 @@ export default {
         })
         if (res.data && res.data.success) {
           this.customerOptions = res.data.data.records.map(item => ({
-            value: item.Customer_ID,
+            value: item.Customer_ID.toString(),
             label: item.Customer_NAME,
             customerCode: item.Customer_CODE,
             customerName: item.Customer_NAME
@@ -522,7 +522,12 @@ export default {
       }
 
       this.isEdit = true
-      this.form = { ...row }
+      this.form = { 
+        ...row,
+        // 确保年份字段为字符串类型,以匹配el-date-picker的value-format="yyyy"
+        year: row.year ? row.year.toString() : new Date().getFullYear().toString(),
+        customerId: row.customerId.toString(),
+      }
       this.dialogVisible = true
     },