|
@@ -4,7 +4,7 @@
|
|
|
<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-group v-model="radio1" @change="selChange()" size="small" style="margin-right:9px">
|
|
|
<el-radio-button label="按人员查看" value="renyuan"></el-radio-button>
|
|
|
<el-radio-button label="按项目查看" value="xiangmu"></el-radio-button>
|
|
|
</el-radio-group>
|
|
@@ -26,15 +26,28 @@
|
|
|
</div>
|
|
|
<div class="head_select">
|
|
|
<span>{{(this.radio1 == "按人员查看" ? "人员" : "项目")}}</span>
|
|
|
- <el-select v-model="valuex" placeholder="请选择" size="small" style="margin-left:9px;width:120px">
|
|
|
+ <span v-if="!reqpar1">
|
|
|
+ <el-select ref="screenchg1" v-model="valuex" placeholder="请选择" size="small" style="margin-left:9px;width:200px" @change="optupdata()">
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- @change="optupdata()">
|
|
|
+ v-for="item in screenList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
+ </span>
|
|
|
+ <span v-if="reqpar1">
|
|
|
+ <el-select ref="screenchg2" v-model="valuex" placeholder="请选择" size="small" style="margin-left:9px;width:200px" @change="optupdata()">
|
|
|
+ <el-option
|
|
|
+ v-for="item in screenList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.projectName"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<gantt v-if="isDataLoaded" ref="ganttTable1" class="left-container" :tasks="tasks"
|
|
@@ -49,6 +62,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { error } from 'dingtalk-jsapi';
|
|
|
import Gantt from './gantt.vue';
|
|
|
|
|
|
export default {
|
|
@@ -71,7 +85,8 @@ export default {
|
|
|
radio1:"按人员查看",
|
|
|
valueDate:[],
|
|
|
options:[{value:"选项1",label:"全部"},{value:"选项2",label:"人员1"}],
|
|
|
- valuex:'全部',
|
|
|
+ valuex:'',
|
|
|
+ screenList:[],
|
|
|
|
|
|
// 请求参数
|
|
|
reqpar1:0,
|
|
@@ -93,16 +108,20 @@ export default {
|
|
|
if (this.radio1 == "按人员查看") {
|
|
|
this.reqpar1 = 0
|
|
|
this.getList()
|
|
|
+ this.getScreen()
|
|
|
// this.tasks1 = this.tasks
|
|
|
// this.updatakey1 += 1
|
|
|
// this.isDataLoaded = true
|
|
|
}else{
|
|
|
this.reqpar1 = 1
|
|
|
this.getList()
|
|
|
+ this.getXmScreen()
|
|
|
// this.tasks2 = this.tasks
|
|
|
// this.updatakey2 -= 1
|
|
|
// this.isDataLoaded = false
|
|
|
}
|
|
|
+ // console.log(this.valuex1);
|
|
|
+ this.valuex == ''
|
|
|
|
|
|
|
|
|
},
|
|
@@ -123,22 +142,78 @@ export default {
|
|
|
// 人员/项目筛选改变
|
|
|
optupdata(){
|
|
|
this.reqpar3 = this.valuex
|
|
|
+ console.log("reqpar3",this.valuex);
|
|
|
this.getList()
|
|
|
- if (this.reqpar1 = 0) {
|
|
|
- this.updatakey1 += 1
|
|
|
- } else {
|
|
|
- this.updatakey2 -= 1
|
|
|
- }
|
|
|
+ // if (this.reqpar1 = 0) {
|
|
|
+ // console.log(this.valuex);
|
|
|
+ // this.getList()
|
|
|
+ // // this.updatakey1 += 1
|
|
|
+ // } else {
|
|
|
+ // // this.updatakey2 -= 1
|
|
|
+ // }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取人员项目筛选列表
|
|
|
+ getScreen(){
|
|
|
+ this.http.get('/project/getMyUsers',
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.screenList = res.data
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message : error,
|
|
|
+ type : "error"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
+ getXmScreen(){
|
|
|
+ this.http.get('/project/getProjectList',
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.screenList = res.data
|
|
|
+ console.log("screen",this.screenList);
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message : error,
|
|
|
+ type : "error"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ )
|
|
|
},
|
|
|
|
|
|
getList() {
|
|
|
- this.http.post('/project/getGanttData',
|
|
|
- { type : this.reqpar1 , startDate : this.reqpar2[0] , endDate : this.reqpar2[1] },
|
|
|
+ let getlistcs = {}
|
|
|
+ if (this.valuex != ''){
|
|
|
+ if (!this.reqpar1) {
|
|
|
+ getlistcs = {type : 0 , startDate : this.reqpar2[0] , endDate : this.reqpar2[1], userId : this.reqpar3}
|
|
|
+ }else{
|
|
|
+ getlistcs = {type : 1 , startDate : this.reqpar2[0] , endDate : this.reqpar2[1], projectId : this.reqpar3}
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ getlistcs = {type : this.reqpar1 , startDate : this.reqpar2[0] , endDate : this.reqpar2[1]}
|
|
|
+ }
|
|
|
+
|
|
|
+ this.http.post('/project/getGanttData', getlistcs ,
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
this.tasks = {data:res.data};
|
|
|
this.isDataLoaded = true;
|
|
|
- console.log("getlist",res.data);
|
|
|
+ // console.log("getlist",res.data);
|
|
|
|
|
|
this.$nextTick(()=>{
|
|
|
// if (this.reqpar1 = 0) {
|
|
@@ -180,6 +255,7 @@ export default {
|
|
|
this.reqpar2 = this.valueDate
|
|
|
console.log("date",this.valueDate);
|
|
|
this.getList();
|
|
|
+ this.getScreen()
|
|
|
// this.tasks1 = this.tasks
|
|
|
this.isDataLoaded = true
|
|
|
}
|
|
@@ -214,7 +290,7 @@ export default {
|
|
|
width: 30%;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- justify-content: center;
|
|
|
+ justify-content: left;
|
|
|
}
|
|
|
.gantt_head .head_date{
|
|
|
height: 60px;
|
|
@@ -222,7 +298,7 @@ export default {
|
|
|
width: 35%;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- justify-content: center;
|
|
|
+ justify-content: left;
|
|
|
}
|
|
|
.gantt_head .head_select{
|
|
|
height: 60px;
|