Merge branch 'master' of http://192.168.1.110:5678/r/pms-upgrade into weicd
| | |
| | | /** 任务合计 */ |
| | | private Double totalTaskTime; |
| | | |
| | | /** 任务合计(实际) */ |
| | | private Double actualTaskTime; |
| | | |
| | | /** 成本合计 */ |
| | | private BigDecimal totalLaborCost; |
| | | |
| | | /** 成本合计(实际) */ |
| | | private BigDecimal actualLaborCost; |
| | | |
| | | /** 责任人ID */ |
| | | private Long liableUserId; |
| | | |
| | |
| | | package me.zhengjie.modules.project.service.impl; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.math.BigDecimal; |
| | | import java.sql.Timestamp; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.Map.Entry; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import me.zhengjie.modules.project.service.ProjectCostService; |
| | | import me.zhengjie.modules.task.domain.TaskDailyInterface; |
| | | import me.zhengjie.modules.task.domain.TaskInterface; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private final ProjectCostRepository projectCostRepository; |
| | | private final TaskRepository taskRepository; |
| | | private final TaskDaliyRepository taskDaliyRepository; |
| | | private final ProjectCostService projectCostService; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(ProjectQueryCriteria criteria, Pageable pageable) { |
| | |
| | | // 负责人名称 |
| | | projectDto.setLiableUserName(user.getNickName()); |
| | | } |
| | | |
| | | ProjectTaskSummary projectTaskSummary = projectTaskRepository.findSummaryByProjectId(project.getId()); |
| | | projectDto.setTaskStartDate(projectTaskSummary.getTaskStartDate()); |
| | | projectDto.setTaskEndDate(projectTaskSummary.getTaskEndDate()); |
| | |
| | | ProjectCostSummary projectCostSummary = projectCostRepository.findSummaryByProjectId(project.getId()); |
| | | projectDto.setTotalLaborCost(projectCostSummary.getTotalLaborCost()); |
| | | |
| | | // 查询项目的任务数据 |
| | | TaskInterface taskInterface = taskRepository.collectByProjectId(project.getId()); |
| | | projectDto.setActualTaskTime(taskInterface.getPlanHours()); |
| | | |
| | | // 根据日期和项目ID取得日报信息 |
| | | List<TaskDailyInterface> taskDailyInterfaceList = taskDaliyRepository.collectByProjectIdGroupByUserIdAndFillDate(project.getId()); |
| | | Map<Long, List<TaskDailyInterface>> collectMap = taskDailyInterfaceList.stream().collect(Collectors.groupingBy(TaskDailyInterface::getUserId)); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | // 实际消耗成本 |
| | | BigDecimal actualCost = BigDecimal.valueOf(0.0); |
| | | for (Entry<Long, List<TaskDailyInterface>> entry : collectMap.entrySet()) { |
| | | List<TaskDailyInterface> taskDaliyListSub = entry.getValue(); |
| | | // 最小日期 |
| | | TaskDailyInterface taskDaliyFirst = taskDaliyListSub.stream().min(Comparator.comparing(taskDaliy -> taskDaliy.getFillDate())).get(); |
| | | // 最大日期 |
| | | TaskDailyInterface taskDaliyLast = taskDaliyListSub.stream().max(Comparator.comparing(taskDaliy -> taskDaliy.getFillDate())).get(); |
| | | Map<String, Double> costHourMap = new HashMap<String, Double>(); |
| | | taskDaliyListSub.forEach(taskDaliy -> { |
| | | costHourMap.put(sdf.format(taskDaliy.getFillDate()), taskDaliy.getConsumedHours()); |
| | | }); |
| | | // 根据员工成本单金算出当前工作的成本 |
| | | actualCost = actualCost.add(projectCostService.calcUserCostByDate(entry.getKey(), new Timestamp(taskDaliyFirst.getFillDate().getTime()), new Timestamp(taskDaliyLast.getFillDate().getTime()), costHourMap)); |
| | | } |
| | | // 实际消耗成本 |
| | | projectDto.setActualLaborCost(actualCost); |
| | | |
| | | // 返回处理好的Dto |
| | | return projectDto; |
| | | } |
| | |
| | | List<TaskDailyInterface> collectByProjectIdAndFillDateLessThanGroupByUserIdAndFillDate(Long projectId, Timestamp fillDate); |
| | | |
| | | /** |
| | | * 根据项目ID查询任务日报信息 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT user_id AS userId, fill_date AS fillDate, COALESCE(SUM(consumed_hours), 0) AS consumedHours FROM task_daliy WHERE project_id = ?1 GROUP BY user_id, fill_date", nativeQuery = true) |
| | | List<TaskDailyInterface> collectByProjectIdGroupByUserIdAndFillDate(Long projectId); |
| | | |
| | | /** |
| | | * 根据项目ID、任务ID查询 |
| | | * @param projectId |
| | | * @param taskId |
| | |
| | | public ResponseEntity<Object> queryCompletedWork(TaskDaliyQueryCriteria criteria){ |
| | | return new ResponseEntity<>(taskDaliyService.queryCompletedWork(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/taskTotalConsumedHours") |
| | | @Log("查询任务的总消耗工时") |
| | | @ApiOperation("查询任务的总消耗工时") |
| | | @PreAuthorize("@el.check('taskDaliy:list')") |
| | | public ResponseEntity<Object> queryTaskTotalConsumedHours(TaskDaliyQueryCriteria criteria){ |
| | | return new ResponseEntity<>(taskDaliyService.queryTaskTotalConsumedHours(criteria),HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | * @return List<TaskDaliyDto> |
| | | */ |
| | | Double queryCompletedWork(TaskDaliyQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 查询任务的总消耗工时 |
| | | * @param criteria 条件参数 |
| | | * @return List<TaskDaliyDto> |
| | | */ |
| | | Double queryTaskTotalConsumedHours(TaskDaliyQueryCriteria criteria); |
| | | } |
| | |
| | | import me.zhengjie.modules.system.service.RoleService; |
| | | import me.zhengjie.modules.system.service.dto.RoleSmallDto; |
| | | import me.zhengjie.modules.task.domain.Task; |
| | | import me.zhengjie.modules.task.domain.TaskDailyInterface; |
| | | import me.zhengjie.modules.task.domain.TaskDaliy; |
| | | import me.zhengjie.modules.task.domain.TaskUser; |
| | | import me.zhengjie.modules.task.repository.TaskRepository; |
| | |
| | | // 日历类 |
| | | return cal; |
| | | } |
| | | |
| | | @Override |
| | | public Double queryTaskTotalConsumedHours(TaskDaliyQueryCriteria criteria) { |
| | | // 根据项目ID、任务ID、用户ID查询总消耗工时、总消耗工作量、最大任务进度 |
| | | TaskDailyInterface taskDailyInterface = taskDaliyRepository.findSumConsumedHoursAndSumConsumedWorkloadAndMaxTaskProgressByProjectIdAndTaskIdAndUserId(criteria.getProjectId(), criteria.getTaskId(), criteria.getUserId()); |
| | | // 返回 |
| | | return taskDailyInterface.getConsumedHours(); |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, completedWork, complianceWork } |
| | | export function taskTotalConsumedHours(params) { |
| | | return request({ |
| | | url: 'api/taskDaliy/taskTotalConsumedHours', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, completedWork, complianceWork, taskTotalConsumedHours } |
| | |
| | | return form.rosteringWorkEndTime ? time.getTime() > new Date(form.rosteringWorkEndTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="09:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="实际工作开始时间" prop="actualWorkStartTime"> |
| | |
| | | return form.actualWorkEndTime ? time.getTime() > new Date(form.actualWorkEndTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="09:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="开始位置结果" prop="startLocationResults"> |
| | |
| | | return form.rosteringWorkStartTime ? time.getTime() < new Date(form.rosteringWorkStartTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="18:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="实际工作结束时间" prop="actualWorkEndTime"> |
| | |
| | | return form.actualWorkStartTime ? time.getTime() < new Date(form.actualWorkStartTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="18:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="结束位置结果" prop="endLocationResults"> |
| | |
| | | return goOutForm.outEndTime ? time.getTime() > new Date(goOutForm.outEndTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="09:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" |
| | | @change="checkTime('goOut')" |
| | | /> |
| | | </el-form-item> |
| | |
| | | return goOutForm.outStartTime ? time.getTime() < new Date(goOutForm.outStartTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="18:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" |
| | | @change="checkTime('goOut')" |
| | | /> |
| | | </el-form-item> |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="补卡区分" prop="cardReplacementDistinguish"> |
| | | <el-select v-model="form.cardReplacementDistinguish" style="width: 370px;" :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse"> |
| | | <el-option |
| | | v-for="item in dict[dictCardReplacement]" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="补卡时间" prop="cardReplacementTime"> |
| | | <el-date-picker |
| | | :key="form.cardReplacementDistinguish" |
| | | v-model="form.cardReplacementTime" |
| | | type="datetime" |
| | | placeholder="选择日期时间" |
| | | style="width: 370px;" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | align="right" |
| | | default-time="09:00:00" |
| | | :default-time="form.cardReplacementDistinguish === 'card_replacement_differentiation_goOn' ? $store.state.user.user.sysRostering.workStartTime + ':00' : $store.state.user.user.sysRostering.workEndTime + ':00'" |
| | | :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse" |
| | | /> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="审批说明"> |
| | | <el-input v-model="form.approvalDescription" type="textarea" rows="3" style="width: 370px;" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="补卡区分" prop="cardReplacementDistinguish"> |
| | | <el-select v-model="form.cardReplacementDistinguish" style="width: 370px;" :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse"> |
| | | <el-option |
| | | v-for="item in dict[dictCardReplacement]" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" :disabled="form.approvalStatus == dictCardApproveStatusAgree || form.approvalStatus == dictCardApproveStatusRefuse" /> |
| | |
| | | 'user' |
| | | ]) |
| | | }, |
| | | watch: { |
| | | 'form.cardReplacementDistinguish'(value) { |
| | | if (this.form.cardReplacementTime) { |
| | | let time = null |
| | | if (value === 'card_replacement_differentiation_goOn') { |
| | | time = this.$store.state.user.user.sysRostering.workStartTime.split(':') |
| | | } else { |
| | | time = this.$store.state.user.user.sysRostering.workEndTime.split(':') |
| | | } |
| | | const date = new Date(this.form.cardReplacementTime).setHours(time[0], time[1], 0) |
| | | this.form.cardReplacementTime = new Date(date) |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | |
| | | return form.outEndTime ? time.getTime() > new Date(form.outEndTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="09:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" |
| | | :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" |
| | | @change="checkTime" |
| | | /> |
| | |
| | | return form.outStartTime ? time.getTime() < new Date(form.outStartTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="18:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" |
| | | :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn" |
| | | @change="checkTime" |
| | | /> |
| | |
| | | return form.leaveEndTime ? time.getTime() > new Date(form.leaveEndTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="09:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" |
| | | :disabled="form.approvalStatus == dictAppRovalStatusPassed || form.approvalStatus == dictAppRovalStatusReturn" |
| | | @change="checkLeaveTime" |
| | | /> |
| | |
| | | return form.leaveStartTime ? time.getTime() < new Date(form.leaveStartTime).getTime() - 8.64e7 : false; |
| | | } |
| | | }" |
| | | default-time="18:00:00" |
| | | :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" |
| | | :disabled="form.approvalStatus == dictAppRovalStatusPassed || form.approvalStatus == dictAppRovalStatusReturn" |
| | | @change="checkLeaveTime" |
| | | /> |
| | |
| | | {{ scope.row.contractPrice != null && scope.row.contractPrice != '' ? crud.toMoney(scope.row.contractPrice) : '' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="totalTaskTime" label="任务总工时" width="100" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="totalTaskTime" label="计划任务总工时" width="110" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="actualTaskTime" label="实际任务总工时" width="110" /> |
| | | <el-table-column v-if="checkPer([permission.master])" label="报价"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="quotationPrice" label="单金" width="100"> |
| | | <template slot-scope="scope"> |
| | |
| | | <el-tag>{{ dict.label[standardUnitCurrency][scope.row.unitCurrency] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" label="总金额" width="100"> |
| | | <el-table-column :show-overflow-tooltip="true" label="计划总金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.quotationPrice * scope.row.totalTaskTime / 160) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" label="实际总金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.quotationPrice * scope.row.actualTaskTime / 160) }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> |
| | |
| | | <el-table-column :show-overflow-tooltip="true" label="币种" width="100"> |
| | | <el-tag>{{ dict.label[standardUnitCurrency][standardUnitCurrencyRenminbi] }}</el-tag> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" label="总金额" width="100"> |
| | | <el-table-column :show-overflow-tooltip="true" label="计划总金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.performancePrice * scope.row.totalTaskTime / 160) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" label="实际总金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.performancePrice * scope.row.actualTaskTime / 160) }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> |
| | |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="totalLaborCost" label="项目总成本" width="100"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="totalLaborCost" label="计划项目总成本" width="110"> |
| | | <template slot-scope="scope"> |
| | | <span :style="{ color: scope.row.performancePrice * scope.row.totalTaskTime < scope.row.totalLaborCost ? 'red' : '' }"> |
| | | {{ crud.toMoney(scope.row.totalLaborCost) }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="actualLaborCost" label="实际项目总成本" width="110"> |
| | | <template slot-scope="scope"> |
| | | <span :style="{ color: scope.row.performancePrice * scope.row.actualTaskTime < scope.row.actualLaborCost ? 'red' : '' }"> |
| | | {{ crud.toMoney(scope.row.actualLaborCost) }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="liableUserName" label="责任人" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag v-if="scope.row.liableUserName != null && scope.row.liableUserName != ''"> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="进入项目时间" prop="enterProjectTime"> |
| | | <el-date-picker v-model="form.enterProjectTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" default-time="09:00:00" :picker-options="pickerOptionsStart" style="width: 340px;" :disabled="disabledFlagByApprove" @change="getProjectCost" /> |
| | | <el-date-picker v-model="form.enterProjectTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" :picker-options="pickerOptionsStart" style="width: 340px;" :disabled="disabledFlagByApprove" @change="getProjectCost" /> |
| | | </el-form-item> |
| | | <el-form-item label="退出项目时间" prop="exitProjectTime"> |
| | | <el-date-picker v-model="form.exitProjectTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" default-time="18:00:00" :picker-options="pickerOptionsEnd" style="width: 340px;" :disabled="disabledFlagByApprove" @change="getProjectCost" /> |
| | | <el-date-picker v-model="form.exitProjectTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" :picker-options="pickerOptionsEnd" style="width: 340px;" :disabled="disabledFlagByApprove" @change="getProjectCost" /> |
| | | </el-form-item> |
| | | <el-form-item label="项目成本" prop="projectCost"> |
| | | <money-input :key="random" v-model="form.projectCost" :width="340" :disabled="disabledFlagByApprove" /> |
| | |
| | | <el-input v-model="form.description" :rows="3" type="textarea" style="width: 340px;" :disabled="disabledFlagByApprove" /> |
| | | </el-form-item> |
| | | <el-form-item label="计划开始时间"> |
| | | <el-date-picker v-model="form.planStartTime" type="datetime" :picker-options="pickerOptionsStart" style="width: 340px;" :disabled="disabledFlagByApprove" /> |
| | | <el-date-picker v-model="form.planStartTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" :picker-options="pickerOptionsStart" style="width: 340px;" :disabled="disabledFlagByApprove" /> |
| | | </el-form-item> |
| | | <el-form-item label="计划结束时间"> |
| | | <el-date-picker v-model="form.planEndTime" type="datetime" :picker-options="pickerOptionsEnd" style="width: 340px;" :disabled="disabledFlagByApprove" /> |
| | | <el-date-picker v-model="form.planEndTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" :picker-options="pickerOptionsEnd" style="width: 340px;" :disabled="disabledFlagByApprove" /> |
| | | </el-form-item> |
| | | <el-form-item label="计划工时" prop="planHours"> |
| | | <el-input v-model="form.planHours" style="width: 340px;" :disabled="disabledFlagByApprove" /> |
| | |
| | | <el-input v-model="form.description" :rows="3" type="textarea" style="width: 340px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="计划开始时间"> |
| | | <el-date-picker v-model="form.planStartTime" type="datetime" :picker-options="planStartTimePickerOptions" style="width: 340px;" /> |
| | | <el-date-picker v-model="form.planStartTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" :picker-options="planStartTimePickerOptions" style="width: 340px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="计划结束时间"> |
| | | <el-date-picker v-model="form.planEndTime" type="datetime" :picker-options="planEndTimePickerOptions" style="width: 340px;" /> |
| | | <el-date-picker v-model="form.planEndTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" :picker-options="planEndTimePickerOptions" style="width: 340px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="计划工时" prop="planHours"> |
| | | <el-input v-model="form.planHours" style="width: 340px;"> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="任务开始时间" prop="taskStartDate"> |
| | | <el-date-picker v-model="divideForm.taskStartDate" type="datetime" :picker-options="taskStartDatePickerOptions" style="width: 340px;" /> |
| | | <el-date-picker v-model="divideForm.taskStartDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" :picker-options="taskStartDatePickerOptions" style="width: 340px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="任务结束时间" prop="taskEndDate"> |
| | | <el-date-picker v-model="divideForm.taskEndDate" type="datetime" :picker-options="taskEndDatePickerOptions" style="width: 340px;" /> |
| | | <el-date-picker v-model="divideForm.taskEndDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" :picker-options="taskEndDatePickerOptions" style="width: 340px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="任务工时" prop="taskHours"> |
| | | <el-input v-model="divideForm.taskHours" style="width: 340px;"> |
| | |
| | | this.divideForm.divideUserIds = data.divideUserIds |
| | | this.divideForm.taskWorkloadUnit = data.planWorkloadUnit |
| | | this.divideForm.taskStatus = constant.TASK_STATUS_NOT_STARTED |
| | | // 获取任务的计划开始时间结束时间 |
| | | if (data.planStartTime) { |
| | | this.divideForm.taskStartDate = data.planStartTime |
| | | } |
| | | if (data.planEndTime) { |
| | | this.divideForm.taskEndDate = data.planEndTime |
| | | } |
| | | // 分配表单状态 |
| | | this.divideStatus = true |
| | | }, |
| | |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | 已消耗工时:{{ form.alreadyConsumedHours }} / 任务工时:{{ form.taskHours }} |
| | | </el-form-item> |
| | | <el-form-item label="消耗工作量" prop="consumedWorkload"> |
| | | <el-input v-model="form.consumedWorkload" style="width: 340px;" :disabled="disabledFlagBySettlement" /> |
| | | </el-form-item> |
| | | <el-form-item label="消耗工作量单位" prop="consumedWorkloadUnit"> |
| | | <el-form-item label="消耗工作量单位"> |
| | | {{ dict.label[standardWorkloadUnit][form.consumedWorkloadUnit] }} |
| | | </el-form-item> |
| | | <el-form-item label="任务进度" prop="taskProgress"> |
| | |
| | | import crudUser from '@/api/system/user' |
| | | import crudProject from '@/api/project/project' |
| | | import crudTask from '@/api/task/task' |
| | | import crudTaskUser from '@/api/task/taskUser' |
| | | |
| | | const defaultForm = { id: null, projectId: null, taskId: null, userId: null, fillDate: null, consumedHours: null, consumedWorkload: null, taskProgress: null, settlementStatus: constant.SETTLEMENT_STATUS_UNSETTLED, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | const defaultForm = { id: null, projectId: null, taskId: null, userId: null, fillDate: null, consumedHours: null, alreadyConsumedHours: 0, taskHours: 0, consumedWorkload: null, consumedWorkloadUnit: null, taskProgress: null, settlementStatus: constant.SETTLEMENT_STATUS_UNSETTLED, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'TaskDaliy', |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | | [CRUD.HOOK.beforeToAdd]() { |
| | | // 表单赋值 |
| | | this.form.consumedWorkloadUnit = null |
| | | // 判断用户最大角色级别是否是角色级别:超级管理员或角色级别:总经理 |
| | | if (this.userRolesLevelMin !== this.roleLevelSuper && this.userRolesLevelMin !== this.roleLevelGeneral) { |
| | | // 表单赋值 |
| | |
| | | if (this.formTasks[i].id === this.form.taskId) { |
| | | // 表单赋值 |
| | | this.form.consumedWorkloadUnit = this.formTasks[i].planWorkloadUnit |
| | | return |
| | | break |
| | | } |
| | | // 判断循环是否结束 |
| | | if (i === this.formTasks.length - 1) { |
| | |
| | | this.form.consumedWorkloadUnit = null |
| | | } |
| | | } |
| | | // 查询任务的总消耗工时 |
| | | crudTaskDaliy.taskTotalConsumedHours({ userId: this.form.userId, projectId: this.form.projectId, taskId: this.form.taskId }).then(res => { |
| | | // 表单赋值 |
| | | this.form.alreadyConsumedHours = res |
| | | }) |
| | | // 查询任务分配 |
| | | crudTaskUser.getAll({ userId: this.form.userId, projectId: this.form.projectId, taskId: this.form.taskId }).then(res => { |
| | | // 表单赋值 |
| | | this.form.taskHours = res[0].taskHours |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="任务开始时间" prop="taskStartDate"> |
| | | <el-date-picker v-model="form.taskStartDate" type="datetime" :picker-options="taskStartDatePickerOptions" style="width: 340px;" :disabled="userRolesLevelMin == roleLevelOrdinary" /> |
| | | <el-date-picker v-model="form.taskStartDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'" :picker-options="taskStartDatePickerOptions" style="width: 340px;" :disabled="userRolesLevelMin == roleLevelOrdinary" /> |
| | | </el-form-item> |
| | | <el-form-item label="任务结束时间" prop="taskEndDate"> |
| | | <el-date-picker v-model="form.taskEndDate" type="datetime" :picker-options="taskEndDatePickerOptions" style="width: 340px;" :disabled="userRolesLevelMin == roleLevelOrdinary" /> |
| | | <el-date-picker v-model="form.taskEndDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'" :picker-options="taskEndDatePickerOptions" style="width: 340px;" :disabled="userRolesLevelMin == roleLevelOrdinary" /> |
| | | </el-form-item> |
| | | <el-form-item label="任务工时" prop="taskHours"> |
| | | <el-input v-model="form.taskHours" style="width: 340px;" :disabled="userRolesLevelMin == roleLevelOrdinary"> |