17613754660 пре 3 година
родитељ
комит
d10cf63a4b

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/gantt.vue

@@ -86,7 +86,8 @@ export default {
       gantt.config.drag_move = false;
     gantt.config.xml_date = "%Y-%m-%d";
     gantt.config.columns=[
-        {name:"text",       label:(this.stafforpro == "人员" ? "员工名称" : "项目名称"),  tree:true, width:'*', align: "left" },
+        {name:"text",label:(this.stafforpro == "人员" ? "员工名称" : "项目名称"),  tree:true, width:'*', align: "left" },
+        {name:"duration",label:"计划时间(天)", align: "center" }
         // {name:"start_date", label:"开始时间", width:'*' , align: "center" },
         // {name:"duration",   label:"工时(天)", width:'*' ,   align: "center" }
     ];

+ 12 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -47,9 +47,12 @@
                     <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增项目</el-link>
                 </el-form-item>
                 <el-form-item style="float:right;" v-if="user.company.packageProject==1">
-                    <router-link to="/projectGantt">
-                        <el-link type="primary" :underline="false" >甘特图</el-link>
-                    </router-link>
+                    <!-- <router-link to="/projectGantt"> -->
+                        <el-link type="primary" :underline="false" @click="isganttshow = true">甘特图</el-link>
+                    <!-- </router-link> -->
+                    <el-dialog v-if="isganttshow" :visible.sync="isganttshow" width="1280px" style="height:90%" class="ganttdialog">
+                        <projectgantt></projectgantt>
+                    </el-dialog>
                 </el-form-item>
             </el-form>
         </el-col>
@@ -525,9 +528,12 @@ a {
 </style>
 <script>
     import util from "../../common/js/util";
+    import projectgantt from "./project_gantt.vue"
     export default {
+        components:{projectgantt},
         data() {
             return {
+                isganttshow: false,
                 deleteAlertMsg: null,
                 chosenLeaders:[],
                 chooseLeaderVisible:false,
@@ -1951,4 +1957,7 @@ a {
 .customdropdown_menu_btn{
     border-color: transparent;
 }
+.ganttdialog .el-dialog__body{
+    height: 880px;
+}
 </style>

+ 45 - 13
fhKeeper/formulahousekeeper/timesheet/src/views/project/project_gantt.vue

@@ -37,10 +37,14 @@
       </el-select>
       </div>
     </div>
-    <gantt v-if="isDataLoaded" ref="ganttTable" class="left-container" :tasks="tasks" 
+    <gantt v-show="isDataLoaded" ref="ganttTable1" class="left-container" :tasks="tasks1" 
     :stafforpro="radio1" 
     :valueDate="valueDate"
-    :key="updatakey"></gantt>
+    :key="updatakey1"></gantt>
+    <gantt v-show="!isDataLoaded" ref="ganttTable2" class="left-container" :tasks="tasks2" 
+    :stafforpro="radio1" 
+    :valueDate="valueDate"
+    :key="updatakey2"></gantt>
   </div>
 </template>
  
@@ -48,7 +52,7 @@
 import Gantt from './gantt.vue';
  
 export default {
-  name: 'app',
+  name: 'project_gantt',
   components: {Gantt},
   data () {
     return {
@@ -59,7 +63,10 @@ export default {
           // {id: 1, source: 1, target: 2, type: '0'}
         ]
       },
-      updatakey: 1,
+      tasks1: {links:[]},
+      tasks2: {links:[]},
+      updatakey1: 1,
+      updatakey2: -1,
       radio1:"按人员查看",
       valueDate:[],
       options:[{value:"选项1",label:"全部"},{value:"选项2",label:"人员1"}],
@@ -76,29 +83,51 @@ export default {
   
   methods: {
       setGroup() {
-          this.$refs.ganttTable.setGroup();
+          this.$refs.ganttTable1.setGroup();
+          this.$refs.ganttTable2.setGroup();
       },
       // 人员/项目切换
       selChange(){
         if (this.radio1 == "按人员查看") {
-          this.reqpar1 = 1
-        }else{
           this.reqpar1 = 0
+          this.getList()
+          this.tasks1 = this.tasks
+          this.updatakey1 += 1
+          this.isDataLoaded = true
+        }else{
+          this.reqpar1 = 1
+          this.getList()
+          this.tasks2 = this.tasks
+          this.updatakey2 -= 1
+          this.isDataLoaded = false
         }
-        this.getList()
-        this.updatakey += 1
+        
+        
       },
       // 时间段改变
       dateupdata(){
         this.reqpar2 = this.valueDate
-        this.getList()
-        this.updatakey += 1
+        
+        if (this.reqpar1 = 0) {
+          this.getList()
+          this.tasks1 = this.tasks
+          this.updatakey1 += 1
+        } else {
+          this.getList()
+          this.tasks2 = this.tasks
+          this.updatakey2 -= 1
+        }
+        
       },
       // 人员/项目筛选改变
       optupdata(){
         this.reqpar3 = this.valuex
         this.getList()
-        this.updatakey += 1
+        if (this.reqpar1 = 0) {
+          this.updatakey1 += 1
+        } else {
+          this.updatakey2 -= 1
+        }
       },
 
       getList() {
@@ -137,6 +166,9 @@ export default {
     this.reqpar2 = this.valueDate
     console.log("date",this.valueDate);
     this.getList();
+    this.tasks1 = this.tasks
+    this.setGroup()
+    this.isDataLoaded = true
   }
 }
 </script>
@@ -174,7 +206,7 @@ export default {
   .gantt_head .head_date{
     height: 60px;
     line-height: 60px;
-    width: 30%;
+    width: 35%;
     display: flex;
     align-items: center;
     justify-content: center;

+ 6 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -733,9 +733,10 @@
               @change="showMonthWorkTime()"
             >
               </el-date-picker>
+              <el-button size="small" @click="getDoubleLastWeek(1)">上上周</el-button>
               <el-button size="small" @click="getLastWeek(1)">上周</el-button>
               <el-button size="small" @click="getThisWeek(1)">本周</el-button>
-              <el-button size="small" @click="getNextWeek(1)">下周</el-button>
+              
               <!-- 222 -->
             </div>
             <el-link
@@ -864,9 +865,10 @@
               @change="showMonthNotWorkTime()"
             >
               </el-date-picker>
+              <el-button size="small" @click="getDoubleLastWeek()">上上周</el-button>
               <el-button size="small" @click="getLastWeek()">上周</el-button>
               <el-button size="small" @click="getThisWeek()">本周</el-button>
-              <el-button size="small" @click="getNextWeek()">下周</el-button>
+              
             </div>
             <el-link
               type="primary"
@@ -1817,9 +1819,9 @@
         this.showMonthNotWorkTime()
       }
     },
-    getNextWeek(e){
+    getDoubleLastWeek(e){
       let newdate = new Date()
-      let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() + 7))
+      let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
       let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
       if(e){
         this.WorktimeDatepickValue1 = nextwd