Browse Source

fix(forecast): 将预测数量默认值从0改为1以改善用户体验

yz 2 weeks ago
parent
commit
88a5e35bc0

+ 4 - 4
src/components/forecast-form/forecast-form-mixin.js

@@ -1240,8 +1240,8 @@ export default {
         this.brandDescList = brandList
         // 存储库存列表供选择用,不直接展示到表格
         this.stockDescList = stockList
-        // 默认显示全部物料至下方表格,预测数量默认 0,用户可手动删除不需要的物料
-        this.stockTableData = stockList.map(item => ({ ...item, forecastQuantity: 0 }))
+        // 默认显示全部物料至下方表格,预测数量默认 1,用户可手动删除不需要的物料
+        this.stockTableData = stockList.map(item => ({ ...item, forecastQuantity: 1 }))
         // 根据表格中已有的物料,过滤下拉选项
         this.updateStockSelectOptions()
         // 规范化分页并回显选择(新增模式首次加载)
@@ -1296,8 +1296,8 @@ export default {
         return
       }
 
-      // 添加到表格,默认预测数量为 0
-      this.stockTableData.push({ ...stock, forecastQuantity: 0 })
+      // 添加到表格,默认预测数量为 1
+      this.stockTableData.push({ ...stock, forecastQuantity: 1 })
       // 清空已选
       this.selectedStockId = null
       // 导入后更新下拉选项(过滤掉已在表格中的物料)

+ 1 - 1
src/components/forecast-form/index.js

@@ -340,7 +340,7 @@ export default {
         itemName: '',
         specs: '',
         itemSpecs: '',
-        forecastQuantity: 0,
+        forecastQuantity: 1,
         currentInventory: null,
         approvalStatus: APPROVAL_STATUS.PENDING,
         approvedName: '',

+ 1 - 1
src/constants/forecast.js

@@ -586,7 +586,7 @@ export const DEFAULT_FORECAST_SUMMARY_FORM = {
   itemName: '',
   specs: '',
   itemSpecs: '',
-  forecastQuantity: 0,
+  forecastQuantity: 1,
   currentInventory: 0,
   approvalStatus: APPROVAL_STATUS.PENDING,
   approvedName: '',