Browse Source

目标管理-营销目标增加产品线(树形结构)参照;月销售目标填报中销售目标是否达标的校验改为用单据日期来确定时间。

DongZ 1 year ago
parent
commit
fd25abf546

+ 9 - 5
src/views/business/spd/target/MonthSaleGoal.vue

@@ -163,7 +163,7 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="单据日期" prop="documentDate">
-              <el-date-picker clearable v-model="form.documentDate" type="date" value-format="yyyy-MM-dd"
+              <el-date-picker clearable v-model="form.documentDate" type="date" value-format="yyyy-MM-dd" @change="setItemMonthly"
                 placeholder="请选择单据日期">
               </el-date-picker>
             </el-form-item>
@@ -852,8 +852,7 @@
           material: null,
           department: null,
           num: null,
-          monthly: new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2,
-            '0'),
+          monthly: this.form.documentDate.substring(0, 7),
           goalValue: 0,
           profitTargetValue: 0
         }
@@ -1327,8 +1326,7 @@
             item.custom = this.form.custom;
             item.dept = this.form.dept;
             item.creator = this.form.creator;
-            item.monthly = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString()
-              .padStart(2, '0');
+            item.monthly = this.form.documentDate.substring(0, 7);
           }
         }).catch((e) => {
           this.$message.error(e.message)
@@ -1381,6 +1379,12 @@
           }
         }
       },
+      // 当单据日期改变时改变明细月份
+      setItemMonthly() {
+        for (let i = 0; i < this.monthSaleGoalDetailsList.length; i++) {
+          this.monthSaleGoalDetailsList[i].monthly = this.form.documentDate.substring(0, 7);
+        }
+      },
     }
   }
 

+ 1 - 1
src/views/business/spd/target/targetMk/item.vue

@@ -30,7 +30,7 @@
               />
               <el-popover-tree-select 
                 size="mini" 
-                v-else-if="scope.row[head.prop].model == 'MATERIALCLASSIFY_PARAM' || scope.row[head.prop].model == 'PROFITCENTER'"
+                v-else-if="scope.row[head.prop].model == 'MATERIALCLASSIFY_PARAM' || scope.row[head.prop].model == 'PROFITCENTER' || scope.row[head.prop].model == 'PRODUCTLINE'"
                 v-model="scope.row[head.prop].valueName" 
                 valueKey='name'
                 title="参照选择"