|
@@ -315,6 +315,9 @@
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddDetails">增行</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" plain icon="el-icon-folder-opened" size="mini" @click="clickMerge">合 并</el-button>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
<!-- v-loading="loading"-->
|
|
|
<el-table :data="monthGoalMergeDetailsList" @selection-change="handleSelectionChange">
|
|
@@ -443,7 +446,8 @@ import {
|
|
|
} from "@/api/business/spd/goal_management/monthGoalMerge";
|
|
|
import {
|
|
|
getMonthSaleGoalDetails,
|
|
|
- delMonthSaleGoalDetails
|
|
|
+ delMonthSaleGoalDetails,
|
|
|
+ mergeAnnualSaleMergeDetails
|
|
|
} from "@/api/business/spd/goal_management/monthSaleGoalDetails"
|
|
|
|
|
|
// 树形参照
|
|
@@ -737,7 +741,7 @@ export default {
|
|
|
this.computeTotal()
|
|
|
} else {
|
|
|
if (row.id !== null) {
|
|
|
- this.$modal.confirm('是否确认删除月销售目标合并明细编号为"' + ids + '"的数据项?').then(function () {
|
|
|
+ this.$modal.confirm('是否确认删除月销售目标合并明细编号为"' + row.id + '"的数据项?').then(function () {
|
|
|
return delMonthSaleGoalDetails(row.id);
|
|
|
}).then(() => {
|
|
|
this.getListDetails();
|
|
@@ -955,6 +959,42 @@ export default {
|
|
|
sum = (sum * 1000000 + listElement.goalValue * 1000000) / 1000000
|
|
|
}
|
|
|
this.form.goalSum = sum
|
|
|
+ },
|
|
|
+ // 合并数据
|
|
|
+ clickMerge() {
|
|
|
+ let classify = this.form.goalCategory
|
|
|
+ let classifyValue;
|
|
|
+ if (classify === null || classify === '') {
|
|
|
+ return this.$message.error('请输入目标分类')
|
|
|
+ } else if (classify === '销售区域') {
|
|
|
+ classifyValue = this.form.saleZone
|
|
|
+ if (classifyValue === null) {
|
|
|
+ return this.$message.error('请输入销售区域')
|
|
|
+ }
|
|
|
+ } else if (classify === '一级分类') {
|
|
|
+ classifyValue = this.form.oneLevelClassify
|
|
|
+ if (classifyValue === null) {
|
|
|
+ return this.$message.error('请输入一级分类')
|
|
|
+ }
|
|
|
+ } else if (classify === '二级分类') {
|
|
|
+ classifyValue = this.form.twoLevelClassify
|
|
|
+ if (classifyValue === null) {
|
|
|
+ return this.$message.error('请输入二级分类')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let query = { classify: classify, classifyValue: classifyValue }
|
|
|
+ mergeAnnualSaleMergeDetails(query).then(response => {
|
|
|
+ console.log(response);
|
|
|
+ this.annualSaleGoalMergeDetailsList = response.data.consolidatedDetail
|
|
|
+ if (classify !== '销售区域') {
|
|
|
+ this.areaDetailList = []
|
|
|
+ this.customerDetailList = []
|
|
|
+ } else {
|
|
|
+ this.areaDetailList = response.data.areaDetail
|
|
|
+ this.customerDetailList = response.data.customerDetail
|
|
|
+ }
|
|
|
+ this.computeTotal()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
};
|