Przeglądaj źródła

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper into master

seyason 2 lat temu
rodzic
commit
d776348ef5
16 zmienionych plików z 394 dodań i 57 usunięć
  1. 10 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java
  2. 0 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/UserVO.java
  3. 4 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/UserService.java
  4. 22 24
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  5. 7 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java
  6. 91 3
      fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue
  7. 20 2
      fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue
  8. 6 3
      fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue
  9. 25 2
      fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue
  10. 27 2
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  11. 5 4
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/exaLeave/applyLeave.vue
  12. 3 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/exaLeave/awayOffice.vue
  13. 1 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue
  14. 4 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/projectInside.vue
  15. 156 5
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/editask.vue
  16. 13 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/index.vue

+ 10 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java

@@ -218,5 +218,15 @@ public class UserController {
         return userService.importMonthCost(file, ymonth, request);
     }
 
+    @RequestMapping("/isManager")
+    public HttpRespMsg isManager(HttpServletRequest request) throws Exception {
+        return userService.isManager(request);
+    }
+
+    @RequestMapping("/skipGuidance")
+    public HttpRespMsg skipGuidance(HttpServletRequest request){
+        return userService.skipGuidance(request);
+    }
+
 }
 

+ 0 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/UserVO.java

@@ -26,6 +26,4 @@ public class UserVO extends User {
 
     private boolean hasAuditDept;
 
-    private boolean isManager;
-
 }

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/UserService.java

@@ -75,4 +75,8 @@ public interface UserService extends IService<User> {
     HttpRespMsg loginAdminByThirdParty(String jobNumber, String token);
 
     HttpRespMsg importMonthCost(MultipartFile file, String ymonth, HttpServletRequest request);
+
+    HttpRespMsg isManager(HttpServletRequest request) throws Exception;
+
+    HttpRespMsg skipGuidance(HttpServletRequest request);
 }

+ 22 - 24
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -199,13 +199,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                     }
                 }
             }
-            //获取所在企业管理员列表
-            List<User> adminList=new ArrayList<>();
-            try {
-                adminList = wxCorpInfoService.getAdminList(company.getId());
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
             //检测密码正确时
             UserVO userVO = new UserVO().setCompanyName(company.getCompanyName());
             userVO.setCompany(company);
@@ -234,14 +227,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 num = auditWorkflowTimeSettingMapper.selectCount(new QueryWrapper<AuditWorkflowTimeSetting>().in("audit_dept_id", deptIds));
             }
             userVO.setHasAuditDept(num>0);
-            boolean match = adminList.stream().anyMatch(al -> al.getCorpwxUserid().equals(userVO.getCorpwxUserid()));
-            userVO.setManager(match);
             //获取当前角色的权限菜单
             setUserRoleMenu(userVO);
             httpRespMsg.data = userVO;
-            //记录第一次登录
-            userList.get(0).setIsFirstLogin(0);
-            userMapper.updateById(userList.get(0));
         } else {
             httpRespMsg.setError(MessageUtils.message("user.pwdError"));
         }
@@ -451,6 +439,28 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return msg;
     }
 
+    @Override
+    public HttpRespMsg isManager(HttpServletRequest request) throws Exception {
+        HttpRespMsg msg=new HttpRespMsg();
+        User user= userMapper.selectById(request.getHeader("token"));
+        List<User> adminList = wxCorpInfoService.getAdminList(user.getCompanyId());
+        boolean match = adminList.stream().anyMatch(al -> user.getCorpwxUserid() != null && al.getCorpwxUserid() != null && al.getCorpwxUserid().equals(user.getCorpwxUserid()));
+        msg.data=match;
+        return msg;
+    }
+
+    @Override
+    public HttpRespMsg skipGuidance(HttpServletRequest request) {
+        HttpRespMsg msg=new HttpRespMsg();
+        User user= userMapper.selectById(request.getHeader("token"));
+        user.setIsFirstLogin(0);
+        if(userMapper.updateById(user)>0){
+            return msg;
+        }
+        msg.setError("验证失败");
+        return msg;
+    }
+
 
     public void setUserRoleMenu(UserVO user) {
         Integer roleId = user.getRoleId();
@@ -2339,13 +2349,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         if (info != null) {
             user.setUserNameNeedTranslate(info.getSaasSyncContact());
         }
-        //获取所在企业管理员列表
-        List<User> adminList=new ArrayList<>();
-        try {
-            adminList = wxCorpInfoService.getAdminList(company.getId());
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
 
         UserVO userVO = new UserVO().setCompanyName(company.getCompanyName());
         userVO.setCompany(company);
@@ -2365,14 +2368,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             num = auditWorkflowTimeSettingMapper.selectCount(new QueryWrapper<AuditWorkflowTimeSetting>().in("audit_dept_id", deptIds));
         }
         userVO.setHasAuditDept(num>0);
-        boolean match = adminList.stream().anyMatch(al -> al.getCorpwxUserid().equals(userVO.getCorpwxUserid()));
-        userVO.setManager(match);
         //获取当前角色的权限菜单
         setUserRoleMenu(userVO);
         httpRespMsg.data = userVO;
-        //记录第一次登录
-        user.setIsFirstLogin(0);
-        userMapper.updateById(user);
         return httpRespMsg;
     }
 

+ 7 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -297,15 +297,15 @@ public class TimingTask {
             DateTimeFormatter dtf1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
             DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("HH:mm");
             //需要修改************************************************  日期
-            LocalDateTime yesterday = LocalDateTime.now().minusDays(100);
+            LocalDateTime yesterday = LocalDateTime.now().minusDays(2);
             String startDate = dtf.format(yesterday);
             String endDate = dtf.format(yesterday.plusDays(30));
             List<UserFvTime> oldUserFvTimeList = userFvTimeService.list(new QueryWrapper<UserFvTime>().eq("company_id", compId));
             List<LeaveSheet> oldLeaveSheetList = leaveSheetService.list(new QueryWrapper<LeaveSheet>().eq("company_id", compId));
             List<BusinessTrip> oldBusinessTripList = businessTripService.list(new QueryWrapper<BusinessTrip>().eq("company_id", compId));
             /*jsonObject.put("startDate",startDate);
-            jsonObject.put("endDate",endDate);
-            jsonObject.put("workDate",startDate);*/
+            jsonObject.put("endDate",endDate);*/
+            jsonObject.put("workDate",startDate);
             String jsonString = jsonObject.toJSONString();
             List<UserFvTime> userFvTimeList=new ArrayList<>();
             List<LeaveSheet> leaveSheetList=new ArrayList<>();
@@ -325,7 +325,7 @@ public class TimingTask {
             List<Map<String,Object>> replaceWorkDataList= (List<Map<String, Object>>) replaceWorkDataMsg.data;
             List<String> userIds = workDataList.stream().map(map -> String.valueOf(map.get("userId"))).distinct().collect(Collectors.toList());
             List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("job_number", userIds));
-            List<LocalDateTime> dateTimeList = getDays(yesterday, yesterday.plusDays(132));
+            List<LocalDateTime> dateTimeList = getDays(yesterday, yesterday.plusDays(2));
             for (User user : userList) {
                 for (LocalDateTime localDateTime : dateTimeList) {
                     LocalDate workDate=localDateTime.toLocalDate();
@@ -386,6 +386,9 @@ public class TimingTask {
                         if(first.isPresent()){
                             userFvTime.setId(first.get().getId());
                         }
+                        if(endTime.isBefore(startTime)){
+                            continue;
+                        }
                         userFvTimeList.add(userFvTime);
                     }
                 }

+ 91 - 3
fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue

@@ -1,7 +1,25 @@
 <template>
   <div>
     <div style="height: 72vh;overflow: auto;">
-        <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
+        <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="120px">
+            <el-form-item label="所属项目" v-if="showOrNot" prop="projectId">
+                <el-select v-model="addForm.projectId" :placeholder="$t('defaultText.pleaseChoose')" @change="agentCreatesEvents(1)" filterable="true" style="width:100%;">
+                    <el-option v-for="item in projectList" :key="item.id" :label="item.projectName + item.projectCode" :value="item.id">
+                        <span style="float: left;color: #8492a6;">{{ item.projectCode }}</span>
+                        <span style="float: right;font-size: 13px;">{{ item.projectName }}</span>
+                    </el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item label="所属任务分组" v-if="showOrNot" prop="groupId">
+                <el-select v-model="addForm.groupId" :placeholder="$t('defaultText.pleaseChoose')" @change="agentCreatesEvents(2)" filterable="true" style="width:100%;">
+                    <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item label="所属任务列表" v-if="showOrNot" prop="stagesId">
+                <el-select v-model="addForm.stagesId" :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width:100%;">
+                    <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
+                </el-select>
+            </el-form-item>
             <!--子任务需要选择任务列表 -->
             <el-form-item :label="$t('tasklist')" prop="stages" v-if="addForm.parentTid != null">
                 <el-select v-model="addForm.stagesId" style="width:100%;" >
@@ -575,6 +593,11 @@ export default {
         type: Object,
         default: {}
     },
+    // 是否显示选择任务
+    showOrNot: {
+        type: Boolean,
+        default: false
+    }
   },
   components: {
     quillEditor, // 富文本
@@ -667,6 +690,9 @@ export default {
         },
         taskRules : {
             name: [{ required: true, message: this.$t('enterthetaskcontent'), trigger: "blur" }],
+            projectId: [{ required: true, message: '请选择所属项目', trigger: "blur" }],
+            groupId: [{ required: true, message: '请选择所属任务分组', trigger: "blur" }],
+            stagesId: [{ required: true, message: '请选择所属任务列表', trigger: "blur" }],
         },
         formGrouping: {
             name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
@@ -783,7 +809,7 @@ export default {
   watch: {},
   created() {},
   mounted() {
-    console.log('我获取到的数据', this.integrationTask)
+    console.log('我获取到的数据', this.integrationTask, this.showOrNot)
     this.triggerEvent(this.integrationTask)
     this.gstimhour = [this.user.timeType.allday]
     this.gstimday = [1]
@@ -795,6 +821,7 @@ export default {
     triggerEvent(obj) {
         console.log(obj, '触发事件')
         this.curProjectId = obj.curProjectId
+        this.getProjectList()
         if(!obj.taskVue) {
             this.getStageList(obj.integrationTaskNingwai)
         }
@@ -824,6 +851,66 @@ export default {
             this.getTaskFileList(obj.num,obj.id)
         }
     },
+    // 代办任务创建事件
+    agentCreatesEvents(num) {
+        if(num == 1) {
+            this.addForm.groupId = ''
+            this.addForm.stagesId = ''
+            this.getTaskGrouping()
+        } else if(num == 2) {
+            this.addForm.stagesId = ''
+            this.getTaskList()
+        }
+    },
+    //获取项目列表
+    getProjectList() {
+        this.http.post(this.port.project.list, {},
+        res => {
+            if (res.code == "ok") {
+                this.projectList = res.data;
+            } else {
+                this.$message({
+                    message: res.msg,
+                    type: "error"
+                });
+            }
+        },
+        error => {
+            this.$message({
+                message: error,
+                type: "error"
+            });
+        });
+    },
+    // 获取任务分组
+    getTaskGrouping() {
+        this.http.post('/task-group/list', {projectId:this.addForm.projectId},
+        res => {
+            if (res.code == "ok") {
+                this.groupList = res.data;
+            } else {
+                this.$message({
+                    message: res.msg,
+                    type: "error"
+                });
+            }
+        },
+        error => {
+            this.$message({
+                message: error,
+                type: "error"
+            });
+        });
+    },
+    getTaskList() {
+        let obj = {
+            groupId: this.addForm.groupId,
+            projectId: this.addForm.projectId,
+            order: 'seq',
+            isDesc: false
+        }
+        this.getStageList(obj)
+    },
     // 关闭最外层弹窗
     closeBounceds() {
         console.log('我被触发了')
@@ -1226,7 +1313,8 @@ export default {
                             if (this.addForm.parentTid == null) {
                                 console.log('我是对的')
                                 let obj = {
-                                    submitInsert: true
+                                    submitInsert: true,
+                                    showOrNot: this.showOrNot
                                 }
                                 this.$emit('closeBounced', obj)
                             } else {

+ 20 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -360,17 +360,37 @@
             console.log(localStorage.getItem('firstTourFalse'))
         },
         methods: {
+            getSkipGuidance() {
+                this.http.post('/user/skipGuidance', {},
+                res => {
+                    if (res.code == "ok") {
+                        let users = JSON.parse(sessionStorage.getItem("user"))
+                        users.isFirstLogin == 0
+                        sessionStorage.setItem("user", JSON.stringify(users))
+                    }
+                },
+                error => {
+                });
+            },
             onSkip(currentStep) {
                 console.log('看看')
                 this.vTourFlg = false
                 this.firstTourFalse = false
                 localStorage.setItem('firstTourFalse', false)
+                console.log(this.user, '用户信息')
+                if(this.user.corpwxUserid != null) {
+                    this.getSkipGuidance()
+                }
             },
             onFinish(currentStep) {
                 console.log('数据')
                 this.vTourFlg = false
                 this.firstTourFalse = false
                 localStorage.setItem('firstTourFalse', false)
+                this.getSkipGuidance()
+                if(this.user.corpwxUserid != null) {
+                    this.getSkipGuidance()
+                }
             },
 
             // 中英文切换
@@ -704,8 +724,6 @@
             },
         },
         mounted() {
-            // console.log(this.$router.options.routes, '看看')
-            console.log(this.$router.options.routes, '路由')
             var ua = navigator.userAgent.toLowerCase();
             if (ua.indexOf("wxwork") > 0) {
                 this.isCorpWX = true;

+ 6 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -16,10 +16,10 @@
                     <el-form-item class="login-button" style="width:100%;">
                         <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">{{ $t('login') }}</el-button>
                     </el-form-item>
-                    <div class="additional">
+                    <div class="additional" v-if="wxHrefFlg">
                         <el-divider content-position="center">或</el-divider>
                     </div>
-                    <div class="externalLanding">
+                    <div class="externalLanding" v-if="wxHrefFlg">
                         <div class="externalLanding_img" @click="wxworkCli()">
                             <img src="../assets/image/qiyeweix.png" alt="">
                         </div>
@@ -85,7 +85,9 @@
                     password: [{ required: true, message: this.$t('peaseenterthe'), trigger: 'blur' },]
                 },
                 wxworkFlg: false,
-                bindingqywx: false
+                bindingqywx: false,
+
+                wxHrefFlg: false
             };
         },
         watch: {
@@ -122,6 +124,7 @@
                 this.isCorpWX = true;
             } 
             let href = window.location.href;
+            this.wxHrefFlg = href.indexOf('worktime.ttkuaiban.com') != '-1'
             if (this.isCorpWX) {
                 //企业微信环境下,尝试自动登录
                 //判断企业微信,是否存在授权

+ 25 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -79,6 +79,9 @@
                         </el-date-picker>
                     </div>
                 </el-form-item>
+                <el-form-item style="float: right;">
+                     <el-link type="primary" icon="el-icon-circle-plus-outline" :underline="false" @click="addTask()">新建任务</el-link>
+                </el-form-item>
             </el-form>
         </el-col>
         <div style="display: flex;width: 100%;">
@@ -219,7 +222,7 @@
         :close-on-click-modal="false" customClass="customWidth" width="840px" :top="'6vh'">
         <!-- <div style="width: 200%;height:80%;position: absolute;right:-100%;top:0;background:#000;opacity: 0;" @click="sss"></div> -->
             <!-- 整合 -->
-            <taskComponent ref="thskComponents" :integrationTask="integrationTask" @closeBounced="closeBounced"></taskComponent>
+            <taskComponent ref="thskComponents" :integrationTask="integrationTask" :showOrNot="showOrNot" @closeBounced="closeBounced"></taskComponent>
             <div slot="title" v-if="addForm.parentTid != null">
                 <el-page-header  @back="backToParentTask" :title="$t('parenttask')" :content="addForm.parentTname"></el-page-header>
             </div>
@@ -824,6 +827,7 @@ import { error } from 'dingtalk-jsapi';
         },
         data() {
             return {
+                showOrNot: false,
                 typeField: null,
                 searchField: '0',
                 keyword:null,
@@ -967,6 +971,10 @@ import { error } from 'dingtalk-jsapi';
                     if(obj.deleteTask) {
                         this.getList()
                     }
+
+                    if(obj.showOrNot) {
+                        this.getList()
+                    }
                 } else {
                     this.backToParentTask()
                 }
@@ -1432,6 +1440,7 @@ import { error } from 'dingtalk-jsapi';
                 // this.addLoading = false;
                 this.title = this.$t('editingtasks');
                 this.dynamicTab = true
+                this.showOrNot = false
 
                 // 自定义组件
                 this.integrationTask = {
@@ -1734,10 +1743,24 @@ import { error } from 'dingtalk-jsapi';
             },
             addTask(stage) {
                 this.addFormVisible = true;
-                this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
+                // this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
+                this.addForm = {projectId: '', groupId: '', stagesId: '', taskLevel:0, planHours: 8, taskType: 0};
                 this.addLoading = false;
                 this.title=this.$t('createtask ');
                 this.commentList = [];
+                this.showOrNot = true
+
+                let obj = {
+                    create: true,
+                    addForm: this.addForm,
+                    executorListFront: [{executorId:null, planHours:8}],
+                    stage: this.addForm,
+                    integrationTaskNingwai: this.integrationTaskNingwai,
+                    taskVue: true,               
+                }
+                this.integrationTask = obj
+
+                this.taskComponentFlg = true
             },
             addStage() {
                 this.addStageDialog = true;

+ 27 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -732,7 +732,7 @@
           路径:管理企业-应用管理-工时管家-可见范围
         </span>
         <span slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="visibleRange" v-if="user.manager">可见范围设置</el-button>
+          <el-button type="primary" @click="visibleRange" v-if="wxManager">可见范围设置</el-button>
           <el-button type="primary" @click="newSyncWithCorpWx">开始同步</el-button>
         </span>
       </el-dialog>
@@ -1020,7 +1020,9 @@ export default {
       saveBtnLoading: false,
       onlyDirect: false,
       nextCursor: '',
-      newSyncWithCorpWxDayload: false
+      newSyncWithCorpWxDayload: false,
+
+      wxManager: false,
     };
   },
   filters: {
@@ -1036,6 +1038,26 @@ export default {
     that = this;
   },
   methods: {
+    getWxManager() {
+      this.http.post('/user/isManager', {},
+      res => {
+          if (res.code == "ok") {
+              let bur = res.data + ''
+              this.wxManager = bur == 'true'
+          } else {
+              this.$message({
+                  message: res.msg,
+                  type: "error"
+              });
+          }
+      },
+      error => {
+          this.$message({
+              message: error,
+              type: "error"
+          });
+      });
+    },
     recordIndate(date){
             let datestr = ''
             datestr += date[0]
@@ -3378,6 +3400,9 @@ export default {
     if(this.user.dingdingUserid != null || this.user.corpwxUserid != null){
       this.getRecordMsg()
     }
+    if(this.user.corpwxUserid != null) {
+      this.getWxManager()
+    }
     // 获取企业微信的参数
     // if(this.user.companyId == '1081' || this.user.companyId == '7') {
     //   this.agentConfig()

+ 5 - 4
fhKeeper/formulahousekeeper/timesheet_h5/src/views/exaLeave/applyLeave.vue

@@ -41,7 +41,7 @@
                     </div>
                 </van-popup>
                 <!-- 电话 -->
-                <van-field label="电话" v-model="editForm.tel" type="number" :rules="[{ required: true, message: '请输入联系电话' }]"></van-field>
+                <van-field label="电话" v-model="editForm.tel" type="number" required :rules="[{ required: true, message: '请输入联系电话' }]"></van-field>
                 <!-- 按天/小时请假 -->
                 <van-field label="时长单位" readonly>
                     <template #input>
@@ -52,7 +52,7 @@
                     </template>
                 </van-field>
                 <!-- 选择日期 -->
-                <van-field :label="editForm.timeType == '0' ? '选择日期' : '选择时间'" v-model="formshowText.dateTitle" @click="dateShow()" readonly clickable :rules="[{ required: true, message: editForm.timeType == '0' ? '请选择日期' : '请选择时间' }]">
+                <van-field :label="editForm.timeType == '0' ? '选择日期' : '选择时间'"  required v-model="formshowText.dateTitle" @click="dateShow()" readonly clickable :rules="[{ required: true, message: editForm.timeType == '0' ? '请选择日期' : '请选择时间' }]">
                     <template #input><span>{{formshowText.dateTitle}}</span></template>
                 </van-field>
                     <!-- 按天 -->
@@ -343,6 +343,7 @@ export default {
                             remark: ''
                         }
                         this.formshowText.dateTitle = ''
+                        this.$toast.success('提交成功');
                     } else {
                         this.$toast.fail(res.msg);
                     }
@@ -584,12 +585,12 @@ export default {
         .list_collapse{
             
             .collapse_label_l{
-                width: 60%;
+                width: 50%;
                 padding: 4px;
                 display: inline-block;
             }
             .collapse_label_r{
-                width: 40%;
+                width: 50%;
                 padding: 4px;
                 display: inline-block;
                 .waiting {

+ 3 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/exaLeave/awayOffice.vue

@@ -343,6 +343,7 @@ export default {
                             remark: ''
                         }
                         this.formshowText.dateTitle = ''
+                        this.$toast.success('提交成功');
                     } else {
                         this.$toast.fail(res.msg);
                     }
@@ -584,12 +585,12 @@ export default {
         .list_collapse{
             
             .collapse_label_l{
-                width: 60%;
+                width: 50%;
                 padding: 4px;
                 display: inline-block;
             }
             .collapse_label_r{
-                width: 40%;
+                width: 50%;
                 padding: 4px;
                 display: inline-block;
                 .waiting {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -143,7 +143,7 @@
                     if(list[i].name == '请假管理') {
                         this.routers.push({name: '请假管理',url: '/applyLeave',icon: 'completed'})
                         // this.routers.push({name: '请假审批',url: '/exaLeave',icon: 'completed'})
-                        this.routers.push({name: '出差管理',url: '/awayOffice',icon: 'completed'})
+                        // this.routers.push({name: '出差管理',url: '/awayOffice',icon: 'completed'})
                     }
 
                     if(list[i].name == '费用报销') {

+ 4 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/projectInside.vue

@@ -304,14 +304,16 @@ export default {
                     addNew: true,
                     id: null,
                     groupId: this.inside.taskGroup.active.id,
-                    stagesId: this.inside.stages.active.id
+                    stagesId: this.inside.stages.active.id,
+                    showOrNot: false
                 }
             }else{
                 item = {
                     addNew: false,
                     id: taskid,
                     groupId: null,
-                    stagesId: null
+                    stagesId: null,
+                    showOrNot: false
                 }
             }
             sessionStorage.setItem('taskId',JSON.stringify(item))

+ 156 - 5
fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/editask.vue

@@ -3,6 +3,44 @@
         <van-nav-bar :title="title" left-text="返回" @click-left="back" fixed left-arrow />
         <div class="content">
             <van-form>
+                <div v-if="showOrNot">
+                    <van-cell title="所属项目" :value="select_project" @click="select_project_show = true,select_project_show_searchText = '',onSearchProject()"></van-cell>
+                    <van-popup v-model="select_project_show" position="bottom">
+                        <van-search v-model.trim="select_project_show_searchText" placeholder="输入项目名称搜索" @input="onSearchProject"></van-search>
+                        <div style="minHeight:300px;">
+                            <van-radio-group v-model="taskform.projectId">
+                                <van-radio v-for="uitem in select_project_array" :key="uitem.id" :name="uitem" style="padding:10px">
+                                    <span>{{uitem.projectName}}</span>
+                                </van-radio>
+                            </van-radio-group>
+                            <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;" @click="selectProject()">确定</van-button>
+                        </div>
+                </van-popup>
+                    <van-cell title="所属任务分组" :value="select_grouping" @click="select_grouping_show = true"></van-cell>
+                    <van-popup v-model="select_grouping_show" position="bottom">
+                        <van-picker
+                        show-toolbar
+                        :columns="select_grouping_array"
+                        @confirm="selectGrouping"
+                        @cancel="select_grouping_show = false;$forceUpdate();">
+                            <template #option="item">
+                                {{item.name}}
+                            </template>
+                        </van-picker>
+                    </van-popup>
+                    <van-cell title="所属任务列表" :value="select_list" @click="select_list_show = true"></van-cell>
+                    <van-popup v-model="select_list_show" position="bottom">
+                        <van-picker
+                        show-toolbar
+                        :columns="select_list_array"
+                        @confirm="selectList"
+                        @cancel="select_list_show = false;$forceUpdate();">
+                            <template #option="item">
+                                {{item.stagesName}}
+                            </template>
+                        </van-picker>
+                    </van-popup>
+                </div>
                 <!-- 类型 -->
                 <van-field v-model="taskform.taskType" label="类型" @click="taskType.show = true" readonly clickable>
                     <template #input><span>{{taskType.list[taskform.taskType]}}</span></template>
@@ -100,7 +138,7 @@
                 <vue-html5-editor :content="taskform.taskDesc" :height="300" @change="htmleditor"></vue-html5-editor>
 
             </van-form>
-            <div class="form_btn" style="position:fixed; bottom:0px;width:100%;">
+            <div class="form_btn" style="position:fixed; bottom:0px;width:100%;z-index: 99">
                 <div style="padding-bottom:10px;">
                     <van-button square block type="info" loading-text="保存中..." @click="submitTask" native-type="submit" :loading="submitTaskBtn" style="width:100%;float:left;" :disabled="!canEdit">
                         <div v-if="canEdit">保存</div>
@@ -117,6 +155,7 @@
 export default {
     data() {
         return {
+            showOrNot: false,
             title: '编辑任务',
             user: JSON.parse(localStorage.userInfo),
             taskId: JSON.parse(sessionStorage.taskId),
@@ -158,20 +197,34 @@ export default {
                 list: [],
                 searchList: [],
                 searchText: ''
-            }
+            },
+
+            select_project_show: false,
+            select_grouping_show: false,
+            select_list_show: false,
+            select_project: '请选择',
+            select_grouping: '请选择',
+            select_list: '请选择',
+            select_project_array: [],
+            select_project_array_tow: [], 
+            select_grouping_array: [],
+            select_list_array: [],
+            select_project_show_searchText: ''
 
         }
     },
     mounted() {
+        this.showOrNot = this.taskId.showOrNot
+        this.getProjectList()
         if(!this.taskId.addNew){
             this.title = '编辑任务'
             this.getTask()
         }else{
             this.title = '新建任务'
             this.taskform = {
-                projectId: JSON.parse(sessionStorage.projectId),
-                groupId: this.taskId.groupId,
-                stagesId: this.taskId.stagesId,
+                projectId: '',
+                groupId: '',
+                stagesId: '',
                 taskType: 0,
                 name: '',
                 startDate: null,
@@ -181,11 +234,96 @@ export default {
                 taskLevel: 0,
                 executorList: [{executorName: '',executorId: '',planHours: this.user.timeType.allday}]
             }
+            if(!this.taskId.showOrNot) {
+                this.taskform.groupId = this.taskId.groupId
+                this.taskform.stagesId = this.taskId.stagesId
+                this.taskform.projectId = JSON.parse(sessionStorage.projectId)
+            }
         }
         this.getUsersList()
         console.log('mounted',this.taskId,null);
     },
     methods: {
+        selectProject(value,key) {
+            this.select_project = this.taskform.projectId.projectName
+            this.taskform.projectId = this.taskform.projectId.id
+            console.log(this.taskform)
+            this.getTaskGrouping()
+            this.select_project_show_searchText = ''
+            this.select_project_show = false
+
+            this.select_list = ''
+            this.select_grouping = ''
+            this.taskform.groupId = ''
+            this.taskform.stagesId = ''
+        },
+        selectGrouping(value){
+            this.select_grouping = value.name
+            this.taskform.groupId = value.id
+            this.getStageList()
+            this.select_grouping_show = false
+
+            this.select_list = ''
+            this.taskform.stagesId = ''
+        },
+        selectList(value) {
+            console.log(value)
+            this.select_list = value.stagesName
+            this.taskform.stagesId = value.id
+            this.select_list_show = false
+        },
+        onSearchProject() {
+            let text = this.select_project_show_searchText
+            if(text != '') {
+                let projectArr = this.select_project_array_tow
+                var arr = []
+                for(var i in projectArr) {
+                    if(projectArr[i].projectName.indexOf(text) != '-1') {
+                        arr.push(projectArr[i])
+                    }
+                }
+                this.select_project_array = arr
+            } else {
+                this.select_project_array = this.select_project_array_tow
+            }
+        },
+        getProjectList() {
+            this.$axios.post("/project/getProjectList", {})
+            .then(res => {
+                if(res.code == "ok") {
+                    this.select_project_array = res.data
+                    this.select_project_array_tow = res.data
+                } else {
+                    this.$toast.fail('失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
+        },
+        getTaskGrouping() {
+            this.$axios.post("/task-group/list", {projectId:this.taskform.projectId})
+            .then(res => {
+                if(res.code == "ok") {
+                    this.select_grouping_array = res.data
+                } else {
+                    this.$toast.fail('失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
+        },
+        getStageList() {
+            this.$axios.post("/stages/list", {
+                projectId: this.taskform.projectId,
+                groupId: this.taskform.groupId,
+                order: 'seq',
+                isDesc: false
+            })
+            .then(res => {
+                if(res.code == "ok") {
+                    this.select_list_array = res.data.list
+                } else {
+                    this.$toast.fail('失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
+        },
+
         back() {
             history.back();
         },
@@ -298,6 +436,19 @@ export default {
                 }
             }
 
+            if(this.taskform.projectId == '' || this.taskform.projectId == null) {
+                this.$toast.fail("请选择所属项目");
+                return
+            }
+            if(this.taskform.groupId == '' || this.taskform.groupId == null) {
+                this.$toast.fail("请选择所属任务分组");
+                return
+            }
+            if(this.taskform.stagesId == '' || this.taskform.stagesId == null) {
+                this.$toast.fail("请选择所属任务列表");
+                return
+            }
+
             // 去除未选择执行人的执行人列表
             this.taskform.executorList = this.taskform.executorList.filter(item => item.executorId)
             this.taskform.executorListStr = JSON.stringify(this.taskform.executorList)

+ 13 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <van-nav-bar title="待办任务" left-text="返回" @click-left="back" fixed left-arrow />
+    <van-nav-bar title="待办任务" left-text="返回" @click-left="back" right-text="新建任务" @click-right="addTask()" fixed left-arrow />
     <div class="content">
 
     <van-sticky offset-top="1.22667rem">
@@ -125,6 +125,18 @@ export default {
         this.getList()
     },
     methods: {
+        // 新建任务
+        addTask() {
+            let item = {
+                addNew: true,
+                id: null,
+                groupId: '',
+                stagesId: '',
+                showOrNot: true
+            }
+            sessionStorage.setItem('taskId',JSON.stringify(item))
+            this.$router.push("/editask");
+        },
         back() {
             history.back();
         },