|
@@ -109,7 +109,7 @@
|
|
|
<el-table v-loading="loading" :data="annualSaleGoalList" @selection-change="handleSelectionChange" @row-dblclick="useDoubleClick"
|
|
|
v-horizontal-scroll>
|
|
|
<el-table-column label="编码" align="center" prop="code" width="180" />
|
|
|
- <el-table-column label="目标名称" align="center" prop="goalName" width="180" />
|
|
|
+ <el-table-column label="目标名称" align="center" prop="goalName" width="240" />
|
|
|
<el-table-column label="单据日期" align="center" prop="documentDate" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.documentDate, '{y}-{m}-{d}') }}</span>
|
|
@@ -120,7 +120,7 @@
|
|
|
<el-table-column label="销售区域" align="center" prop="saleZone" width="180" />
|
|
|
<el-table-column label="制单人" align="center" prop="creator" />
|
|
|
<el-table-column label="部门" align="center" prop="dept" width="180" />
|
|
|
- <el-table-column label="目标合计" align="center" prop="goalTotal" />
|
|
|
+ <el-table-column label="目标合计(元)" align="center" prop="goalTotal" />
|
|
|
<el-table-column label="备注" align="center" prop="notes" width="180" />
|
|
|
<el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
|
|
|
<template slot-scope="scope">
|
|
@@ -204,7 +204,7 @@
|
|
|
</el-row>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="目标合计" prop="goalTotal">
|
|
|
+ <el-form-item label="目标合计(元)" prop="goalTotal">
|
|
|
<el-input v-model="form.goalTotal" placeholder="目标合计自动计算" clearable disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -309,89 +309,89 @@
|
|
|
</el-popover-select-v2>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="合计" align="center" prop="totalGoal" width="180">
|
|
|
+ <el-table-column label="合计(元)" align="center" prop="totalGoal" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input v-model="annualSaleGoalDetailsList[scope.$index].totalGoal" disabled></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="一月" align="center" prop="januaryGoal" width="220">
|
|
|
+ <el-table-column label="一月(元)" align="center" prop="januaryGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].januaryGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="二月" align="center" prop="februaryGoal" width="220">
|
|
|
+ <el-table-column label="二月(元)" align="center" prop="februaryGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].februaryGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="三月" align="center" prop="marchGoal" width="220">
|
|
|
+ <el-table-column label="三月(元)" align="center" prop="marchGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].marchGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="四月" align="center" prop="aprilGoal" width="220">
|
|
|
+ <el-table-column label="四月(元)" align="center" prop="aprilGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].aprilGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="五月" align="center" prop="mayGoal" width="220">
|
|
|
+ <el-table-column label="五月(元)" align="center" prop="mayGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].mayGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="六月" align="center" prop="juneGoal" width="220">
|
|
|
+ <el-table-column label="六月(元)" align="center" prop="juneGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].juneGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="七月" align="center" prop="julyGoal" width="220">
|
|
|
+ <el-table-column label="七月(元)" align="center" prop="julyGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].julyGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="八月" align="center" prop="augustGoal" width="220">
|
|
|
+ <el-table-column label="八月(元)" align="center" prop="augustGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].augustGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="九月" align="center" prop="septemberGoal" width="220">
|
|
|
+ <el-table-column label="九月(元)" align="center" prop="septemberGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].septemberGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="十月" align="center" prop="octoberGoal" width="220">
|
|
|
+ <el-table-column label="十月(元)" align="center" prop="octoberGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].octoberGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="十一月" align="center" prop="novemberGoal" width="220">
|
|
|
+ <el-table-column label="十一月(元)" align="center" prop="novemberGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].novemberGoal" :precision="2" :step="0.1" :min="0">
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="十二月" align="center" prop="decemberGoal" width="220">
|
|
|
+ <el-table-column label="十二月(元)" align="center" prop="decemberGoal" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
|
|
|
v-model="annualSaleGoalDetailsList[scope.$index].decemberGoal" :precision="2" :step="0.1" :min="0">
|
|
@@ -693,6 +693,9 @@
|
|
|
this.annualSaleGoalList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
+ this.annualSaleGoalList.forEach(item => {
|
|
|
+ item.goalTotal = item.goalTotal.toFixed(2);
|
|
|
+ })
|
|
|
console.log(this.annualSaleGoalList);
|
|
|
});
|
|
|
},
|
|
@@ -989,7 +992,31 @@
|
|
|
this.form.goalTotal = sum.toFixed(2)
|
|
|
},
|
|
|
getSummaries(param) {
|
|
|
- return getSummary(param)
|
|
|
+ console.log(param, 'param')
|
|
|
+ const { columns, data } = param;
|
|
|
+ console.log(columns, 'columns')
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '小计';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const values = data.map(item => Number(item[column.property]));
|
|
|
+ if (!values.every(value => isNaN(value))) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0);
|
|
|
+ sums[index] = sums[index].toFixed(2);
|
|
|
+ } else {
|
|
|
+ sums[index] = ' ';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
},
|
|
|
// 给table添加必填项
|
|
|
addRedStar(h, {
|