Browse Source

fix(forecast-form): 将默认预测数量从1改为0

yz 2 weeks ago
parent
commit
13d6d54601
2 changed files with 5 additions and 5 deletions
  1. 1 1
      README.md
  2. 4 4
      src/components/forecast-form/forecast-form-mixin.js

+ 1 - 1
README.md

@@ -40,7 +40,7 @@ npm install --registry=https://registry.npmmirror.com
 来源:doc/库比森交流会议纪要.xlsx(Sheet1)
 
 - 预测功能
-  - [ ] 预测数量默认值设为 0(急)
+  - [x] 预测数量默认值设为 0(急)
   - [ ] 预测物料明细分页展示(否)
   - [ ] 若预算月份已存在,禁用“新增预测”(急)
   - [ ] 明细表头增加“品牌”下拉,支持多品牌(否)

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

@@ -1154,7 +1154,7 @@ export default {
           value: item.id
         }))
         // 默认显示全部物料至下方表格,预测数量默认 0,用户可手动删除不需要的物料
-        this.stockTableData = stockList.map(item => ({ ...item, forecastQuantity: 1 }))
+        this.stockTableData = stockList.map(item => ({ ...item, forecastQuantity: 0 }))
       } catch (e) {
         console.error('加载用户关联商品失败:', e)
         this.$message.error(e.message || '加载用户关联商品失败')
@@ -1165,7 +1165,7 @@ export default {
 
     /**
      * 导入所选物料到下方表格
-     * @description 仅在点击"导入物料"按钮后,将选择的物料行添加到表格,默认预测数量为 1
+     * @description 仅在点击"导入物料"按钮后,将选择的物料行添加到表格,默认预测数量为 0
      * @returns {void}
      * @this {ForecastFormMixinComponent & Vue}
      */
@@ -1205,8 +1205,8 @@ export default {
         return
       }
       
-      // 添加到表格,默认预测数量为 1
-      this.stockTableData.push({ ...stock, forecastQuantity: 1 })
+      // 添加到表格,默认预测数量为 0
+      this.stockTableData.push({ ...stock, forecastQuantity: 0 })
       // 清空已选
       this.selectedStockId = null
     },