소스 검색

2022.3.21未改完

17613754660 3 년 전
부모
커밋
aa26f7c5f6

+ 7 - 37
fhKeeper/formulahousekeeper/timesheet/src/views/project/gantt.vue

@@ -24,6 +24,10 @@ export default {
     stafforpro: '',
     valueDate:[]
   },
+  created:function(){
+    gantt.clearAll()
+    console.log("tasks",this.$props.tasks.data);
+  },
  
   methods: {
       
@@ -95,42 +99,8 @@ export default {
       {unit: "day", step: 1, date: "周%D,%d"}
     ];
 
-    // gantt.config.start_date = new Date(this.valueDate[0]);
-    // gantt.config.end_date = new Date(this.valueDate[0]);
-
-    gantt.config.layout = {
-        css: 'gantt_container',
-        cols: [
-          {
-            width: 500,
-            min_width: 300,
-            rows: [
-              {
-                view: 'grid',
-                scrollX: 'gridScroll',
-                scrollable: true,
-                scrollY: 'scrollVer'
-              },
-              { view: 'scrollbar', id: 'gridScroll', group: 'horizontal' }
-            ]
-          },
-          { resizer: true, width: 1 },
-          {
-            // width: 950,
-            // min_width: 600,
-            rows: [
-              {
-                view: 'timeline',
-                scrollX: 'scrollHor',
-                scrollable: true,
-                scrollY: 'scrollVer'
-              },
-              { view: 'scrollbar', id: 'scrollHor', group: 'horizontal' }
-            ]
-          },
-          { view: 'scrollbar', id: 'scrollVer' }
-        ]
-      }
+    gantt.config.start_date = new Date(this.valueDate[0]);
+    gantt.config.end_date = new Date(this.valueDate[1]);
 
     //设置任务条样式
     gantt.templates.task_class = function (start, end, item) {
@@ -140,7 +110,7 @@ export default {
     gantt.init(this.$refs.gantt);
     // this.$props.tasks.data[31].render = "split"
     gantt.parse(this.$props.tasks);
-    console.log("tasks",this.$props.tasks.data);
+    
     // gantt.groupBy({
     //     relation_property: "owner",
     //     groups: [{key:'seya', label: "seya"},{key:'tina', label: "tina"}],

+ 28 - 19
fhKeeper/formulahousekeeper/timesheet/src/views/project/project_gantt.vue

@@ -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();
   }
 }

+ 10 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -740,7 +740,7 @@
             </div>
             <el-link
               type="primary"
-              style="float: right; margin-right: 60px; vertical-align: middle"
+              style="float: right; margin-right: 60px; vertical-align: middle;height:32px"
               @click="exportMembAlreadyWorkHours()"
               >导出数据</el-link
             >
@@ -753,16 +753,16 @@
             highlight-current-row
             style="width: 100%"
           >
-            <el-table-column width="60" type="index" fixed="left" label="序号">
+            <el-table-column width="75" type="index" fixed="left" label="序号">
               <template slot-scope="scope">
                 {{ scope.$index + 1 }}
               </template>
             </el-table-column>
 
-            <el-table-column width="100" prop="name" fixed="left" label="姓名">
+            <el-table-column width="105" prop="name" fixed="left" label="姓名">
             </el-table-column>
             <el-table-column
-              width="90"
+              width="105"
               v-for="(item, index) in pickDateArray"
               :key="index"
               :label="item.label"
@@ -870,7 +870,7 @@
             </div>
             <el-link
               type="primary"
-              style="float: right; margin-right: 60px; vertical-align: middle"
+              style="float: right; margin-right: 60px; vertical-align: middle;height:32px"
               @click="exportMembNotWorkHours()"
               >导出数据</el-link
             >
@@ -4336,6 +4336,11 @@
     .selectworktime .el-table__fixed-body-wrapper{
       top: 48px !important;
     }
+    .selectworktime_export .selectworktime_export_l{
+        width: 70%;
+        float: left;
+        height: 42px;
+    }
 </style>
 
 <style lang="scss" scoped>