|
@@ -26,44 +26,42 @@
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="年度" prop="annual">
|
|
<el-form-item label="年度" prop="annual">
|
|
- <el-input
|
|
|
|
|
|
+ <el-date-picker
|
|
v-model="queryParams.annual"
|
|
v-model="queryParams.annual"
|
|
- placeholder="请输入年度"
|
|
|
|
|
|
+ type="year"
|
|
|
|
+ value-format="yyyy"
|
|
|
|
+ placeholder="选择年度"
|
|
clearable
|
|
clearable
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="客户" prop="custom">
|
|
<el-form-item label="客户" prop="custom">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.custom"
|
|
|
|
- placeholder="请输入客户"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-popover-select-v2 v-model="queryParams.custom" title="客户" valueKey="name"
|
|
|
|
+ referName="CUSTOMER_PARAM"
|
|
|
|
+ :dataMapping="{ customCode: 'code', custom: 'name'}"
|
|
|
|
+ :source.sync="queryParams" placeholder="请输入客户" @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-popover-select-v2>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="销售区域" prop="saleZone">
|
|
<el-form-item label="销售区域" prop="saleZone">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.saleZone"
|
|
|
|
- placeholder="请输入销售区域"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-popover-select-v2 v-model="queryParams.saleZone" title="销售区域" valueKey="name"
|
|
|
|
+ referName="CUSTOMER_PARAM"
|
|
|
|
+ :dataMapping="{ saleZoneCode: 'code', saleZone: 'name'}"
|
|
|
|
+ :source.sync="queryParams" placeholder="请输入销售区域" @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-popover-select-v2>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="制单人" prop="creator">
|
|
<el-form-item label="制单人" prop="creator">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.creator"
|
|
|
|
- placeholder="请输入制单人"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-popover-select-v2 v-model="queryParams.creator" title="制单人" valueKey="name"
|
|
|
|
+ referName="CONTACTS_PARAM"
|
|
|
|
+ :dataMapping="{ creatorCode: 'code', creator: 'name'}"
|
|
|
|
+ :source.sync="queryParams" placeholder="请输入制单人" @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-popover-select-v2>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="部门" prop="dept">
|
|
<el-form-item label="部门" prop="dept">
|
|
- <el-input
|
|
|
|
- v-model="queryParams.dept"
|
|
|
|
- placeholder="请输入部门"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-popover-select-v2 v-model="queryParams.dept" title="部门" valueKey="name"
|
|
|
|
+ referName="DEPT_PARAM"
|
|
|
|
+ :dataMapping="{ deptCode: 'code', dept: 'name'}"
|
|
|
|
+ :source.sync="queryParams" placeholder="请输入部门" @keyup.enter.native="handleQuery">
|
|
|
|
+ </el-popover-select-v2>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
@@ -111,7 +109,6 @@
|
|
|
|
|
|
<el-table v-loading="loading" :data="monthSaleGoalList" @selection-change="handleSelectionChange">
|
|
<el-table v-loading="loading" :data="monthSaleGoalList" @selection-change="handleSelectionChange">
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
- <el-table-column label="id唯一标识" align="center" prop="id"/>
|
|
|
|
<el-table-column label="编码" align="center" prop="code"/>
|
|
<el-table-column label="编码" align="center" prop="code"/>
|
|
<el-table-column label="目标名称" align="center" prop="goalName"/>
|
|
<el-table-column label="目标名称" align="center" prop="goalName"/>
|
|
<el-table-column label="单据日期" align="center" prop="documentDate" width="180">
|
|
<el-table-column label="单据日期" align="center" prop="documentDate" width="180">
|
|
@@ -120,18 +117,13 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="年度" align="center" prop="annual"/>
|
|
<el-table-column label="年度" align="center" prop="annual"/>
|
|
- <el-table-column label="客户编码" align="center" prop="customCode"/>
|
|
|
|
<el-table-column label="客户" align="center" prop="custom"/>
|
|
<el-table-column label="客户" align="center" prop="custom"/>
|
|
- <el-table-column label="销售区域编码" align="center" prop="saleZoneCode"/>
|
|
|
|
<el-table-column label="销售区域" align="center" prop="saleZone"/>
|
|
<el-table-column label="销售区域" align="center" prop="saleZone"/>
|
|
- <el-table-column label="制单人编码" align="center" prop="creatorCode"/>
|
|
|
|
<el-table-column label="制单人" align="center" prop="creator"/>
|
|
<el-table-column label="制单人" align="center" prop="creator"/>
|
|
- <el-table-column label="部门编码" align="center" prop="deptCode"/>
|
|
|
|
<el-table-column label="部门" align="center" prop="dept"/>
|
|
<el-table-column label="部门" align="center" prop="dept"/>
|
|
<el-table-column label="目标合计" align="center" prop="goalSum"/>
|
|
<el-table-column label="目标合计" align="center" prop="goalSum"/>
|
|
<el-table-column label="备注" align="center" prop="notes"/>
|
|
<el-table-column label="备注" align="center" prop="notes"/>
|
|
<el-table-column label="单据状态" align="center" prop="documentStatus"/>
|
|
<el-table-column label="单据状态" align="center" prop="documentStatus"/>
|
|
- <el-table-column label="删除状态" align="center" prop="deleteStatus"/>
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140" fixed="right">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140" fixed="right">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
@@ -246,7 +238,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<el-form-item label="单据状态" prop="documentStatus">
|
|
<el-form-item label="单据状态" prop="documentStatus">
|
|
- <el-input v-model="form.documentStatus" disabled/>
|
|
|
|
|
|
+ <el-input v-model="form.documentStatus" placeholder="新增页默认'未提交'" disabled/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
@@ -309,14 +301,22 @@
|
|
</el-popover-select-v2>
|
|
</el-popover-select-v2>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</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">
|
|
<template slot-scope="scope">
|
|
- <el-input v-model="monthSaleGoalDetailsList[scope.$index].oneLevelClassify" disabled></el-input>
|
|
|
|
|
|
+ <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>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</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">
|
|
<template slot-scope="scope">
|
|
- <el-input v-model="monthSaleGoalDetailsList[scope.$index].twoLevelClassify" disabled></el-input>
|
|
|
|
|
|
+ <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>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="物料" align="center" prop="material" width="180">
|
|
<el-table-column label="物料" align="center" prop="material" width="180">
|
|
@@ -367,6 +367,8 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
+
|
|
|
|
+ <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -378,6 +380,10 @@ import {
|
|
addMonthSaleGoal,
|
|
addMonthSaleGoal,
|
|
updateMonthSaleGoal
|
|
updateMonthSaleGoal
|
|
} from "@/api/business/spd/goal_management/monthSaleGoal";
|
|
} from "@/api/business/spd/goal_management/monthSaleGoal";
|
|
|
|
+import {
|
|
|
|
+ getMonthSaleGoalDetails,
|
|
|
|
+ delMonthSaleGoalDetails
|
|
|
|
+} from "@/api/business/spd/goal_management/monthSaleGoalDetails"
|
|
|
|
|
|
// 树形参照
|
|
// 树形参照
|
|
import TreeRefers from '@/components/Refers/treeRefer.vue'
|
|
import TreeRefers from '@/components/Refers/treeRefer.vue'
|
|
@@ -449,7 +455,6 @@ export default {
|
|
goalSum: null,
|
|
goalSum: null,
|
|
notes: null,
|
|
notes: null,
|
|
documentStatus: null,
|
|
documentStatus: null,
|
|
- deleteStatus: null,
|
|
|
|
monthDetailsList: null
|
|
monthDetailsList: null
|
|
},
|
|
},
|
|
formDetails: {
|
|
formDetails: {
|
|
@@ -472,7 +477,10 @@ export default {
|
|
goalValue: null
|
|
goalValue: null
|
|
},
|
|
},
|
|
// 表单校验
|
|
// 表单校验
|
|
- rules: {}
|
|
|
|
|
|
+ rules: {},
|
|
|
|
+ // 参照条件
|
|
|
|
+ referCondition: {type: '', isPage: true, title: '', index: null},
|
|
|
|
+ classOptions: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -486,17 +494,19 @@ export default {
|
|
this.monthSaleGoalList = response.rows;
|
|
this.monthSaleGoalList = response.rows;
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
- for (const element of this.monthSaleGoalList) {
|
|
|
|
- if (element.documentStatus === '0') {
|
|
|
|
- element.documentStatus = '未提交'
|
|
|
|
- } else if (element.documentStatus === '1') {
|
|
|
|
- element.documentStatus = '审核中'
|
|
|
|
- } else {
|
|
|
|
- element.documentStatus = '已审核'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ getListDetails() {
|
|
|
|
+ this.loading = true
|
|
|
|
+ getMonthSaleGoalDetails(this.form.id).then(response => {
|
|
|
|
+ this.monthSaleGoalDetailsList = response.data
|
|
|
|
+ this.computeTotal()
|
|
|
|
+ this.form.monthDetailsList = this.monthSaleGoalDetailsList
|
|
|
|
+ updateMonthSaleGoal(this.form).then(response => {
|
|
|
|
+ })
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 取消按钮
|
|
// 取消按钮
|
|
cancel() {
|
|
cancel() {
|
|
this.open = false;
|
|
this.open = false;
|
|
@@ -521,7 +531,6 @@ export default {
|
|
goalSum: null,
|
|
goalSum: null,
|
|
notes: null,
|
|
notes: null,
|
|
documentStatus: null,
|
|
documentStatus: null,
|
|
- deleteStatus: null,
|
|
|
|
monthDetailsList: null
|
|
monthDetailsList: null
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
@@ -576,13 +585,7 @@ export default {
|
|
const id = row.id || this.ids
|
|
const id = row.id || this.ids
|
|
getMonthSaleGoal(id).then(response => {
|
|
getMonthSaleGoal(id).then(response => {
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
- if (this.form.documentStatus === '0') {
|
|
|
|
- this.form.documentStatus = '未提交'
|
|
|
|
- } else if (this.form.documentStatus === '1') {
|
|
|
|
- this.form.documentStatus = '审批中'
|
|
|
|
- } else {
|
|
|
|
- this.form.documentStatus = '已审核'
|
|
|
|
- }
|
|
|
|
|
|
+ this.monthSaleGoalDetailsList = this.form.monthDetailsList
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "修改月销售目标填报";
|
|
this.title = "修改月销售目标填报";
|
|
});
|
|
});
|
|
@@ -592,13 +595,6 @@ export default {
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
if (this.form.id != null) {
|
|
- if (this.form.documentStatus === '未提交') {
|
|
|
|
- this.form.documentStatus = 0
|
|
|
|
- } else if (this.form.documentStatus === '审批中') {
|
|
|
|
- this.form.documentStatus = 1
|
|
|
|
- } else {
|
|
|
|
- this.form.documentStatus = 2
|
|
|
|
- }
|
|
|
|
this.form.monthDetailsList = this.monthSaleGoalDetailsList
|
|
this.form.monthDetailsList = this.monthSaleGoalDetailsList
|
|
updateMonthSaleGoal(this.form).then(response => {
|
|
updateMonthSaleGoal(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$modal.msgSuccess("修改成功");
|
|
@@ -606,12 +602,14 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
|
|
+ this.form.documentStatus = '未提交'
|
|
this.form.monthDetailsList = this.monthSaleGoalDetailsList
|
|
this.form.monthDetailsList = this.monthSaleGoalDetailsList
|
|
- addMonthSaleGoal(this.form).then(response => {
|
|
|
|
|
|
+ console.log(this.form);
|
|
|
|
+ /*addMonthSaleGoal(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
this.getList();
|
|
this.getList();
|
|
- });
|
|
|
|
|
|
+ });*/
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -628,8 +626,24 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
handleDeleteDetails(index, row) {
|
|
handleDeleteDetails(index, row) {
|
|
- this.monthSaleGoalDetailsList.splice(index, 1)
|
|
|
|
- this.computeTotal()
|
|
|
|
|
|
+ if (this.form.id === null) {
|
|
|
|
+ this.monthSaleGoalDetailsList.splice(index, 1)
|
|
|
|
+ this.computeTotal()
|
|
|
|
+ } else {
|
|
|
|
+ if (row.id === null) {
|
|
|
|
+ this.$modal.confirm('是否确认删除月销售目标填报明细编号为"' + ids + '"的数据项?').then(function () {
|
|
|
|
+ return delMonthSaleGoalDetails(row.id);
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.getListDetails();
|
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.monthSaleGoalDetailsList.splice(index, 1)
|
|
|
|
+ this.$message.success('删除成功')
|
|
|
|
+ this.computeTotal()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
handleExport() {
|
|
@@ -642,12 +656,13 @@ export default {
|
|
.then(_ => {
|
|
.then(_ => {
|
|
done();
|
|
done();
|
|
})
|
|
})
|
|
- .catch(_ => {});
|
|
|
|
|
|
+ .catch(_ => {
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 复制明细
|
|
// 复制明细
|
|
handleCopyDetails(row) {
|
|
handleCopyDetails(row) {
|
|
let list = {
|
|
let list = {
|
|
- id: row.id,
|
|
|
|
|
|
+ id: null,
|
|
code: row.code,
|
|
code: row.code,
|
|
saleOrg: row.saleOrg,
|
|
saleOrg: row.saleOrg,
|
|
saleZone: row.saleZone,
|
|
saleZone: row.saleZone,
|
|
@@ -676,7 +691,37 @@ export default {
|
|
sum = (sum * 1000000 + listElement.goalValue * 1000000) / 1000000
|
|
sum = (sum * 1000000 + listElement.goalValue * 1000000) / 1000000
|
|
}
|
|
}
|
|
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
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-};
|
|
|
|
|
|
+}
|
|
</script>
|
|
</script>
|