|
@@ -305,7 +305,8 @@
|
|
|
<el-table-column label="一级分类" align="center" min-width="200" :render-header="addRedStar">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select v-model="monthSaleGoalDetailsList[scope.$index].oneLevelClassify" clearable
|
|
|
- @focus="chooseTreeReferForMain('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)" :disabled="!isDept">
|
|
|
+ @focus="chooseTreeReferForMain('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)"
|
|
|
+ :disabled="!isDept">
|
|
|
<el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.code" />
|
|
|
</el-select>
|
|
|
</template>
|
|
@@ -313,7 +314,8 @@
|
|
|
<el-table-column label="二级分类" align="center" min-width="200" :render-header="addRedStar">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select v-model="monthSaleGoalDetailsList[scope.$index].twoLevelClassify" clearable
|
|
|
- @focus="chooseTreeReferForMain('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)" :disabled="!isDept">
|
|
|
+ @focus="chooseTreeReferForMain('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)"
|
|
|
+ :disabled="!isDept">
|
|
|
<el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.code" />
|
|
|
</el-select>
|
|
|
</template>
|
|
@@ -334,8 +336,10 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="科室" align="center" min-width="200">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-select v-model.trim="monthSaleGoalDetailsList[scope.$index].department" placeholder="请选择科室" filterable>
|
|
|
- <el-option v-for="dict in dict.type.mk_bo_section" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
+ <el-select v-model.trim="monthSaleGoalDetailsList[scope.$index].department" placeholder="请选择科室"
|
|
|
+ filterable>
|
|
|
+ <el-option v-for="dict in dict.type.mk_bo_section" :key="dict.value" :label="dict.label"
|
|
|
+ :value="dict.value"></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -347,21 +351,24 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="月份" align="center" min-width="250">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-date-picker v-model="monthSaleGoalDetailsList[scope.$index].monthly" value-format="yyyy-MM" disabled
|
|
|
- type="month" placeholder="选择月份">
|
|
|
+ <el-date-picker v-model="monthSaleGoalDetailsList[scope.$index].monthly" value-format="yyyy-MM"
|
|
|
+ disabled type="month" placeholder="选择月份">
|
|
|
</el-date-picker>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="销售目标值(元)" align="center" prop="goalValue" min-width="220" :render-header="addRedStar">
|
|
|
+ <el-table-column label="销售目标值(元)" align="center" prop="goalValue" min-width="220"
|
|
|
+ :render-header="addRedStar">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number @change="computeTotal" v-model="monthSaleGoalDetailsList[scope.$index].goalValue"
|
|
|
:precision="2" :step="1" :min="0"></el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="利润目标值(元)" align="center" prop="profitTargetValue" min-width="220" :render-header="addRedStar" v-if="isDept">
|
|
|
+ <el-table-column label="利润目标值(元)" align="center" prop="profitTargetValue" min-width="220"
|
|
|
+ :render-header="addRedStar" v-if="isDept">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input-number @change="computeTotal" v-model="monthSaleGoalDetailsList[scope.$index].profitTargetValue"
|
|
|
- :precision="2" :step="1" :min="0"></el-input-number>
|
|
|
+ <el-input-number @change="computeTotal"
|
|
|
+ v-model="monthSaleGoalDetailsList[scope.$index].profitTargetValue" :precision="2" :step="1"
|
|
|
+ :min="0"></el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px"
|
|
@@ -448,7 +455,7 @@
|
|
|
<el-button type="primary" @click="dialogUpdateMoreSave">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <TreeRefers ref="treeMain" @doSubmit="selectionsToInputForMain" :single="true" />
|
|
|
+ <TreeRefers ref="treeMain" @doSubmit="selectionsToInputForMain" :single="true" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -465,7 +472,8 @@
|
|
|
getMonthSaleGoalDetails,
|
|
|
delMonthSaleGoalDetails,
|
|
|
importData,
|
|
|
- getMaterialRangeList
|
|
|
+ getMaterialRangeList,
|
|
|
+ getDeptIds
|
|
|
} from "@/api/business/spd/goal_management/monthSaleGoalDetails"
|
|
|
import {
|
|
|
getToken
|
|
@@ -907,6 +915,11 @@
|
|
|
this.monthSaleGoalDetailsList[i].dept = this.form.dept;
|
|
|
this.monthSaleGoalDetailsList[i].creator = this.form.creator;
|
|
|
}
|
|
|
+ console.log(this.form, 'form');
|
|
|
+ if (this.form.saleZone == null || this.form.saleZone == undefined || this.form.saleZone == '' || this.form
|
|
|
+ .custom == null || this.form.custom == undefined) {
|
|
|
+ return this.$message.error('主表中有必填字段未填!')
|
|
|
+ }
|
|
|
if (this.justiceDetailsList()) {
|
|
|
return this.$message.error('子表中第' + this.text + '行有必填字段未填,或者目标值为0')
|
|
|
}
|
|
@@ -928,7 +941,7 @@
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
- }).finally( e =>{
|
|
|
+ }).finally(e => {
|
|
|
this.$modal.closeLoading();
|
|
|
});
|
|
|
} else {
|
|
@@ -940,7 +953,7 @@
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
- }).finally( e =>{
|
|
|
+ }).finally(e => {
|
|
|
this.$modal.closeLoading();
|
|
|
});
|
|
|
}
|
|
@@ -1047,11 +1060,11 @@
|
|
|
column
|
|
|
}) {
|
|
|
if (this.isDept) {
|
|
|
- return[
|
|
|
+ return [
|
|
|
h('span', '' + column.label)
|
|
|
]
|
|
|
} else {
|
|
|
- return [
|
|
|
+ return [
|
|
|
h('span', {
|
|
|
style: 'color: #F56C6C'
|
|
|
}, '*'),
|
|
@@ -1070,7 +1083,8 @@
|
|
|
element.dept !== null) && (element.creator !== null) && (element.oneLevelClassify !== null) && (element
|
|
|
.oneLevelClassifyCode !== null) && (element.monthly !== null) && (element.goalValue !== 0);
|
|
|
const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !==
|
|
|
- undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element.oneLevelClassify !==
|
|
|
+ undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element
|
|
|
+ .oneLevelClassify !==
|
|
|
undefined) && (element.oneLevelClassifyCode !== undefined) && (element.monthly !== undefined);
|
|
|
if (flag1 && flag2) {
|
|
|
isFlag.push(true);
|
|
@@ -1091,7 +1105,8 @@
|
|
|
element.dept !== null) && (element.creator !== null) && (element.materialCode !== null) && (element
|
|
|
.material !== null) && (element.monthly !== null) && (element.goalValue !== 0);
|
|
|
const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !==
|
|
|
- undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element.materialCode !==
|
|
|
+ undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element
|
|
|
+ .materialCode !==
|
|
|
undefined) && (element.material !== undefined) && (element.monthly !== undefined);
|
|
|
if (flag1 && flag2) {
|
|
|
isFlag.push(true);
|
|
@@ -1182,7 +1197,8 @@
|
|
|
const oneArray = one.split("&")
|
|
|
const twoArray = two.split("&")
|
|
|
// 物料提醒文本
|
|
|
- const memo = '名称:' + row.material + '; 编码:' + row.materialCode + '; 规格:' + row.specification + '; 包装:' + row.packExplain + '; 型号:' + row.model + '。';
|
|
|
+ const memo = '名称:' + row.material + '; 编码:' + row.materialCode + '; 规格:' + row.specification + '; 包装:' + row
|
|
|
+ .packExplain + '; 型号:' + row.model + '。';
|
|
|
obj.memo = memo;
|
|
|
obj.oneLevelClassifyCode = oneArray[1]
|
|
|
obj.oneLevelClassify = oneArray[0]
|
|
@@ -1325,11 +1341,17 @@
|
|
|
row.goalValue = row.num * row.price;
|
|
|
}
|
|
|
},
|
|
|
+ // 判断操作人部门是否属于湖南公司、湖南公司本部
|
|
|
judge() {
|
|
|
- this.isDept = false;
|
|
|
- if (this.$store.state.user.deptName.indexOf('湖南公司') >= 0) {
|
|
|
- this.isDept = true;
|
|
|
- }
|
|
|
+ let that = this;
|
|
|
+ that.isDept = false;
|
|
|
+ getDeptIds().then(res => {
|
|
|
+ for (const r of res) {
|
|
|
+ if (that.$store.state.user.deptId === r) {
|
|
|
+ that.isDept = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 树形参照
|
|
|
chooseTreeReferForMain(type, isPage, title, index) {
|