|
|
@@ -122,6 +122,7 @@
|
|
|
|
|
|
<script>
|
|
|
import baseButton from '@/components/base-button.vue'
|
|
|
+import { deepClone } from '@/utils/tools.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'params3',
|
|
|
@@ -254,6 +255,7 @@ export default {
|
|
|
return sub
|
|
|
})
|
|
|
// 复制差集
|
|
|
+ console.log(d)
|
|
|
if (res.month_complete_amount.length === this.completeCount) {
|
|
|
d.forEach(sub => {
|
|
|
if (res.month_plan_complete_amount.findIndex(ele => ele.year === sub.year) === -1) {
|
|
|
@@ -282,7 +284,6 @@ export default {
|
|
|
if (this.form.month_complete_amount[this.current.index] !== undefined && this.form.month_complete_amount.length > 0) {
|
|
|
this.form.month_complete_amount[this.current.index].sum = this.getSum(this.form.month_complete_amount[this.current.index].monthlyData)
|
|
|
}
|
|
|
- console.log(this.form.month_plan_investment)
|
|
|
if (this.form.month_plan_investment[this.current.index] !== undefined && this.form.month_plan_investment.length > 0) {
|
|
|
this.form.month_plan_investment[this.current.index].sum = this.getSum(this.form.month_plan_investment[this.current.index].monthlyData)
|
|
|
}
|
|
|
@@ -340,13 +341,21 @@ export default {
|
|
|
*/
|
|
|
showMonth (year, type, index) {
|
|
|
this.$nextTick(() => {
|
|
|
- const item = { editType: type, year, index }
|
|
|
+ const item = { editType: type, year, index, planMonths: [], months: [] }
|
|
|
if (type === 1) {
|
|
|
- item.planMonths = this.form.month_plan_complete_amount.find(sub => sub.year === year).monthlyData
|
|
|
- item.months = this.form.month_complete_amount.find(sub => sub.year === year).monthlyData
|
|
|
+ this.form.month_plan_complete_amount.find(sub => sub.year === year).monthlyData.forEach(sub => {
|
|
|
+ item.planMonths.push(deepClone(sub))
|
|
|
+ })
|
|
|
+ this.form.month_complete_amount.find(sub => sub.year === year).monthlyData.forEach(sub => {
|
|
|
+ item.months.push(deepClone(sub))
|
|
|
+ })
|
|
|
} else if (type === 2) {
|
|
|
- item.planMonths = this.form.month_plan_investment.find(sub => sub.year === year).monthlyData
|
|
|
- item.months = this.form.month_investment_amount.find(sub => sub.year === year).monthlyData
|
|
|
+ this.form.month_plan_investment.find(sub => sub.year === year).monthlyData.forEach(sub => {
|
|
|
+ item.planMonths.push(deepClone(sub))
|
|
|
+ })
|
|
|
+ this.form.month_investment_amount.find(sub => sub.year === year).monthlyData.forEach(sub => {
|
|
|
+ item.months.push(deepClone(sub))
|
|
|
+ })
|
|
|
}
|
|
|
this.current = Object.assign({}, item)
|
|
|
for (let i = 1; i <= 11; i++) {
|