scorpio 2 éve
szülő
commit
246e5884e5
1 módosított fájl, 8 hozzáadás és 7 törlés
  1. 8 7
      src/views/home/component/params/params3.vue

+ 8 - 7
src/views/home/component/params/params3.vue

@@ -289,10 +289,10 @@ export default {
           this.form.month_investment_amount[this.current.index].sum = this.getSum(this.form.month_investment_amount[this.current.index].monthlyData)
         }
         // 生成年月字段
-        this.initYearMonth(this.form.month_plan_complete_amount, '_month_plan_complete_amount')
-        this.initYearMonth(this.form.month_complete_amount, '_month_complete_amount')
-        this.initYearMonth(this.form.month_plan_investment, '_month_plan_investment')
-        this.initYearMonth(this.form.month_investment_amount, '_month_investment_amount')
+        this.initYearMonth(this.form.month_plan_complete_amount, '_month_plan_complete_amount', '_yearly_plan_complete_amount')
+        this.initYearMonth(this.form.month_complete_amount, '_month_complete_amount', '_yearly_complete_amount')
+        this.initYearMonth(this.form.month_plan_investment, '_month_plan_investment', '_yearly_plan_investment')
+        this.initYearMonth(this.form.month_investment_amount, '_month_investment_amount', '_yearly_complete_investment')
         delete this.form._id
         this.$api.project.proUpdate(this.detail).then(res => {
           if (res.code === 200) {
@@ -310,12 +310,13 @@ export default {
     /**
      * 组合字段
      * @param list
-     * @param key
+     * @param key 月度关键词
+     * @param key1 年度关键词
      */
-    initYearMonth (list, key) {
+    initYearMonth (list, key, key1) {
       if (list.length > 0) {
         list.forEach(sub => {
-          let tmp = this.kv(sub.year + '_yearly_' + key, sub.sum)
+          let tmp = this.kv(sub.year + key1, sub.sum)
           sub.monthlyData.forEach(res => {
             const month = this.kv(res.year + '_' + res.month + key, res.data)
             tmp = Object.assign(tmp, month)