|
@@ -319,7 +319,7 @@
|
|
</el-row>
|
|
</el-row>
|
|
<el-tabs v-model="activeName">
|
|
<el-tabs v-model="activeName">
|
|
<el-tab-pane label="月销售目标明细" name="monthSaleGoalDetails">
|
|
<el-tab-pane label="月销售目标明细" name="monthSaleGoalDetails">
|
|
- <el-table show-summary sum-text="小计" v-loading="loading" :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange">
|
|
|
|
|
|
+ <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange">
|
|
<el-table-column label="序号" type="index" width="70" align="center" fixed />
|
|
<el-table-column label="序号" type="index" width="70" align="center" fixed />
|
|
<el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
|
|
<el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -366,29 +366,22 @@
|
|
</el-popover-select-v2>
|
|
</el-popover-select-v2>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="一级分类" align="center" width="220" :render-header="addRedStar">
|
|
|
|
|
|
+ <el-table-column label="一级分类" align="center" width="180" :render-header="addRedStar">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-select v-model="monthSaleGoalDetailsList[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>
|
|
|
|
|
|
+ <el-input v-model="monthSaleGoalDetailsList[scope.$index].oneLevelClassify" placeholder="请输入一级分类" disabled></el-input>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="二级分类" align="center" width="220" :render-header="addRedStar">
|
|
|
|
|
|
+ <el-table-column label="二级分类" align="center" width="180" :render-header="addRedStar">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-select v-model="monthSaleGoalDetailsList[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>
|
|
|
|
|
|
+ <el-input v-model="monthSaleGoalDetailsList[scope.$index].twoLevelClassify" placeholder="请输入二级分类" disabled></el-input>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="物料" align="center" width="180">
|
|
|
|
|
|
+ <el-table-column label="物料" align="center" width="180" :render-header="addRedStar">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].material" title="物料" valueKey="name"
|
|
<el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].material" title="物料" valueKey="name"
|
|
referName="MATERIAL_PARAM"
|
|
referName="MATERIAL_PARAM"
|
|
- :dataMapping="{ materialCode: 'code', material: 'name'}"
|
|
|
|
|
|
+ @change="setClassify(scope.row.oneLevelClassify, scope.row.twoLevelClassify, monthSaleGoalDetailsList[scope.$index])"
|
|
|
|
+ :dataMapping="{ materialCode: 'code', material: 'name', oneLevelClassify: 'oneClass', twoLevelClassify: 'twoClass'}"
|
|
:source.sync="monthSaleGoalDetailsList[scope.$index]" placeholder="请输入物料">
|
|
:source.sync="monthSaleGoalDetailsList[scope.$index]" placeholder="请输入物料">
|
|
</el-popover-select-v2>
|
|
</el-popover-select-v2>
|
|
</template>
|
|
</template>
|
|
@@ -469,8 +462,6 @@
|
|
<el-button @click="upload.open = false">取 消</el-button>
|
|
<el-button @click="upload.open = false">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
-
|
|
|
|
- <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -615,9 +606,6 @@ export default {
|
|
creator: [{ required: true, message: '制单人不能为空', trigger: 'blur' }],
|
|
creator: [{ required: true, message: '制单人不能为空', trigger: 'blur' }],
|
|
dept: [{ required: true, message: '部门不能为空', trigger: 'blur' }]
|
|
dept: [{ required: true, message: '部门不能为空', trigger: 'blur' }]
|
|
},
|
|
},
|
|
- // 参照条件
|
|
|
|
- referCondition: { type: '', isPage: true, title: '', index: null },
|
|
|
|
- classOptions: [],
|
|
|
|
// 子表导航名
|
|
// 子表导航名
|
|
activeName: 'monthSaleGoalDetails',
|
|
activeName: 'monthSaleGoalDetails',
|
|
// 用户导入参数
|
|
// 用户导入参数
|
|
@@ -899,36 +887,6 @@ export default {
|
|
}
|
|
}
|
|
this.form.goalSum = sum
|
|
this.form.goalSum = 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('请在一级分类中选择')
|
|
|
|
- }
|
|
|
|
- if (selection.code !== this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
|
|
|
|
- this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = null
|
|
|
|
- this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = null
|
|
|
|
- }
|
|
|
|
- this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode = selection.code
|
|
|
|
- this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassify = selection.name
|
|
|
|
- } else if (this.referCondition.title === '二级物料分类') {
|
|
|
|
- if (selection.code.length !== 4) {
|
|
|
|
- return this.$message.info('请在二级分类中选择')
|
|
|
|
- } else if (selection.code[0] !== this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
|
|
|
|
- return this.$message.error('所选择的二级物料分类不属于一级分类')
|
|
|
|
- }
|
|
|
|
- this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = selection.code
|
|
|
|
- this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = selection.name
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
// 子表table加必填标志
|
|
// 子表table加必填标志
|
|
addRedStar(h, { column }) {
|
|
addRedStar(h, { column }) {
|
|
return [
|
|
return [
|
|
@@ -947,12 +905,12 @@ export default {
|
|
},
|
|
},
|
|
setBeginAndEnd() {
|
|
setBeginAndEnd() {
|
|
let array = this.documentDateRange
|
|
let array = this.documentDateRange
|
|
- if (array !== null) {
|
|
|
|
|
|
+ if (this.documentDateRange !== null) {
|
|
this.queryParams.params.beginTime = array[0]
|
|
this.queryParams.params.beginTime = array[0]
|
|
this.queryParams.params.endTime = array[1]
|
|
this.queryParams.params.endTime = array[1]
|
|
} else {
|
|
} else {
|
|
- this.queryParams.beginTime = null
|
|
|
|
- this.queryParams.endTime = null
|
|
|
|
|
|
+ this.queryParams.params.beginTime = null
|
|
|
|
+ this.queryParams.params.endTime = null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handleCommand(command) {
|
|
handleCommand(command) {
|
|
@@ -1009,6 +967,15 @@ export default {
|
|
// 提交上传文件
|
|
// 提交上传文件
|
|
submitFileForm() {
|
|
submitFileForm() {
|
|
this.$refs.upload.submit();
|
|
this.$refs.upload.submit();
|
|
|
|
+ },
|
|
|
|
+ // 选择物料后,给一级分类和二级分类复赋值
|
|
|
|
+ setClassify(one, two, obj) {
|
|
|
|
+ const oneArray = one.split("&")
|
|
|
|
+ const twoArray = two.split("&")
|
|
|
|
+ obj.oneLevelClassifyCode = oneArray[1]
|
|
|
|
+ obj.oneLevelClassify = oneArray[0]
|
|
|
|
+ obj.twoLevelClassifyCode = twoArray[1]
|
|
|
|
+ obj.twoLevelClassify = twoArray[0]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|