eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/NewSalaryService.java
@@ -129,7 +129,7 @@ * @param userId * @param targetYearMonth */ void userSalarySettlement(Long userId, String targetYearMonth); void userSalarySettlement(Long userId, String targetYearMonth, List<String> errors); Double getMeritWage(Double CompletedAchievementsHoursRate,Long level); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/dto/NewSalaryQueryCriteria.java
@@ -33,6 +33,9 @@ @Query private Long userId; @Query(propName = "userId", type = Query.Type.IN) private List<Long> selectedValue1; /* 部门人员检索多选时使用 */ @Query(propName = "userId", type = Query.Type.IN) private List<Long> userIds; eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/NewSalaryServiceImpl.java
@@ -15,6 +15,7 @@ */ package me.zhengjie.modules.salary.service.impl; import cn.hutool.core.io.resource.MultiFileResource; import io.swagger.models.auth.In; import lombok.RequiredArgsConstructor; import me.zhengjie.exception.BadRequestException; @@ -55,6 +56,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; @@ -151,6 +153,13 @@ if (newSalaryList.size() > 0) { throw new BadRequestException("找到相同用户相同年月的工资记录!"); } // NewSalary savedSalary = newSalaryRepository.save(resources); // if (savedSalary.getId() != null) { // // 保存成功 // } else { // // 保存失败 // Prin // } return newSalaryMapper.toDto(newSalaryRepository.save(resources)); } @@ -309,20 +318,36 @@ } @Override @Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class) public void generate(NewSalaryQueryCriteria criteria) { List<String> errors = new ArrayList<>(); for (Long id : criteria.getSelectedValue1()) { try { // 用户工资结算 userSalarySettlement(criteria.getUserId(), DateUtil.internationalTimeToChinaTime(criteria.getTargetYearMonth())); userSalarySettlement(id, DateUtil.internationalTimeToChinaTime(criteria.getTargetYearMonth()), errors); } catch (Exception e) { // 记录错误信息 errors.add("ID " + id + ": " + e.getMessage()); } } // 在循环结束后处理错误 if (!errors.isEmpty()) { // 将所有的错误信息收集到一个字符串中 String errorMessage = String.join("; ", errors); // 抛出一个新的异常 throw new RuntimeException(errorMessage); } } // ==================== 以下为定时生成工资记录主要逻辑 ==================== @Override @Transactional(rollbackFor = Exception.class) public void userSalarySettlement(Long userId, String targetYearMonth) { @Transactional(rollbackFor = Exception.class) // propagation = Propagation.REQUIRES_NEW, public void userSalarySettlement(Long userId, String targetYearMonth, List<String> errors) { // 判断用户ID是否为空 if (userId != null) { // 单个用户工资结算 singleUserSalarySettlement(userId, targetYearMonth); singleUserSalarySettlement(userId, targetYearMonth, errors); } else { // 用户检索类 UserQueryCriteria userQueryCriteria = new UserQueryCriteria(); @@ -333,7 +358,7 @@ for (int i = 0; i < userDtoList.size(); i++) { try { // 单个用户工资结算 singleUserSalarySettlement(userDtoList.get(i).getId(), targetYearMonth); singleUserSalarySettlement(userDtoList.get(i).getId(), targetYearMonth, errors); } catch (Exception e) { // 跳过本次循环 continue; @@ -360,7 +385,7 @@ // 单个用户工资结算 private void singleUserSalarySettlement(Long userId, String targetYearMonth) { private void singleUserSalarySettlement(Long userId, String targetYearMonth, List<String> errors) { // 日历类 Calendar cal = Calendar.getInstance(); // 设置年份 @@ -383,8 +408,9 @@ newSalary.setSalaryYearMonth(new Timestamp(cal.getTime().getTime())); newSalary.setPublicityStatus(Constant.PUBLICITY_STATUS_NOT); newSalary.setApproveStatus(Constant.APPROVE_STATUS_UNRECOGNIZED); try { // 获取用户级别工资 newSalary = getUserLevelWage(userId, targetYearMonth, newSalary); newSalary = getUserLevelWage(userId, targetYearMonth, newSalary, errors); // 获取用户级别保险 newSalary = getUserLevelInsurance(userId, targetYearMonth, newSalary); // 获取用户级别其他 @@ -397,6 +423,10 @@ newSalary = getComplianceWork(userId, targetYearMonth, newSalary); // 获取已完成工时 newSalary = getCompletedWork(userId, targetYearMonth, newSalary); } catch (BadRequestException e) { errors.add(e.getMessage()); return; } try { // 保存 create(newSalary); @@ -407,11 +437,12 @@ } // 获取用户级别工资 private NewSalary getUserLevelWage(Long userId, String targetYearMonth, NewSalary newSalary) { private NewSalary getUserLevelWage(Long userId, String targetYearMonth, NewSalary newSalary, List<String> errors) { // 用户级别工资检索类 UserLevelWageQueryCriteria userLevelWageQueryCriteria = new UserLevelWageQueryCriteria(); userLevelWageQueryCriteria.setUserId(userId); userLevelWageQueryCriteria.setTargetYearMonth(targetYearMonth); try { // 查询指定年月用户级别工资 UserLevelWageDto userLevelWageDto = userLevelWageService.queryTargetYearMonth(userLevelWageQueryCriteria); // 级别基本工资 @@ -428,6 +459,10 @@ newSalary.setPerformanceWage(BigDecimal.ZERO); // 设置工资条的基本工资 newSalary.setTeamWage(BigDecimal.ZERO); } catch (RuntimeException e) { errors.add(e.getMessage()); return null; } // 返回 return newSalary; } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskDaliyController.java
@@ -133,6 +133,14 @@ return new ResponseEntity<>(taskDaliyService.getDailyDetail(taskUserId, fillDate), HttpStatus.OK); } @GetMapping(value = "/getDailyTaskProgress") @Log("根据任务id查询距今最近的任务进度") @ApiOperation("根据任务id查询距今最近的任务进度") @PreAuthorize("@el.check('taskDaliy:list')") public ResponseEntity<Object> getDailyTaskProgress(String taskUserId) { return new ResponseEntity<>(taskDaliyService.getDailyTaskProgress(taskUserId), HttpStatus.OK); } @GetMapping(value = "/checkTask") @Log("查询任务的总消耗工时") @ApiOperation("判断当前这个日报填写的这个进度是否合法") eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskDaliyService.java
@@ -118,6 +118,8 @@ TaskDaliyMongo getDailyDetail(String taskUserId, String fillDate); TaskDaliyMongo getDailyTaskProgress(String taskUserId); boolean checkTask(Long taskProgress, String taskUserId, String fillDate); } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java
@@ -56,6 +56,8 @@ import me.zhengjie.utils.QueryHelp; import me.zhengjie.utils.SecurityUtils; import me.zhengjie.utils.ValidationUtil; import org.springframework.data.domain.Sort; import org.springframework.data.mongodb.core.query.Query; /** * @author 赵士淞 @@ -472,7 +474,8 @@ cal.setTime(dt); cal.add(Calendar.MONTH,1); Date nextMonth = cal.getTime(); daliyMongoList = mongoTemplate.find(Query.query(new Criteria("userId").is(criteria.getUserId()).and("fillDate").gte(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(criteria.getTargetYearMonth())).lte(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nextMonth)))), TaskDaliyMongo.class); // daliyMongoList = mongoTemplate.find(Query.query(new Criteria("userId").is(criteria.getUserId()).and("fillDate").gte(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(criteria.getTargetYearMonth())).lte(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nextMonth)))), TaskDaliyMongo.class); daliyMongoList = mongoTemplate.find(Query.query(new Criteria("userId").is(criteria.getUserId()).and("fillDate").gte(dt).lte(nextMonth)), TaskDaliyMongo.class); } catch (ParseException e) { throw new RuntimeException(e); } @@ -551,6 +554,25 @@ } @Override public TaskDaliyMongo getDailyTaskProgress(String taskUserId) { Criteria criteriaMongo = new Criteria(); criteriaMongo.and("taskUserMongo").is(taskUserId); criteriaMongo.and("userId").is(SecurityUtils.getCurrentUserId()); Query query = new Query(criteriaMongo); query.with(Sort.by(Sort.Direction.DESC, "fillDate")); // 排序 query.limit(1); // 只获取第一个结果 // 执行查询 List<TaskDaliyMongo> daliyMongoList = mongoTemplate.find(query, TaskDaliyMongo.class); if (daliyMongoList.size() == 0) { return null; } else { return daliyMongoList.get(0); } } @Override public boolean checkTask(Long taskProgress, String taskUserId, String fillDate) { try { //fillDate = fillDate.substring(0,22); eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/UserInsuranceServiceImpl.java
@@ -110,7 +110,8 @@ // 返回 return userInsuranceMapper.toDto(userInsurance); } else { throw new BadRequestException("没有获取到当前员工的级别信息!"); // throw new BadRequestException("没有获取到当前员工的级别信息!"); throw new RuntimeException("没有获取到当前员工的级别信息!"); } } eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/UserLevelWageServiceImpl.java
@@ -91,7 +91,8 @@ UserLevelWage userLevelWage = userLevelWageRepository.findByUserIdAndYearMonth(criteria.getUserId(), yearMonth); // 判断查询结果 if (userLevelWage == null) { throw new BadRequestException("没有获取到当前员工的级别信息!"); // throw new BadRequestException("没有获取到当前员工的级别信息!"); throw new RuntimeException("没有获取到当前员工的级别信息!"); } // 返回 return userLevelWageMapper.toDto(userLevelWage); eladmin-web-master/src/api/task/taskDaliy.js
@@ -16,6 +16,14 @@ }) } export function getDailyTaskProgress(params) { return request({ url: 'api/taskDaliy/getDailyTaskProgress', method: 'get', params }) } export function getTaskDaliyWithHours(params) { return request({ url: 'api/taskDaliy', @@ -88,4 +96,4 @@ }) } export default { get, getAll, add, edit, del, completedWork, complianceWork, taskTotalConsumedHours, getTaskDaliyWithHours, getDailyDetail, checkTaskHours } export default { get, getAll, add, edit, del, completedWork, complianceWork, taskTotalConsumedHours, getTaskDaliyWithHours, getDailyDetail, getDailyTaskProgress, checkTaskHours } eladmin-web-master/src/views/dashboard/PanelGroup.vue
@@ -55,10 +55,7 @@ </div> </el-col> <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col"> <el-tooltip class="item" effect="dark" placement="top" :open-delay="3000" style="cursor:pointer"> <div slot="content" class="slot-style"> <h4 style="cursor: pointer;" @click="changeVisible">详细绩效</h4> </div> <!-- <el-tooltip class="item" effect="dark" placement="top" :open-delay="3000" style="cursor:pointer"> --> <div class="card-panel"> <div class="card-panel-icon-wrapper icon-timings"> <svg-icon icon-class="timing" class-name="card-panel-icon" /> @@ -69,8 +66,9 @@ </div> <count-to :start-val="0" :end-val="userInfo.achievementsTime" :decimals="2" :duration="3600" class="card-panel-num" /> </div> <el-button type="success" style="position: absolute;bottom: 4%;right: 1%;width: 60px;height: 27px;display: flex;background-color: #40c9c6;border-color: #40c9c6;align-items: center;justify-content: center;" round @click="changeVisible">详细绩效</el-button> </div> </el-tooltip> <!-- </el-tooltip> --> </el-col> <el-dialog title="详细绩效" @@ -146,6 +144,15 @@ this.centerDialogVisible = true }, showPerformanceDetail() { if (this.meritWageList[2] == undefined) { setTimeout(() => { this.showPerformanceDetailo() }, 3500) } else { this.showPerformanceDetailo() } }, showPerformanceDetailo() { // 查看当前用户这个月参与和完成了那些任务?并且其中那些任务的任务工时是在任务的绩效时间中的,那些超出 crudUser.getPerformanceDetail(this.meritWageList[2]).then(res => { var dom = document.getElementById('container') eladmin-web-master/src/views/salary/newSalary/index.vue
@@ -424,8 +424,20 @@ placeholder="请选择" /> </el-form-item> <el-form-item label="所属员工" prop="userId"> <el-select v-model="generateForm.userId" filterable clearable placeholder="请选择" style="width: 370px;"> <el-form-item label="所属员工" prop="selectedValue1"> <el-cascader v-model="generateForm.selectedValue1" :filterable="true" :options="options" :props="props" clearable collapse-tags placeholder="请选择" :show-all-levels="false" style="width: 370px" @change="changeUserListTwo" /> <!-- <el-select v-model="generateForm.userId" filterable clearable placeholder="请选择" style="width: 370px;"> <el-option v-for="item in users" :key="item.id" @@ -433,7 +445,7 @@ :value="item.id" :disabled="!item.enabled" /> </el-select> </el-select> --> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> @@ -742,7 +754,7 @@ // 生成表单加载 generateLoading: false, // 生成表单数据 generateForm: { targetYearMonth: null, userId: null }, generateForm: { targetYearMonth: null, userId: null, selectedValue1: [] }, // 生成表单验证 generateRules: { targetYearMonth: [ @@ -813,7 +825,8 @@ afterTaxAmountRandom: 0, selectedValue: [], options: [], props: { multiple: true } props: { multiple: true }, selval: [] } }, methods: { @@ -1507,7 +1520,7 @@ // 生成表单状态 this.generateStatus = false // 生成表单数据 this.generateForm = { targetYearMonth: null, userId: null } this.generateForm = { targetYearMonth: null, userId: null, selectedValue1: [] } // 清空表单 this.$refs['generateForm'].clearValidate() }, @@ -1518,6 +1531,7 @@ // 表单验证 this.$refs['generateForm'].validate((valid) => { if (valid) { this.generateForm.selectedValue1 = this.selval // 生成工资 crudNewSalary.generate(this.generateForm).then(res => { // 生成表单加载 @@ -1531,6 +1545,10 @@ }).catch(() => { // 生成表单加载 this.generateLoading = false // 生成表单关闭 this.closeGenerate() // 搜索:刷新表格 this.crud.toQuery() }) } else { // 生成表单加载 @@ -1746,6 +1764,14 @@ tempList.push(temp[e[i].length - 1]) } this.query.userIds = tempList }, changeUserListTwo(e) { var tempList = [] for (let i = 0; i < e.length; i++) { var temp = e[i] tempList.push(temp[e[i].length - 1]) } this.selval = tempList } } } eladmin-web-master/src/views/task/taskDaliy/index.vue
@@ -121,7 +121,7 @@ end-placeholder="结束日期" style="width: 285px;" /> <el-select v-model="query.projectId" filterable clearable placeholder="所属项目" style="width: 185px;" class="filter-item" @change="queryProjectChange" @keyup.enter.native="crud.toQuery"> <el-select v-model="query.projectId" filterable clearable placeholder="所属项目" :loading="loadingProject" style="width: 185px;" class="filter-item" @change="queryProjectChange" @keyup.enter.native="crud.toQuery" @clear="clearQueryTasks"> <el-option v-for="item in queryProjects" :key="item.id" @@ -129,7 +129,7 @@ :value="item.id" /> </el-select> <el-select v-model="query.taskMongoId" filterable clearable placeholder="所属任务" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> <el-select v-model="query.taskMongoId" filterable clearable placeholder="所属任务" :loading="loadingTast" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> <el-option v-for="item in queryTasks" :key="item.id" @@ -150,56 +150,86 @@ </el-form-item> <el-form-item label="所属项目" prop="projectId"> <el-select v-if="queryProjects.length > 0" :key="form.projectId" v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formProjectChange"> <template v-if="loadingQueryProjectsOne" #prefix> <i class="el-icon-loading" /> </template> <template v-if="!loadingQueryProjectsOne"> <el-option v-for="item in queryProjects" :key="item.id" :label="item.name" :value="item.id" /> </template> </el-select> <el-select v-else v-model="form" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formProjectChange"> <el-select v-else v-model="form" filterable clearable :placeholder="loadingQueryProjectsOne ? '加载中' : '请选择'" style="width: 340px;" :disabled="form.flag" @change="formProjectChange"> <template v-if="loadingQueryProjectsOne" #prefix> <i class="el-icon-loading" /> </template> <template v-if="!loadingQueryProjectsOne"> <el-option v-for="item in queryProjects" :key="item.id" :label="item.name" :value="item.id" /> </template> </el-select> </el-form-item> <el-form-item label="所属任务" prop="taskId"> <el-select v-if="formTasks.length > 0" :key="form.taskId" v-model="form.taskId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formTaskChange"> <template v-if="loadingQueryProjects" #prefix> <i class="el-icon-loading" /> </template> <template v-if="!loadingQueryProjects"> <el-option v-for="item in formTasks" :key="item.id" :label="item.name" :value="item.id" /> </template> </el-select> <el-select v-else v-model="form" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange"> <el-select v-else v-model="form" filterable clearable :placeholder="loadingQueryProjects ? '加载中' : '请选择'" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange"> <template v-if="loadingQueryProjects" #prefix> <i class="el-icon-loading" /> </template> <template v-if="!loadingQueryProjects"> <el-option v-for="item in formTasks" :key="item.id" :label="item.name" :value="item.id" /> </template> </el-select> </el-form-item> <el-form-item label="分配任务" prop="taskUserMongo"> <el-select v-if="formTaskUserIds.length > 0" :key="form.taskUserMongo.id" v-model="form.taskUserMongo.id" :allow-create="true" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange"> <template v-if="loadingQueryProjectsTwo" #prefix> <i class="el-icon-loading" /> </template> <template v-if="!loadingQueryProjects"> <el-option v-for="item in formTaskUserIds" :key="item.id" :label="item.name" :value="item.id" /> </template> </el-select> <el-select v-else v-model="form" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange"> <el-select v-else v-model="form" filterable clearable :placeholder="loadingQueryProjectsTwo ? '加载中' : '请选择'" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange"> <template v-if="loadingQueryProjectsTwo" #prefix> <i class="el-icon-loading" /> </template> <template v-if="!loadingQueryProjectsTwo"> <el-option v-for="item in formTaskUserIds" :key="item.id" :label="item.name" :value="item.id" /> </template> </el-select> </el-form-item> <el-form-item label="填写日期" prop="fillDate"> @@ -441,7 +471,12 @@ resData: true, userIds: [], watchFlg: false, editVar: '' editVar: '', loadingProject: true, loadingTast: false, loadingQueryProjectsOne: false, loadingQueryProjects: false, loadingQueryProjectsTwo: false } }, computed: { @@ -561,6 +596,10 @@ }, // 钩子:新建 - 之前 [CRUD.HOOK.beforeToAdd]() { this.formTasks = [] this.formTaskUserIds = [] this.form.taskId = null this.form.taskUserMongo.id = null this.form.userId = this.user.id this.form.userNickName = this.user.nickName // 判断用户最大角色级别是否是角色级别:超级管理员或角色级别:总经理 @@ -589,15 +628,24 @@ [CRUD.HOOK.beforeToEdit]() { this.form.userId = this.user.id this.form.userNickName = this.user.nickName this.loadingQueryProjects = true this.loadingQueryProjectsTwo = true crudTask.getAllOfDaily({ projectId: this.form.projectId }).then(res => { // 检索任务列表 this.formTasks = res this.$nextTick().then(() => { this.loadingQueryProjects = false }) }) crudTaskUser.getAllTaskUser(this.form.taskUserMongo.id).then(res => { if (res === []) { this.formTaskUserIds = [] } this.formTaskUserIds = res this.$nextTick().then(() => { this.loadingQueryProjectsTwo = false }) for (let i = 0; i < this.formTaskUserIds.length; i++) { this.userIds.push(this.formTaskUserIds[i].id) @@ -732,12 +780,18 @@ }, // 获取检索项目 getQueryProject() { this.loadingProject = true this.queryProjects = [] this.loadingQueryProjectsOne = true // 获取项目 crudProject.getRelevantOfDaily().then(res => { // this.formProjects = res // 检索项目列表 this.queryProjects = res this.loadingProject = false this.$nextTick().then(() => { this.loadingQueryProjectsOne = false }) }) // 获取任务列表 @@ -748,6 +802,8 @@ }, // 检索项目变更 queryProjectChange() { this.queryTasks = [] this.loadingTast = true // 检索赋值 this.$set(this.query, 'taskId', null) // 判断检索项目是否为空 @@ -759,8 +815,12 @@ crudTask.getAllOfDaily({ projectId: this.query.projectId }).then(res => { // 检索任务列表 this.queryTasks = res this.loadingTast = false }) } }, clearQueryTasks() { this.loadingTast = false }, formDateChange() { crudTaskDaliy.getDailyDetail({ taskUserId: this.form.taskUserMongo.id, fillDate: this.form.fillDate }).then(res => { @@ -813,10 +873,19 @@ // 表单任务列表 this.formTasks = [] } else { this.loadingQueryProjects = true this.loadingQueryProjectsTwo = true this.formTasks = [] this.formTaskUserIds = [] this.form.taskId = null this.form.taskUserMongo.id = null // 获取任务 crudTask.getAllOfDaily({ projectId: this.form.projectId }).then(res => { // 检索任务列表 this.formTasks = res this.$nextTick().then(() => { this.loadingQueryProjects = false }) if (cb) { cb() } @@ -825,6 +894,9 @@ }, // 表单任务变更 formTaskChange(cb) { this.formTaskUserIds = [] this.form.taskUserMongo.id = null this.loadingQueryProjectsTwo = true // 循环表单任务列表 for (let i = 0; i < this.formTasks.length; i++) { // 判断是否为选中任务 @@ -837,6 +909,9 @@ this.userIds.push(res[i].id) } this.formTaskUserIds = res this.$nextTick().then(() => { this.loadingQueryProjectsTwo = false }) this.form.taskProgress = res.taskProgress this.form.consumedHours = res.consumedHours if (cb) { @@ -849,9 +924,10 @@ formTaskUserChange() { this.form.consumedHours = 0 this.form.fillDate = null this.form.taskProgress = 0 // this.form.taskProgress = 0 this.form.alreadyConsumedHours = 0 this.form.taskHours = 0 console.log('ddd:' + this.form.taskUserMongo.id) // 循环表单任务列表 for (let i = 0; i < this.formTaskUserIds.length; i++) { // 判断是否为选中任务 @@ -861,10 +937,23 @@ this.tempValue = this.formTaskUserIds[i].alreadyConsumedHours } } this.getTaskProgress(this.form.taskUserMongo.id) }, quickFilling(object) { this.currentTask = object this.crud.toAdd() this.getTaskProgress(object.id) }, getTaskProgress(id) { // 任务更改查询任务进度 crudTaskDaliy.getDailyTaskProgress({ taskUserId: id }).then(res => { if (res !== '') { this.form.taskProgress = res.taskProgress } else { this.form.taskProgress = 0 } }) }, submitDialogTaskHours() { this.centerDialogVisibleTaskHours = false eladmin-web-master/src/views/task/taskUser/index.vue
@@ -26,16 +26,17 @@ </div> <div v-if="!infinite" class="infinite-list" style="overflow:auto;height:500px"> <el-card v-for="task in taskDatas" :key="task.id" class="box-card" :class="{ 'active': task === selectedTask }" style="margin-bottom: 10px;cursor:pointer" shadow="hover"> <el-tooltip class="item" effect="dark" placement="top-start" :open-delay="1000" enterable> <div slot="content" class="slot-style"> <!-- <el-tooltip class="item" effect="dark" placement="top-start" :open-delay="1000" enterable> --> <!-- <div slot="content" class="slot-style"> <div @click="showTaskDetail(task)"> <h4 style="cursor: pointer;">查看详细</h4> </div> </div> </div> --> <div @click="handleNodeClick(task)"> {{ task.name }} <i class="el-icon-search" style="float: right;" @click="showTaskDetail(task)" /> </div> </el-tooltip> <!-- </el-tooltip> --> </el-card> </div> </el-card> @@ -748,6 +749,7 @@ this.dialogLoading_task = true }, showTaskDetail(e) { console.log(e.id) this.dialogVisible_task = true crudTaskUser.getTaskDetail(e.id).then(res => { for (let i = 0; i < res.length; i++) {