Commit 37c62cdf authored by huyf's avatar huyf

部门业绩

parent 0ab4078e
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</el-table-column> </el-table-column>
<el-table-column label="时间范围" align="center" prop="targetPeriodName"> <el-table-column label="时间范围" align="center" prop="targetPeriodName">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.startTime}}~{{scope.row.endTime}}</span> <span>{{dateFormat(scope.row.startTime)}}~{{dateFormat(scope.row.endTime)}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="部门人数" align="center" prop="deptEmpCount"/> <el-table-column label="部门人数" align="center" prop="deptEmpCount"/>
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
import { createDeptTarget, updateDeptTarget, deleteDeptTarget, getDeptTarget, getDeptTargetPage, exportDeptTargetExcel,getCreateInitData } from "@/api/ecw/deptTarget"; import { createDeptTarget, updateDeptTarget, deleteDeptTarget, getDeptTarget, getDeptTargetPage, exportDeptTargetExcel,getCreateInitData } from "@/api/ecw/deptTarget";
import { listSimpleDepts } from "@/api/system/dept"; import { listSimpleDepts } from "@/api/system/dept";
import { getChannelList } from '@/api/ecw/channel'; import { getChannelList } from '@/api/ecw/channel';
import dayjs from "dayjs";
export default { export default {
name: "DeptTarget", name: "DeptTarget",
...@@ -210,6 +211,11 @@ export default { ...@@ -210,6 +211,11 @@ export default {
}) })
}); });
getCreateInitData().then(res=>{
this.monthList = res.data.month;
this.quarterList = res.data.quarter;
this.yearList = res.data.year;
});
this.getChannelList(); this.getChannelList();
this.getList(); this.getList();
}, },
...@@ -217,6 +223,9 @@ export default { ...@@ -217,6 +223,9 @@ export default {
getChannelList(){ getChannelList(){
getChannelList().then(res => this.channelList = res.data) getChannelList().then(res => this.channelList = res.data)
}, },
dateFormat(val){
return dayjs(val).format("YYYY-MM-DD");
},
changeList(val){ changeList(val){
if(val===1){ if(val===1){
this.form.targetPeriodName=undefined; this.form.targetPeriodName=undefined;
...@@ -287,12 +296,7 @@ export default { ...@@ -287,12 +296,7 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
getCreateInitData().then(res=>{ this.targetPeriod = this.monthList;
this.monthList = res.data.month;
this.quarterList = res.data.quarter;
this.yearList = res.data.year;
})
this.targetPeriod = this.monthList;
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加部门业绩目标设置"; this.title = "添加部门业绩目标设置";
...@@ -303,6 +307,13 @@ export default { ...@@ -303,6 +307,13 @@ export default {
const id = row.id; const id = row.id;
getDeptTarget(id).then(response => { getDeptTarget(id).then(response => {
this.form = response.data; this.form = response.data;
if(response.data.targetType===1){
this.targetPeriod = this.monthList;
} else if (response.data.targetType ===2 ){
this.targetPeriod = this.quarterList;
} else{
this.targetPeriod = this.yearList;
}
this.open = true; this.open = true;
this.title = "修改部门业绩目标设置"; this.title = "修改部门业绩目标设置";
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment