|
@@ -292,14 +292,22 @@
|
|
|
</el-popover-select-v2>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="一级分类" align="center" prop="oneLevelClassify" width="180">
|
|
|
+ <el-table-column label="一级分类" align="center" prop="oneLevelClassify" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="annualSaleGoalDetailsList[scope.$index].oneLevelClassify" disabled></el-input>
|
|
|
+ <el-select v-model="annualSaleGoalDetailsList[scope.$index].oneLevelClassify" size="mini" clearable
|
|
|
+ @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)"
|
|
|
+ style="width: 200px">
|
|
|
+ <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="二级分类" align="center" prop="twoLevelClassify" width="180">
|
|
|
+ <el-table-column label="二级分类" align="center" prop="twoLevelClassify" width="220">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="annualSaleGoalDetailsList[scope.$index].twoLevelClassify" disabled></el-input>
|
|
|
+ <el-select v-model="annualSaleGoalDetailsList[scope.$index].twoLevelClassify" size="mini" clearable
|
|
|
+ @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)"
|
|
|
+ style="width: 200px">
|
|
|
+ <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="物料" align="center" prop="material" width="180">
|
|
@@ -395,6 +403,8 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
+
|
|
|
+ <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -543,8 +553,8 @@ export default {
|
|
|
dept: [{required: true, message: '部门不能为空', trigger: 'blur'}]
|
|
|
},
|
|
|
// 参照条件
|
|
|
- referCondition: {type: '', isPage: true, title: ''},
|
|
|
- classList: [],
|
|
|
+ referCondition: {type: '', isPage: true, title: '', index: null},
|
|
|
+ classOptions: [],
|
|
|
// 子表数组
|
|
|
annualSaleGoalDetailsList: [],
|
|
|
// 按钮使用权
|
|
@@ -609,6 +619,27 @@ export default {
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
+ this.queryParams = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ code: null,
|
|
|
+ goalName: null,
|
|
|
+ documentDate: null,
|
|
|
+ annual: null,
|
|
|
+ customCode: null,
|
|
|
+ custom: null,
|
|
|
+ saleZoneCode: null,
|
|
|
+ saleZone: null,
|
|
|
+ creatorCode: null,
|
|
|
+ creator: null,
|
|
|
+ deptCode: null,
|
|
|
+ dept: null,
|
|
|
+ goalTotal: null,
|
|
|
+ notes: null,
|
|
|
+ documentStatus: null,
|
|
|
+ deleteStatus: null,
|
|
|
+ documentDateRange: null
|
|
|
+ }
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
@@ -661,15 +692,15 @@ export default {
|
|
|
const id = row.id || this.ids
|
|
|
getAnnualSaleGoal(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改年度销售目标";
|
|
|
if (this.form.documentStatus === '0') {
|
|
|
this.form.documentStatus = '未提交'
|
|
|
} else if (this.form.documentStatus === '1') {
|
|
|
this.form.documentStatus = '审批中'
|
|
|
- } else {
|
|
|
+ } else if (this.form.documentStatus === '2') {
|
|
|
this.form.documentStatus = '已审核'
|
|
|
}
|
|
|
- this.open = true;
|
|
|
- this.title = "修改年度销售目标";
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
@@ -781,7 +812,37 @@ export default {
|
|
|
sum = (sum * 1000000 + listElement.totalGoal * 1000000) / 1000000
|
|
|
}
|
|
|
this.form.goalTotal = sum
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 树形物料分类
|
|
|
+ chooseTreeReferForDetails(type, isPage, title, index) {
|
|
|
+ this.referCondition.type = type
|
|
|
+ this.referCondition.isPage = isPage
|
|
|
+ this.referCondition.title = title
|
|
|
+ this.referCondition.index = index
|
|
|
+ this.$refs.treeDetails.init(this.referCondition)
|
|
|
+ },
|
|
|
+ selectionsToInputForDetails(selection) {
|
|
|
+ this.classOptions.push(selection)
|
|
|
+ if (this.referCondition.title === '一级物料分类') {
|
|
|
+ if (selection.code.length !== 1) {
|
|
|
+ return this.$message.info('请在一级分类中选择')
|
|
|
+ }
|
|
|
+ this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode = selection.code
|
|
|
+ this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassify = selection.name
|
|
|
+ if (selection.code !== this.formDetails.oneLevelClassifyCode) {
|
|
|
+ this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = null
|
|
|
+ this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = null
|
|
|
+ }
|
|
|
+ } else if (this.referCondition.title === '二级物料分类') {
|
|
|
+ if (selection.code.length !== 4) {
|
|
|
+ return this.$message.info('请在二级分类中选择')
|
|
|
+ } else if (selection.code[0] !== this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
|
|
|
+ return this.$message.error('所选择的二级物料分类不属于一级分类')
|
|
|
+ }
|
|
|
+ this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = selection.code
|
|
|
+ this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = selection.name
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|