Browse Source

2022.3.31

17613754660 3 years ago
parent
commit
57adf3ce63

+ 32 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -281,7 +281,8 @@
                         <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
                     <span style="margin-left:30px;margin-right:10px;">计划工时</span>
-                    <el-input-number size="small" :disabled="addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id" v-model="executorItem.planHours" style="width:30%;" :min="1" :max="100"  placeholder="请输入计划工作时长,单位小时" ></el-input-number ><span style="margin-left:10px;">小时</span>
+                    <el-input-number size="small" :disabled="addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id" v-model="gstimday[index]" style="width:16%;" :min="1" :max="100"  placeholder="请输入计划工作时长,单位天" @change="chggstim(0,index)"></el-input-number ><span style="margin-left:5px;">天</span>
+                    <el-input-number size="small" :disabled="addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id" v-model="gstimhour[index]" style="width:16%;" :min="1" :max="100"  placeholder="请输入计划工作时长,单位小时" @change="chggstim(1,index)"></el-input-number ><span style="margin-left:5px;">小时</span>
                     <!--移除执行人 -->
                     <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id)" style="margin-left:5px" @click="removeExecutorLine(index)"></i>
                 </el-form-item>
@@ -851,6 +852,8 @@
                 checkboxGrounp: [], // 选中人的数据
                 checkLists: [], // 选中人数据的ID
                 taskIid: null,
+                gstimday:[],
+                gstimhour:[]
             };
             
         },
@@ -1519,6 +1522,13 @@
                     this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
                 })
             },
+            chggstim(e,i){
+                if(e){
+                    this.gstimday[i] = Math.ceil(this.gstimhour[i] / this.user.timeType.allday)
+                }else{
+                    this.gstimhour[i] = this.gstimday[i] * this.user.timeType.allday
+                }
+            },
             getTaskDetail(id) {
                 this.http.post('/task/getTask',{id: id},
                 res => {
@@ -1529,6 +1539,13 @@
                         this.addLoading = false;
                         this.recentProgressInfo = this.addForm.progress;
                         this.addForm.executorListFront = this.addForm.executorList;
+
+                        this.gstimday = []
+                        this.gstimhour = []
+                        for(let i=0;i<this.addForm.executorListFront.length;i++){
+                            this.gstimhour.push(this.addForm.executorListFront[i].planHours),
+                            this.gstimday.push(Math.ceil(this.addForm.executorListFront[i].planHours / this.user.timeType.allday))
+                        }
                         //删除中间传值的变量数组
                         delete this.addForm.executorList;
                     } else {
@@ -1548,8 +1565,9 @@
             addTask(stage) {
                 this.addFormVisible = true;
                 this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
-                this.addForm.executorListFront = [{executorId:null, planHours:8}];
-
+                this.addForm.executorListFront = [{executorId:null, planHours:this.user.timeType.allday}];
+                this.gstimhour = [this.user.timeType.allday]
+                this.gstimday = [1]
                 this.addLoading = false;
                 this.title="创建任务";
                 this.commentList = [];
@@ -1558,11 +1576,15 @@
                 if (this.addForm.executorListFront == null) {
                     this.addForm.executorListFront = [];//初始化
                 }
-                this.addForm.executorListFront.push({executorId:null, planHours:8});
+                this.addForm.executorListFront.push({executorId:null, planHours:this.user.timeType.allday});
+                this.gstimday.push(1)
+                this.gstimhour.push(this.user.timeType.allday)
                 this.$forceUpdate();
             },
             removeExecutorLine(index) {
                 this.addForm.executorListFront.splice(index,1);
+                this.gstimday.splice(index,1)
+                this.gstimhour.splice(index,1)
                 this.$forceUpdate();
             },
             renameStage(item) {
@@ -2002,8 +2024,14 @@
                 });
                 //检查是有重名的执行人
                 var exeList = this.addForm.executorListFront;
+                // for(let i=0;i<this.gstimhour.length;i++){
+                //     exeList[i].planHours = this.gstimhour[i]
+                // }
+                console.log("jc",exeList);
+                
                 for (var i=0;i<exeList.length;i++) {
                     var findSameUser = false;
+                    exeList[i].planHours = this.gstimhour[i]
                     for (var j=i+1;j<exeList.length; j++) {
                         if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
                             findSameUser = true;