|
@@ -3,12 +3,12 @@
|
|
|
<div class="container">
|
|
|
<div class="gantt_head">
|
|
|
<div class="head_RorX">
|
|
|
- 按
|
|
|
+
|
|
|
<el-radio-group v-model="radio1" @change="selChange()" size="small" style="margin-left:9px;margin-right:9px">
|
|
|
- <el-radio-button label="人员" value="1"></el-radio-button>
|
|
|
- <el-radio-button label="项目" value="2"></el-radio-button>
|
|
|
+ <el-radio-button label="按人员查看" value="renyuan"></el-radio-button>
|
|
|
+ <el-radio-button label="按项目查看" value="xiangmu"></el-radio-button>
|
|
|
</el-radio-group>
|
|
|
- 查看
|
|
|
+
|
|
|
</div>
|
|
|
<div class="head_date">
|
|
|
<span>时间段</span>
|
|
@@ -25,7 +25,7 @@
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
<div class="head_select">
|
|
|
- <span>{{radio1}}</span>
|
|
|
+ <span>{{(this.radio1 == "按人员查看" ? "人员" : "项目")}}</span>
|
|
|
<el-select v-model="valuex" placeholder="请选择" size="small" style="margin-left:9px;width:120px">
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
@@ -60,14 +60,14 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
updatakey: 1,
|
|
|
- radio1:"人员",
|
|
|
- valueDate:["2022-03-01","2022-03-10"],
|
|
|
+ radio1:"按人员查看",
|
|
|
+ valueDate:[],
|
|
|
options:[{value:"选项1",label:"全部"},{value:"选项2",label:"人员1"}],
|
|
|
valuex:'全部',
|
|
|
|
|
|
// 请求参数
|
|
|
reqpar1:0,
|
|
|
- reqpar2:["2022-03-01","2022-03-10"],
|
|
|
+ reqpar2:[],
|
|
|
reqpar3:"人员范围/项目范围",
|
|
|
|
|
|
}
|
|
@@ -80,35 +80,35 @@ export default {
|
|
|
},
|
|
|
// 人员/项目切换
|
|
|
selChange(){
|
|
|
- if (this.radio1 == "人员") {
|
|
|
- this.reqpar1 = 0
|
|
|
- }else{
|
|
|
+ if (this.radio1 == "按人员查看") {
|
|
|
this.reqpar1 = 1
|
|
|
+ }else{
|
|
|
+ this.reqpar1 = 0
|
|
|
}
|
|
|
- // this.getList()
|
|
|
+ this.getList()
|
|
|
this.updatakey += 1
|
|
|
},
|
|
|
// 时间段改变
|
|
|
dateupdata(){
|
|
|
- this.reqpar2 = this.valeuDate
|
|
|
- // this.getList()
|
|
|
+ this.reqpar2 = this.valueDate
|
|
|
+ this.getList()
|
|
|
this.updatakey += 1
|
|
|
},
|
|
|
// 人员/项目筛选改变
|
|
|
optupdata(){
|
|
|
this.reqpar3 = this.valuex
|
|
|
- // this.getList()
|
|
|
+ this.getList()
|
|
|
this.updatakey += 1
|
|
|
},
|
|
|
|
|
|
getList() {
|
|
|
- this.http.post('/project/getGanttData',
|
|
|
- { type : 0 , startDate : this.reqpar2[0] , endDate : this.reqpar2[1] },
|
|
|
+ this.http.post('/project/getGanttData',
|
|
|
+ { type : this.reqpar1 , startDate : this.reqpar2[0] , endDate : this.reqpar2[1] },
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
this.tasks = {data:res.data};
|
|
|
this.isDataLoaded = true;
|
|
|
- console.log(res.data);
|
|
|
+ console.log("getlist",res.data);
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -123,10 +123,19 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
);
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
mounted: function () {
|
|
|
-
|
|
|
+ let nowdate = new Date()
|
|
|
+ let nowmonth = nowdate.getMonth() + 1
|
|
|
+ let startdate = nowdate.getFullYear() + "-" + (nowmonth < 10 ? "0" + nowmonth : nowmonth) + "-" + (nowdate.getDate() < 10 ? "0" + nowdate.getDate() : nowdate.getDate())
|
|
|
+ let udate = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate() + 30)
|
|
|
+ let endmonth = udate.getMonth() + 1
|
|
|
+ let enddate = udate.getFullYear() + "-" + (endmonth < 10 ? "0" + endmonth : endmonth) + "-" + (udate.getDate() < 10 ? "0" + udate.getDate() : udate.getDate())
|
|
|
+ this.valueDate = [startdate,enddate]
|
|
|
+ this.reqpar2 = this.valueDate
|
|
|
+ console.log("date",this.valueDate);
|
|
|
this.getList();
|
|
|
}
|
|
|
}
|