17613754660 3 years ago
parent
commit
1a7b811773

+ 6 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/earning.vue

@@ -254,6 +254,7 @@
                         //图表展示
                         var myChart = echarts.init(document.getElementById("chartPanel"));
                         this.profitChart = myChart;
+                        console.log("mychart",myChart);
                         myChart.setOption({
                             title: {
                                 textStyle: {
@@ -333,9 +334,12 @@
         },
         mounted() {
             this.curProjectId = parseInt(this.$route.params.id);
-            var _this = this;
+            // var _this = this;
+            var that = this
+            console.log("this",this)
             window.addEventListener("resize", function() {
-                _this.profitChart.resize();
+                // _this.profitChart.resize();
+                // that.profitChart.resize(); 
             });
             this.getProfitSnapshot(); // 调用图表方法
         }

+ 19 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -269,14 +269,12 @@
                 <el-form-item label="任务内容" prop="name">
                     <el-input v-model="addForm.name" :maxlength="40" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" placeholder="请输入任务内容" clearable></el-input>
                 </el-form-item>
-                
-                
                 <el-form-item label="开始时间" prop="startDate">
                     <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"  
-                    placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id"></el-date-picker>
+                    placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="DateChange()"></el-date-picker>
                     <span style="margin-left:30px;margin-right:10px;">截止时间</span>
                     <el-date-picker v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"  
-                    placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id"></el-date-picker>
+                    placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="DateChange()"></el-date-picker>
                     </el-form-item>
                 <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
                 <el-form-item :label="'执行人'+(index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
@@ -2053,7 +2051,6 @@
                     }
                 }
 
-                
                 this.$refs.form1.validate(valid => {
                     if (valid) {
                         delete this.addForm.subTaskList;
@@ -2096,6 +2093,23 @@
                         }
                 });
             },
+            DateChange(){
+                if(this.addForm.startDate != undefined && this.addForm.endDate != undefined){
+                    let stdate = Date.parse(this.addForm.startDate)
+                    let eddate = Date.parse(this.addForm.endDate)
+                    if(stdate <= eddate){
+                        let days = (eddate - stdate) / (1*24*60*60*1000) + 1
+                        for (let i=0;i<this.gstimday.length;i++) {
+                            this.gstimday[i] = days
+                            this.gstimhour[i] = days * this.user.timeType.allday
+                        }
+                        this.$forceUpdate()
+                    }
+                    console.log("gstimday",this.gstimday);
+                    
+                }
+                
+            },
 
             // 删除
             deletePro(i, item) {