Browse Source

创建分组高亮初步完成

Lljy-ai 4 năm trước cách đây
mục cha
commit
911631964c

+ 78 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -495,7 +495,11 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
                 },
                 taskRules : {
                     name: [{ required: true, message: "请输入任务内容", trigger: "blur" }],
-                }
+                },
+                sleectId: null,
+                sleectProjectId: null,
+                sidebarIndex: null, // 侧边栏索引
+                
             };
         },
         methods: {
@@ -514,6 +518,7 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
                 this.groupTemplateList.forEach(g=>{
                     g.selected = false;
                 })
+                this.sidebarIndex = tIndex
                 this.groupTemplateList[tIndex].selected = true;
             },
             //获取分组模板列表
@@ -938,12 +943,22 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
                 this.getViewTaskList();
                 this.displayTable = true;
             } ,
+            // groupChange(index, indexPath) {
+            //     console.log(index);
+            //     this.groupType = 0;
+            //     this.order = "seq";
+            //     this.isDesc = false;
+            //     this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
+            //     this.getStageList();
+            //     this.displayTable = false;
+            // },
             groupChange(index, indexPath) {
                 console.log(index);
                 this.groupType = 0;
                 this.order = "seq";
                 this.isDesc = false;
                 this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
+                console.log(this.selectedGroup);
                 this.getStageList();
                 this.displayTable = false;
             },
@@ -996,11 +1011,34 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
                 var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)[0]));
                 delete param.stagesList;
                 param.projectId = this.curProjectId;
+                var k = this.groupTemplateList[this.sidebarIndex].name
+                var s = null;
+                var xmz = this.groupList.forEach(function(a, b, c){
+                    if (a.name == k) {
+                        s = true
+                        return
+                    }
+                })
+                if (s){ 
+                    this.addGroupDialog = false;
+                    return 
+                }
+                // // this.selectedGroup = this.groupTemplateList[this.sidebarIndex]
+                // this.groupList = this.groupTemplateList
+                // console.log(this.groupTemplateList)
+                // // // this.defaultGroupId = this.groupTemplateList[this.sidebarIndex].id
+                // // // this.groupChange(this.sidebarIndex);
+                // this.groupChange(this.groupTemplateList[this.sidebarIndex].id)
+
                 this.http.post('/task-group/createFromTemplate',param,
                 res => {
                     if (res.code == "ok") {
+                        this.selectedGroup = res.data
+                        this.sleectId = res.data.id
+                        this.sleectProjectId = res.data.projectId
                         this.addGroupDialog = false;
-                        this.getTaskGroups();
+                        // this.getTaskGroups();
+                        this.getTaskGroup();
                     } else {
                         this.$message({
                         message: res.msg,
@@ -1022,9 +1060,11 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
                         this.groupList = res.data;
                         this.addGroupDialog = false;
                         this.modGroupDialog = false;
-                        if (this.selectedGroup.id == this.groupForm.id) {
+                        console.log(this.selectedGroup.id);
+                        if (this.selectedGroup.id !== this.groupForm.id) {
                             this.selectedGroup = this.groupForm;
                         }
+                        this.defaultGroupId = this.groupList[this.groupList.length - 1].id
                     } else {
                         this.$message({
                         message: res.msg,
@@ -1077,6 +1117,41 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
                     });
                 });
             },
+
+            // 额外加的
+             getTaskGroup() { 
+                this.http.post('/task-group/list',{projectId: this.curProjectId},
+                res => {
+                    if (res.code == "ok") {
+                        console.log(res);
+                        console.log(res.data.length)
+                        this.allGroupData = res.data;
+                        this.groupList = res.data;
+                        if (this.groupList.length > 0) {
+                            this.defaultGroupId = this.sleectId;
+                            this.selectedGroup = this.groupList[res.data.length - 1];
+                            this.getStageList();
+                        } else {
+                            //清空任务列表
+                            this.defaultGroupId = null;
+                            this.selectedGroup = null;
+                            this.stageList = [];
+                        }
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+
             //切换项目
             onProjectChange() {
                 let path = this.$route.path;

+ 24 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -96,6 +96,29 @@
             展示样例
             </p>
             <div style="width:500px;">
+               开始时间: <el-time-picker
+                    v-model="startTime"
+                    :picker-options="{
+                        start: '08:30',
+                        step: '00:15',
+                        end: '18:30'
+                    }"
+                    placeholder="任意时间点">
+                </el-time-picker>
+            </div>
+            <div style="margin-top:5px;">
+               结束时间: <el-time-picker
+                            v-model="endTime"
+                            :picker-options="{
+                                start: '08:30',
+                                step: '00:15',
+                                end: '18:30',
+                                minTime: startTime
+                            }"
+                            placeholder="任意时间点">
+                        </el-time-picker>
+            </div>
+            <!-- <div style="width:500px;">
                 开始时间:<el-time-select
                     placeholder="起始时间"
                     v-model="startTime"
@@ -117,7 +140,7 @@
                     minTime: startTime
                     }">
                 </el-time-select>
-            </div>
+            </div> -->
                 </div>
             </el-radio>