提交代码

dev_xd
姜玉琦 2025-04-27 01:52:21 +08:00
parent f7213542c0
commit 3604154c1c
26 changed files with 1418 additions and 59 deletions

View File

@ -18,7 +18,7 @@ public class ProPlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
/** 主键 */
private Long id;
/** 公司ID */
@ -120,8 +120,12 @@ public class ProPlan extends BaseEntity
}
private String projectName;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
/** 进度节点 */
private String scheduleNode;
/** 是否有效 */
@Excel(name = "是否有效")
private Long isDel;
public void setId(Long id)
@ -304,7 +308,16 @@ public class ProPlan extends BaseEntity
{
return groupName;
}
public void setIsDel(Long isDel)
public String getScheduleNode() {
return scheduleNode;
}
public void setScheduleNode(String scheduleNode) {
this.scheduleNode = scheduleNode;
}
public void setIsDel(Long isDel)
{
this.isDel = isDel;
}
@ -337,6 +350,7 @@ public class ProPlan extends BaseEntity
.append("operatorId", getOperatorId())
.append("groupId", getGroupId())
.append("groupName", getGroupName())
.append("scheduleNode", getScheduleNode())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())

View File

@ -21,14 +21,24 @@ public class ProPlanSchedule extends BaseEntity
/** 主键 */
private Long id;
/** 主键 */
private Long maxId;
/** 公司主键 */
@Excel(name = "公司主键")
private Long comId;
/** 公司名称 */
@Excel(name = "公司名称")
private String comName;
/** 项目主键 */
@Excel(name = "项目主键")
private Long projectId;
/** 项目名称 */
@Excel(name = "项目名称")
private String projectName;
/** 计划主键 */
@Excel(name = "计划主键")
private Long planId;
@ -53,6 +63,20 @@ public class ProPlanSchedule extends BaseEntity
@Excel(name = "进度百分比")
private Long schedulePercent;
/** 任务工期 */
@Excel(name = "任务工期")
private Double taskDuation;
/** 计划开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planStartDate;
/** 计划结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planFinishDate;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
@ -93,7 +117,16 @@ public class ProPlanSchedule extends BaseEntity
{
return id;
}
public void setComId(Long comId)
public Long getMaxId() {
return maxId;
}
public void setMaxId(Long maxId) {
this.maxId = maxId;
}
public void setComId(Long comId)
{
this.comId = comId;
}
@ -156,6 +189,31 @@ public class ProPlanSchedule extends BaseEntity
{
return bimId;
}
public Double getTaskDuation() {
return taskDuation;
}
public void setTaskDuation(Double taskDuation) {
this.taskDuation = taskDuation;
}
public Date getPlanStartDate() {
return planStartDate;
}
public void setPlanStartDate(Date planStartDate) {
this.planStartDate = planStartDate;
}
public Date getPlanFinishDate() {
return planFinishDate;
}
public void setPlanFinishDate(Date planFinishDate) {
this.planFinishDate = planFinishDate;
}
public void setSchedulePercent(Long schedulePercent)
{
this.schedulePercent = schedulePercent;
@ -229,6 +287,22 @@ public class ProPlanSchedule extends BaseEntity
return updateDate;
}
public String getComName() {
return comName;
}
public void setComName(String comName) {
this.comName = comName;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -2,6 +2,7 @@ package com.yanzhu.manage.mapper;
import java.util.List;
import com.yanzhu.manage.domain.ProPlan;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -19,6 +20,15 @@ public interface ProPlanMapper
*/
public ProPlan selectProPlanById(Long id);
/**
*
*
* @param proId
* @param taskId
* @return
*/
public ProPlan selectProPlanByParams(@Param("proId") Long proId, @Param("taskId") Long taskId);
/**
*
*
@ -27,6 +37,32 @@ public interface ProPlanMapper
*/
public List<ProPlan> selectProPlanList(ProPlan proPlan);
/**
*
*
* @param proPlan
* @return
*/
public List<ProPlan> selectProPlanListView(ProPlan proPlan);
/**
*
*
* @param proId
* @param taskId
* @return
*/
public List<ProPlan> selectProPlanBrothers(@Param("proId") Long proId, @Param("taskId") Long taskId);
/**
*
*
* @param proId
* @param taskId
* @return
*/
public List<ProPlan> selectProPlanBelows(@Param("proId") Long proId, @Param("taskId") Long taskId);
/**
*
*
@ -43,6 +79,22 @@ public interface ProPlanMapper
*/
public int updateProPlan(ProPlan proPlan);
/**
*
*
* @param proPlan
* @return
*/
public int updateProPlanStartDate(ProPlan proPlan);
/**
*
*
* @param proPlan
* @return
*/
public int updateProPlanFinishDate(ProPlan proPlan);
/**
*
*
@ -58,4 +110,10 @@ public interface ProPlanMapper
* @return
*/
public int deleteProPlanByIds(Long[] ids);
/**
*
* @return
*/
public ProPlan findOnlyPlan(ProPlan proPlan);
}

View File

@ -58,4 +58,11 @@ public interface ProPlanScheduleMapper
* @return
*/
public int deleteProPlanScheduleByIds(Long[] ids);
/**
*
* @param taskId
* @return
*/
public ProPlanSchedule findPreviousScheduleByTaskId(Long taskId);
}

View File

@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="operatorId" column="operator_id" />
<result property="groupId" column="group_id" />
<result property="groupName" column="group_name" />
<result property="scheduleNode" column="schedule_node" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@ -39,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select pp.id, pp.comid, pp.project_id, pp.task_id, pp.task_unique_id, pp.parent_id, pp.task_type,
pp.task_outline_level, pp.task_name, pp.task_duation, pp.start_date, pp.finish_date,
pp.predecessors, pp.plan_start_date, pp.plan_finish_date, pp.bim_id, pp.operator, pp.operator_id,
pp.group_id, pp.group_name, pp.is_del, pp.create_by, pp.create_time, pp.update_by, pp.update_time, pp.remark,
pp.group_id, pp.group_name, pp.schedule_node, pp.is_del, pp.create_by, pp.create_time, pp.update_by, pp.update_time, pp.remark,
dp.`dept_name` comp_name,pi.`project_name`
from pro_plan pp
LEFT JOIN sys_dept dp ON pp.`comid`=dp.`dept_id`
@ -71,12 +72,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null "> and pp.is_del = #{isDel}</if>
</where>
</select>
<select id="selectProPlanListView" parameterType="ProPlan" resultMap="ProPlanResult">
<include refid="selectProPlanVo"/>
<where>
<if test="comid != null "> and pp.comid = #{comid}</if>
<if test="projectId != null "> and pp.project_id = #{projectId}</if>
<if test="taskId != null "> and pp.task_id = #{taskId}</if>
<if test="taskUniqueId != null "> and pp.task_unique_id = #{taskUniqueId}</if>
<if test="parentId != null "> and pp.parent_id = #{parentId}</if>
<if test="taskType != null and taskType != ''"> and pp.task_type = #{taskType}</if>
<if test="taskOutlineLevel != null "> and pp.task_outline_level = #{taskOutlineLevel}</if>
<if test="taskName != null and taskName != ''"> and pp.task_name like concat('%', #{taskName}, '%')</if>
<if test="taskDuation != null "> and pp.task_duation = #{taskDuation}</if>
<if test="startDate != null "> and pp.start_date = #{startDate}</if>
<if test="finishDate != null "> and pp.finish_date = #{finishDate}</if>
<if test="predecessors != null and predecessors != ''"> and pp.predecessors = #{predecessors}</if>
<if test="planStartDate != null "> and pp.plan_start_date = #{planStartDate}</if>
<if test="planFinishDate != null "> and pp.plan_finish_date = #{planFinishDate}</if>
<if test="bimId != null and bimId != ''"> and pp.bim_id = #{bimId}</if>
<if test="operator != null and operator != ''"> and pp.operator = #{operator}</if>
<if test="operatorId != null "> and pp.operator_id = #{operatorId}</if>
<if test="groupId != null "> and pp.group_id = #{groupId}</if>
<if test="groupName != null and groupName != ''"> and pp.group_name like concat('%', #{groupName}, '%')</if>
<if test="isDel != null "> and pp.is_del = #{isDel}</if>
</where>
</select>
<select id="selectProPlanById" parameterType="Long" resultMap="ProPlanResult">
<include refid="selectProPlanVo"/>
where pp.id = #{id}
</select>
<select id="selectProPlanByParams" resultMap="ProPlanResult">
<include refid="selectProPlanVo"/>
where pp.project_id = #{proId} and pp.task_id = #{taskId}
</select>
<select id="selectProPlanBrothers" resultMap="ProPlanResult">
<include refid="selectProPlanVo"/>
where pp.project_id = #{proId} and pp.parent_id = #{taskId} and finish_date is null
</select>
<select id="selectProPlanBelows" resultMap="ProPlanResult">
<include refid="selectProPlanVo"/>
where pp.project_id = #{proId} and pp.parent_id = #{taskId}
</select>
<insert id="insertProPlan" parameterType="ProPlan" useGeneratedKeys="true" keyProperty="id">
insert into pro_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -99,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operatorId != null">operator_id,</if>
<if test="groupId != null">group_id,</if>
<if test="groupName != null">group_name,</if>
<if test="scheduleNode != null">schedule_node,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -126,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operatorId != null">#{operatorId},</if>
<if test="groupId != null">#{groupId},</if>
<if test="groupName != null">#{groupName},</if>
<if test="scheduleNode != null">#{scheduleNode},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -157,6 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="operatorId != null">operator_id = #{operatorId},</if>
<if test="groupId != null">group_id = #{groupId},</if>
<if test="groupName != null">group_name = #{groupName},</if>
<if test="scheduleNode != null">schedule_node = #{scheduleNode},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@ -167,6 +212,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<update id="updateProPlanStartDate" parameterType="ProPlan">
update pro_plan set start_date = #{startDate}
<if test="scheduleNode != null">,schedule_node = #{scheduleNode}</if>
where id = #{id}
</update>
<update id="updateProPlanFinishDate" parameterType="ProPlan">
update pro_plan set finish_date = #{finishDate}
<if test="scheduleNode != null">,schedule_node = #{scheduleNode}</if>
where id = #{id}
</update>
<delete id="deleteProPlanById" parameterType="Long">
delete from pro_plan where id = #{id}
</delete>
@ -177,4 +234,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="findOnlyPlan" parameterType="ProPlan" resultMap="ProPlanResult">
select id, comid, project_id, task_id, task_unique_id, parent_id, task_type,
task_outline_level,
<if test="taskName != null and taskName != ''"> concat(#{taskName}, ' / ', task_name) as task_name,</if>
<if test="taskName == null or taskName == ''"> task_name,</if>
task_duation, start_date, finish_date,
predecessors, plan_start_date, plan_finish_date, bim_id, operator, operator_id,
group_id, group_name, schedule_node, is_del from pro_plan
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="taskId != null "> and parent_id = #{taskId}</if>
and is_del = 0 and task_outline_level <![CDATA[ > ]]> 1 and finish_date is null
</where>
order by id limit 1
</select>
</mapper>

View File

@ -6,14 +6,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="ProPlanSchedule" id="ProPlanScheduleResult">
<result property="id" column="id" />
<result property="maxId" column="max_id" />
<result property="comId" column="com_id" />
<result property="comName" column="com_name" />
<result property="projectId" column="project_id" />
<result property="projectName" column="project_name" />
<result property="planId" column="plan_id" />
<result property="taskId" column="task_id" />
<result property="taskUniqueId" column="task_unique_id" />
<result property="taskName" column="task_name" />
<result property="bimId" column="bim_id" />
<result property="schedulePercent" column="schedule_percent" />
<result property="taskDuation" column="task_duation" />
<result property="planStartDate" column="plan_start_date" />
<result property="planFinishDate" column="plan_finish_date" />
<result property="finishDate" column="finish_date" />
<result property="description" column="description" />
<result property="images" column="images" />
@ -26,27 +32,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectProPlanScheduleVo">
select id, com_id, project_id, plan_id, task_id, task_unique_id, task_name, bim_id, schedule_percent, finish_date, description, images, is_del, create_by, create_user_id, create_date, update_by, update_date from pro_plan_schedule
select pps.id, (select max(mp.id) from pro_plan_schedule mp where mp.project_id = pps.project_id and mp.is_del=0) as max_id, pps.com_id, sd.dept_name as com_name, pps.project_id, pi.project_name, pps.plan_id, pps.task_id, pps.task_unique_id, pps.task_name, pps.bim_id, pps.schedule_percent, pp.task_duation, pp.plan_start_date, pp.plan_finish_date, pps.finish_date, pps.description, pps.images, pps.is_del, pps.create_by, pps.create_user_id, pps.create_date, pps.update_by, pps.update_date
from pro_plan_schedule pps
left join pro_project_info pi on pi.id = pps.project_id
left join sys_dept sd on sd.dept_id = pps.com_id
left join pro_plan pp on pp.id = pps.plan_id
</sql>
<select id="selectProPlanScheduleList" parameterType="ProPlanSchedule" resultMap="ProPlanScheduleResult">
<include refid="selectProPlanScheduleVo"/>
<where>
<if test="comId != null "> and com_id = #{comId}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="taskUniqueId != null and taskUniqueId != ''"> and task_unique_id = #{taskUniqueId}</if>
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
<if test="bimId != null and bimId != ''"> and bim_id = #{bimId}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
<if test="comId != null "> and pps.com_id = #{comId}</if>
<if test="projectId != null "> and pps.project_id = #{projectId}</if>
<if test="activeComId != null "> and pps.com_id = #{activeComId}</if>
<if test="activeProjectId != null "> and pps.project_id = #{activeProjectId}</if>
<if test="projectName != null and projectName != ''"> and pi.project_name like concat('%', #{projectName}, '%')</if>
<if test="planId != null "> and pps.plan_id = #{planId}</if>
<if test="taskId != null "> and pps.task_id = #{taskId}</if>
<if test="taskUniqueId != null and taskUniqueId != ''"> and pps.task_unique_id = #{taskUniqueId}</if>
<if test="taskName != null and taskName != ''"> and pps.task_name like concat('%', #{taskName}, '%')</if>
<if test="bimId != null and bimId != ''"> and pps.bim_id = #{bimId}</if>
<if test="isDel != null "> and pps.is_del = #{isDel}</if>
<if test="createUserId != null "> and pps.create_user_id = #{createUserId}</if>
and pps.is_del != 2
</where>
order by pps.id desc
</select>
<select id="selectProPlanScheduleById" parameterType="Long" resultMap="ProPlanScheduleResult">
<include refid="selectProPlanScheduleVo"/>
where id = #{id}
where pps.id = #{id}
</select>
<insert id="insertProPlanSchedule" parameterType="ProPlanSchedule" useGeneratedKeys="true" keyProperty="id">
@ -115,14 +130,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteProPlanScheduleById" parameterType="Long">
delete from pro_plan_schedule where id = #{id}
</delete>
<update id="deleteProPlanScheduleById" parameterType="Long">
update pro_plan_schedule set is_del = 2 where id = #{id}
</update>
<delete id="deleteProPlanScheduleByIds" parameterType="String">
delete from pro_plan_schedule where id in
<update id="deleteProPlanScheduleByIds" parameterType="String">
update pro_plan_schedule set is_del = 2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</update>
<select id="findPreviousScheduleByTaskId" parameterType="Long" resultMap="ProPlanScheduleResult">
<include refid="selectProPlanScheduleVo"/>
where pps.plan_id = #{taskId} and pps.is_del = 0 order by pps.id desc limit 1
</select>
</mapper>

View File

@ -39,11 +39,20 @@ public class ProPlanController extends BaseController
*/
@RequiresPermissions("manage:plan:list")
@GetMapping("/list")
public TableDataInfo list(ProPlan proPlan)
public AjaxResult list(ProPlan proPlan)
{
startPage();
List<ProPlan> list = proPlanService.selectProPlanList(proPlan);
return getDataTable(list);
return success(list);
}
/**
*
*/
@GetMapping("/listView")
public AjaxResult listView(ProPlan proPlan)
{
List<ProPlan> list = proPlanService.selectProPlanListView(proPlan);
return success(list);
}
/**
@ -123,8 +132,8 @@ public class ProPlanController extends BaseController
plan.setTaskUniqueId(task.getGuid());
plan.setParentId(task.getParentTask().getId()*1l);
plan.setTaskDuation(task.getDuration().toDouble());
plan.setStartDate(task.getStart());
plan.setFinishDate(task.getFinish());
plan.setPlanStartDate(task.getStart());
plan.setPlanFinishDate(task.getFinish());
TaskCollection task_predecessors = task.getPredecessors();
//4. 获取前置任务(任务流)
StringBuilder beforeTaskId = new StringBuilder();
@ -194,4 +203,16 @@ public class ProPlanController extends BaseController
{
return toAjax(proPlanService.deleteProPlanByIds(ids));
}
/**
*
*/
@GetMapping(value = "/findOnlyPlan/{proId}")
public AjaxResult findOnlyPlan(@PathVariable("proId") Long proId)
{
ProPlan planQuery = new ProPlan();
planQuery.setProjectId(proId);
ProPlan proPlan = proPlanService.findOnlyPlan(planQuery);
return success(proPlan);
}
}

View File

@ -95,4 +95,13 @@ public class ProPlanScheduleController extends BaseController
{
return toAjax(proPlanScheduleService.deleteProPlanScheduleByIds(ids));
}
/**
*
*/
@GetMapping(value = "/findPreviousSchedule/{taskId}")
public AjaxResult findPreviousSchedule(@PathVariable("taskId") Long taskId)
{
return success(proPlanScheduleService.findPreviousScheduleByTaskId(taskId));
}
}

View File

@ -58,4 +58,11 @@ public interface IProPlanScheduleService
* @return
*/
public int deleteProPlanScheduleById(Long id);
/**
*
* @param taskId
* @return
*/
public ProPlanSchedule findPreviousScheduleByTaskId(Long taskId);
}

View File

@ -18,7 +18,7 @@ public interface IProPlanService
* @return
*/
public ProPlan selectProPlanById(Long id);
public ProPlan selectProPlanByUniqueId(String UniqueId);
public ProPlan selectProPlanByUniqueId(String UniqueId);
/**
*
*
@ -27,6 +27,14 @@ public interface IProPlanService
*/
public List<ProPlan> selectProPlanList(ProPlan proPlan);
/**
*
*
* @param proPlan
* @return
*/
public List<ProPlan> selectProPlanListView(ProPlan proPlan);
/**
*
*
@ -65,4 +73,9 @@ public interface IProPlanService
*/
public void addTasks(List<ProPlan> proPlans);
/**
*
* @return
*/
public ProPlan findOnlyPlan(ProPlan proPlan);
}

View File

@ -1,12 +1,18 @@
package com.yanzhu.manage.service.impl;
import com.yanzhu.common.core.context.SecurityContextHolder;
import com.yanzhu.common.core.text.Convert;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.manage.domain.ProPlan;
import com.yanzhu.manage.domain.ProPlanSchedule;
import com.yanzhu.manage.mapper.ProPlanMapper;
import com.yanzhu.manage.mapper.ProPlanScheduleMapper;
import com.yanzhu.manage.service.IProPlanScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.DecimalFormat;
import java.util.List;
/**
@ -18,6 +24,9 @@ import java.util.List;
@Service
public class ProPlanScheduleServiceImpl implements IProPlanScheduleService
{
@Autowired
private ProPlanMapper proPlanMapper;
@Autowired
private ProPlanScheduleMapper proPlanScheduleMapper;
@ -52,10 +61,31 @@ public class ProPlanScheduleServiceImpl implements IProPlanScheduleService
* @return
*/
@Override
@Transactional
public int insertProPlanSchedule(ProPlanSchedule proPlanSchedule)
{
proPlanSchedule.setCreateBy(SecurityContextHolder.getUserName());
return proPlanScheduleMapper.insertProPlanSchedule(proPlanSchedule);
proPlanSchedule.setCreateDate(DateUtils.getNowDate());
int res = proPlanScheduleMapper.insertProPlanSchedule(proPlanSchedule);
if(res>0){
ProPlan plan = proPlanMapper.selectProPlanById(proPlanSchedule.getPlanId());
plan.setScheduleNode(proPlanSchedule.getSchedulePercent().toString());
if(proPlanSchedule.getSchedulePercent()>=100){
if(plan.getStartDate()==null){
plan.setStartDate(DateUtils.getNowDate());
}
plan.setFinishDate(proPlanSchedule.getFinishDate());
RecursionEditFinishDate(plan);
}else{
if(plan.getStartDate()==null){
plan.setStartDate(DateUtils.getNowDate());
RecursionEditStartDate(plan);
}else{
RecursionEditFinishDate(plan);
}
}
}
return res;
}
/**
@ -65,10 +95,28 @@ public class ProPlanScheduleServiceImpl implements IProPlanScheduleService
* @return
*/
@Override
@Transactional
public int updateProPlanSchedule(ProPlanSchedule proPlanSchedule)
{
proPlanSchedule.setUpdateBy(SecurityContextHolder.getUserName());
return proPlanScheduleMapper.updateProPlanSchedule(proPlanSchedule);
int res = proPlanScheduleMapper.updateProPlanSchedule(proPlanSchedule);
if(res>0){
ProPlan plan = proPlanMapper.selectProPlanById(proPlanSchedule.getPlanId());
plan.setScheduleNode(proPlanSchedule.getSchedulePercent().toString());
if(proPlanSchedule.getSchedulePercent()>=100){
plan.setFinishDate(proPlanSchedule.getFinishDate());
plan.setScheduleNode("100");
RecursionEditFinishDate(plan);
}else{
if(plan.getFinishDate()!=null){
plan.setFinishDate(null);
RecursionEditFinishDate(plan);
}else{
RecursionEditFinishDate(plan);
}
}
}
return res;
}
/**
@ -80,7 +128,22 @@ public class ProPlanScheduleServiceImpl implements IProPlanScheduleService
@Override
public int deleteProPlanScheduleByIds(Long[] ids)
{
return proPlanScheduleMapper.deleteProPlanScheduleByIds(ids);
int res = proPlanScheduleMapper.deleteProPlanScheduleByIds(ids);
if(res>0){
for(Long id:ids){
ProPlanSchedule proPlanSchedule = proPlanScheduleMapper.selectProPlanScheduleById(id);
ProPlan plan = proPlanMapper.selectProPlanById(proPlanSchedule.getPlanId());
ProPlanSchedule Previous = proPlanScheduleMapper.findPreviousScheduleByTaskId(plan.getId());
if(Previous!=null){
plan.setScheduleNode(Previous.getSchedulePercent().toString());
}else{
plan.setScheduleNode("0");
}
plan.setFinishDate(null);
RecursionEditFinishDate(plan);
}
}
return res;
}
/**
@ -92,6 +155,211 @@ public class ProPlanScheduleServiceImpl implements IProPlanScheduleService
@Override
public int deleteProPlanScheduleById(Long id)
{
return proPlanScheduleMapper.deleteProPlanScheduleById(id);
int res = proPlanScheduleMapper.deleteProPlanScheduleById(id);
if(res>0){
ProPlanSchedule proPlanSchedule = proPlanScheduleMapper.selectProPlanScheduleById(id);
ProPlan plan = proPlanMapper.selectProPlanById(proPlanSchedule.getPlanId());
ProPlanSchedule Previous = proPlanScheduleMapper.findPreviousScheduleByTaskId(plan.getId());
if(Previous!=null){
plan.setScheduleNode(Previous.getSchedulePercent().toString());
}else{
plan.setScheduleNode("0");
}
plan.setFinishDate(null);
RecursionEditFinishDate(plan);
}
return res;
}
/**
*
* @param plan
*/
private void RecursionEditStartDate(ProPlan plan){
if(plan.getStartDate()!=null){
int res = proPlanMapper.updateProPlan(plan);
if(res>0 && plan.getTaskOutlineLevel()>1){
ProPlan entity = proPlanMapper.selectProPlanByParams(plan.getProjectId(),plan.getParentId());
if(entity!=null){
List<ProPlan> belows = proPlanMapper.selectProPlanBelows(entity.getProjectId(),entity.getTaskId());
int Finished = 0;
try {
if(belows.size()>0){
for(ProPlan item:belows){
Float sNode = Convert.toFloat(item.getScheduleNode(),0.0F);
if(sNode>0){
if(sNode==100){
Finished += Convert.toFloat(item.getTaskDuation(),0.0F);
}else{
Finished += Convert.toFloat(item.getTaskDuation()*(sNode/100));
}
}
}
}
}catch (Exception e){
e.printStackTrace();
}
if(Finished==0){
entity.setScheduleNode("0");
}else{
Double _cn = Convert.toDouble(Finished/entity.getTaskDuation())*100;
if(_cn>100){
entity.setScheduleNode("100");
}else{
entity.setScheduleNode(String.format("%.2f", _cn));
}
}
System.out.println("RecursionEditStartDate.entity.getScheduleNode()..."+entity.getScheduleNode());
entity.setStartDate(plan.getStartDate());
RecursionEditStartDate(entity);
}
}
}else{
int res = proPlanMapper.updateProPlanStartDate(plan);
if(res>0 && plan.getTaskOutlineLevel()>1){
ProPlan entity = proPlanMapper.selectProPlanByParams(plan.getProjectId(),plan.getParentId());
if(entity!=null){
List<ProPlan> belows = proPlanMapper.selectProPlanBelows(entity.getProjectId(),entity.getTaskId());
Float Finished = 0.0F;
try {
if(belows.size()>0){
for(ProPlan item:belows){
Float sNode = Convert.toFloat(item.getScheduleNode(),0.0F);
if(sNode>0){
if(sNode==100){
Finished += Convert.toFloat(item.getTaskDuation(),0.0F);
}else{
Finished += Convert.toFloat(item.getTaskDuation()*(sNode/100));
}
}
}
}
}catch (Exception e){
e.printStackTrace();
}
if(Finished==0){
entity.setScheduleNode("0");
}else{
Double _cn = Convert.toDouble(Finished/entity.getTaskDuation())*100;
if(_cn>100){
entity.setScheduleNode("100");
}else{
entity.setScheduleNode(String.format("%.2f", _cn));
}
}
System.out.println("RecursionEditStartDate.entity.getScheduleNode()..."+entity.getScheduleNode());
entity.setStartDate(plan.getStartDate());
RecursionEditStartDate(entity);
}
}
}
}
/**
*
* @param plan
*/
private void RecursionEditFinishDate(ProPlan plan){
if(plan.getFinishDate()!=null){
int res = proPlanMapper.updateProPlan(plan);
if(res>0 && plan.getTaskOutlineLevel()>1){
// 判断当前结构其它部位是否已全部完成
List<ProPlan> brothers = proPlanMapper.selectProPlanBrothers(plan.getProjectId(),plan.getParentId());
if(brothers.size()==0){
ProPlan entity = proPlanMapper.selectProPlanByParams(plan.getProjectId(),plan.getParentId());
if(entity!=null){
if(entity.getStartDate()==null){
entity.setStartDate(DateUtils.getNowDate());
}
List<ProPlan> belows = proPlanMapper.selectProPlanBelows(entity.getProjectId(),entity.getTaskId());
Float Finished = 0.0F;
try {
if(belows.size()>0){
for(ProPlan item:belows){
Float sNode = Convert.toFloat(item.getScheduleNode(),0.0F);
if(sNode>0){
System.out.println("RecursionEditFinishDate.sNodesNode==>"+sNode);
if(sNode==100){
Finished += Convert.toFloat(item.getTaskDuation(),0.0F);
System.out.println("RecursionEditFinishDate.FinishedFinished1==>"+Finished);
}else{
Finished += Convert.toFloat(item.getTaskDuation()*(sNode/100));
System.out.println("RecursionEditFinishDate.FinishedFinished2==>"+Finished);
}
}
}
}
}catch (Exception e){
e.printStackTrace();
}
if(Finished==0){
entity.setScheduleNode("0");
}else{
Double _cn = Convert.toDouble(Finished/entity.getTaskDuation())*100;
if(_cn>100){
entity.setScheduleNode("100");
}else{
entity.setScheduleNode(String.format("%.2f", _cn));
}
}
System.out.println("RecursionEditFinishDate.entity.getScheduleNode()..."+entity.getScheduleNode());
entity.setFinishDate(plan.getFinishDate());
RecursionEditFinishDate(entity);
}
}
}
}else{
int res = proPlanMapper.updateProPlanFinishDate(plan);
if(res>0 && plan.getTaskOutlineLevel()>1){
ProPlan entity = proPlanMapper.selectProPlanByParams(plan.getProjectId(),plan.getParentId());
if(entity!=null){
List<ProPlan> belows = proPlanMapper.selectProPlanBelows(entity.getProjectId(),entity.getTaskId());
Float Finished = 0.0F;
try {
if(belows.size()>0){
for(ProPlan item:belows){
Float sNode = Convert.toFloat(item.getScheduleNode(),0.0F);
if(sNode>0){
System.out.println("RecursionEditFinishDate.sNodesNode==>"+sNode);
if(sNode==100){
Finished += Convert.toFloat(item.getTaskDuation(),0.0F);
System.out.println("RecursionEditFinishDate.FinishedFinished1==>"+Finished);
}else{
Finished += Convert.toFloat(item.getTaskDuation()*(sNode/100));
System.out.println("RecursionEditFinishDate.FinishedFinished1==>"+Finished);
}
}
}
}
}catch (Exception e){
e.printStackTrace();
}
if(Finished==0){
entity.setScheduleNode("0");
}else{
Double _cn = Convert.toDouble(Finished/entity.getTaskDuation())*100;
if(_cn>100){
entity.setScheduleNode("100");
}else{
entity.setScheduleNode(String.format("%.2f", _cn));
}
}
System.out.println("RecursionEditFinishDate.entity.getScheduleNode()..."+entity.getScheduleNode());
entity.setFinishDate(plan.getFinishDate());
RecursionEditFinishDate(entity);
}
}
}
}
/**
*
* @param taskId
* @return
*/
@Override
public ProPlanSchedule findPreviousScheduleByTaskId(Long taskId){
return proPlanScheduleMapper.findPreviousScheduleByTaskId(taskId);
}
}

View File

@ -55,6 +55,16 @@ public class ProPlanServiceImpl implements IProPlanService
return proPlanMapper.selectProPlanList(proPlan);
}
/**
*
*
* @param proPlan
* @return
*/
public List<ProPlan> selectProPlanListView(ProPlan proPlan){
return proPlanMapper.selectProPlanListView(proPlan);
}
/**
*
*
@ -133,10 +143,8 @@ public class ProPlanServiceImpl implements IProPlanService
old.setTaskOutlineLevel(proPlan.getTaskOutlineLevel());
old.setTaskDuation(proPlan.getTaskDuation());
old.setPredecessors(proPlan.getPredecessors());
old.setStartDate(proPlan.getStartDate());
old.setFinishDate(proPlan.getFinishDate());
old.setPlanStartDate(proPlan.getPlanStartDate());
old.setPlanFinishDate(proPlan.getPlanFinishDate());
old.setPlanStartDate(proPlan.getStartDate());
old.setPlanFinishDate(proPlan.getFinishDate());
updateProPlan(old);
}else{
//没有原数据进行插入
@ -159,4 +167,18 @@ public class ProPlanServiceImpl implements IProPlanService
}
return null;
}
/**
*
* @return
*/
@Override
public ProPlan findOnlyPlan(ProPlan proPlan){
ProPlan plan = proPlanMapper.findOnlyPlan(proPlan);
if(plan!=null){
return findOnlyPlan(plan);
}else{
return proPlan;
}
}
}

View File

@ -42,3 +42,11 @@ export function delPlan(id) {
method: 'delete'
})
}
// 查询项目进度
export function findOnlyPlan(proId) {
return request({
url: '/manage/plan/findOnlyPlan/' + proId,
method: 'get'
})
}

View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询项目进度列表
export function listSchedule(query) {
return request({
url: '/manage/schedule/list',
method: 'get',
params: query
})
}
// 查询项目进度详细
export function getSchedule(id) {
return request({
url: '/manage/schedule/' + id,
method: 'get'
})
}
// 新增项目进度
export function addSchedule(data) {
return request({
url: '/manage/schedule',
method: 'post',
data: data
})
}
// 修改项目进度
export function updateSchedule(data) {
return request({
url: '/manage/schedule',
method: 'put',
data: data
})
}
// 删除项目进度
export function delSchedule(id) {
return request({
url: '/manage/schedule/' + id,
method: 'delete'
})
}
// 查询之前项目进度
export function findPreviousSchedule(taskId) {
return request({
url: '/manage/schedule/findPreviousSchedule/' + taskId,
method: 'get'
})
}

View File

@ -46,6 +46,26 @@ export function parseTime(time, pattern) {
return time_str
}
// 时间比较
export function compareDate(planFinishDate,finishDate) {
let _planFinishDate = new Date(planFinishDate).getTime();
let _finishDate = new Date(finishDate).getTime();
if(planFinishDate && !finishDate){
let date = new Date().getTime();
if(_planFinishDate>date){
return -2;
}else{
return 0;
}
}else{
if(_planFinishDate>_finishDate){
return 1;
}else{
return -1;
}
}
}
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {

View File

@ -3,14 +3,14 @@
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="项目" prop="projectId">
<el-select :disabled="data.currentPrjId != ''" style="width:150px;" v-model="queryParams.projectId" placeholder="请选择项目" clearable
<el-select :disabled="data.currentPrjId != ''" style="width:192px;" v-model="queryParams.projectId" placeholder="请选择项目" clearable
@change="()=>{handleQuery();projectChange();}">
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属单位" prop="subDeptId">
<el-select v-model="queryParams.subDeptId" style="width:150px;" placeholder="请选择所属单位" clearable @change="()=>{handleQuery();subDeptChange();}">
<el-select v-model="queryParams.subDeptId" style="width:192px;" placeholder="请选择所属单位" clearable @change="()=>{handleQuery();subDeptChange();}">
<el-option v-for="(it, idx) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
</el-select>
</el-form-item>

View File

@ -2,20 +2,20 @@
<div class="app-container attendance-ubi-data-statistics">
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="90px">
<el-form-item label="项目" prop="projectId">
<el-select :disabled="data.currentPrjId != ''" style="width:150px;" v-model="queryParams.projectId"
<el-select :disabled="data.currentPrjId != ''" style="width:192px;" v-model="queryParams.projectId"
placeholder="请选择项目" clearable @change="() => { handleQuery(); projectChange(); }">
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属单位" prop="subDeptId">
<el-select v-model="queryParams.subDeptId" style="width:150px;" placeholder="请选择所属单位" clearable
<el-select v-model="queryParams.subDeptId" style="width:192px;" placeholder="请选择所属单位" clearable
@change="() => { handleQuery(); }">
<el-option v-for="(it, idx) in data.subdepts" :key="it.id" :label="it.subDeptName" :value="it.id" />
</el-select>
</el-form-item>
<el-form-item label="显示方式" prop="showType">
<el-select v-model="queryParams.showType" style="width:150px;" placeholder="请选择显示方式">
<el-select v-model="queryParams.showType" style="width:192px;" placeholder="请选择显示方式">
<el-option label="按考勤时间显示" value="0" />
<el-option label="按是否考勤显示" value="1" />
</el-select>

View File

@ -1,24 +1,24 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="公司" prop="comId" v-if="1 == 2">
<el-input v-model="queryParams.comId" placeholder="请输入公司主键" clearable @keyup.enter="handleQuery"/>
<el-form-item label="所属公司" prop="comId" v-if="1 == 2">
<el-input v-model="queryParams.comId" placeholder="请输入所属公司" clearable @keyup.enter="handleQuery"/>
</el-form-item>
<el-form-item label="项目" prop="projectId">
<el-select :disabled="data.currentPrjId != ''" v-model="queryParams.projectId" placeholder="请选择项目" clearable style="width:150px;"
<el-form-item label="所属项目" prop="projectId">
<el-select :disabled="data.currentPrjId != ''" v-model="queryParams.projectId" placeholder="请选择所属项目" clearable style="width:192px;"
@change="handleQuery">
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="考勤厂商" prop="vendorsCode">
<el-select v-model="queryParams.vendorsCode" placeholder="请选择厂商" clearable @change="handleQuery" style="width:150px;">
<el-select v-model="queryParams.vendorsCode" placeholder="请选择厂商" clearable @change="handleQuery" style="width:192px;">
<el-option v-for="dict in attendance_vendors" :key="dict.value" :label="dict.label" :value="dict.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="启停状态" prop="enabled">
<el-select v-model="queryParams.enabled" clearable style="width:100px;">
<el-select v-model="queryParams.enabled" clearable style="width:192px;">
<el-option label="启用" :value="1"></el-option>
<el-option label="停用" :value="0"></el-option>
</el-select>

View File

@ -546,7 +546,7 @@ getList();
.bus-training-video-index{
.fitem-craft-type{
.el-select{
width:150px;
width:192px;
}
}
}

View File

@ -3,14 +3,14 @@
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="项目" prop="projectId">
<el-select :disabled="data.currentPrjId != ''" v-model="queryParams.projectId" placeholder="请选择项目" clearable style="width:150px;"
<el-select :disabled="data.currentPrjId != ''" v-model="queryParams.projectId" placeholder="请选择项目" clearable style="width:192px;"
@change="handleQuery">
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="碳因子类型" prop="carbonFactorType">
<el-select v-model="queryParams.carbonFactorType" style="width: 120px;" clearable>
<el-select v-model="queryParams.carbonFactorType" style="width: 192px;" clearable>
<el-option v-for="(it,idx) in data.types" :key="idx" :label="it.text" :value="it.value"></el-option>
</el-select>
</el-form-item>

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="项目" prop="projectId">
<el-select :disabled="data.projectId" v-model="queryParams.projectId" placeholder="请选择项目" style="width: 120px;" clearable
<el-select :disabled="data.projectId" v-model="queryParams.projectId" placeholder="请选择项目" style="width: 192px;" clearable
@change="handleQuery">
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
</el-option>
@ -152,7 +152,7 @@ function getList() {
}
loading.value = true;
listPlan(queryParams.value).then(response => {
let tmps= response.rows||[];
let tmps= response.data||[];
let objs= buildTree(tmps,0)
planList.value =objs;
loading.value = false;

View File

@ -1033,7 +1033,7 @@ getList()
.fi-certificate {
.el-select {
width: 120px;
width: 192px;
.el-input {
width: 100%;

View File

@ -0,0 +1,461 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentPrjId">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="计划名称" prop="taskName">
<el-input
v-model="queryParams.taskName"
placeholder="请输入计划名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['manage:schedule:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['manage:schedule:export']"
>导出</el-button
>
</el-col>
<right-toolbar
v-model:showSearch="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="scheduleList">
<el-table-column label="序号" type="index" width="66" align="center" />
<el-table-column label="项目名称" align="center" prop="projectName" />
<el-table-column label="工程计划名称" align="center" prop="taskName" />
<el-table-column label="工期" align="center" prop="taskDuation" width="88">
<template #default="scope">
<el-tag effect="plain">{{ scope.row.taskDuation + " 天" }}</el-tag>
</template>
</el-table-column>
<el-table-column
label="计划开始时间"
align="center"
prop="planStartDate"
width="120"
>
<template #default="scope">
<span>{{ parseTime(scope.row.planStartDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="计划结束时间"
align="center"
prop="planFinishDate"
width="120"
>
<template #default="scope">
<span>{{ parseTime(scope.row.planFinishDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="填报时间" align="center" prop="createDate" width="120">
<template #default="scope">
<span>{{ parseTime(scope.row.createDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="完成进度" align="center" prop="schedulePercent" width="88">
<template #default="scope">
<el-tag v-if="scope.row.schedulePercent != 100" effect="dark" type="info">{{
scope.row.schedulePercent + " %"
}}</el-tag>
<el-tag v-else effect="dark" type="success">{{
scope.row.schedulePercent + " %"
}}</el-tag>
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center" prop="finishDate" width="120">
<template #default="scope">
<span>{{ parseTime(scope.row.finishDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="施工作业图" align="center" prop="images" width="120">
<template #default="scope">
<div v-if="scope.row.images != null">
<image-preview
v-if="scope.row.images.split(',').length == 1"
:src="scope.row.images"
:width="50"
:height="50"
/>
<el-badge
v-if="scope.row.images.split(',').length > 1"
:value="scope.row.images.split(',').length"
type="primary"
class="item"
>
<image-preview :src="scope.row.images" :width="50" :height="50" />
</el-badge>
</div>
<div v-else style="color: var(--el-color-info-light-3)">暂无图片</div>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="200"
fixed="right"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button
v-if="scope.row.id == scope.row.maxId"
link
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['manage:schedule:edit']"
>修改</el-button
>
<el-button
v-if="scope.row.id == scope.row.maxId"
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['manage:schedule:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改项目进度对话框 -->
<el-dialog :title="title" v-model="open" width="798px" append-to-body>
<el-form ref="scheduleRef" :model="form" :rules="rules" label-width="108px">
<el-form-item label="项目名称" v-if="form.projectId">
<el-tag effect="plain">{{ form.projectName }}</el-tag>
</el-form-item>
<el-form-item label="工程计划名称" prop="taskName">
<el-input v-model="form.taskName" placeholder="请输入工程计划名称" disabled />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="当前完成进度" prop="schedulePercent">
<el-input-number
v-model="form.schedulePercent"
placeholder="请输入当前完成进度"
:min="
previousSchedule.schedulePercent ? previousSchedule.schedulePercent : 1
"
:max="100"
:step="1"
:precision="0"
controls-position="right"
style="width: 220px"
>
<template #suffix>
<span>%</span>
</template>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-alert
v-if="previousSchedule.schedulePercent"
:title="'上次完成进度 ' + previousSchedule.schedulePercent + '%'"
type="warning"
show-icon
:closable="false"
/>
</el-col>
</el-row>
<el-form-item
label="完成时间"
prop="finishDate"
v-if="form.schedulePercent == 100"
>
<el-date-picker
clearable
v-model="form.finishDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择完成时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="施工进度描述" prop="description">
<el-input
v-model="form.description"
type="textarea"
placeholder="请输入施工进度描述"
:autosize="{ minRows: 3, maxRows: 6 }"
maxlength="999"
show-word-limit
/>
</el-form-item>
<el-form-item label="施工作业图" prop="images">
<image-upload v-model="form.images" :limit="5" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Schedule">
import { findOnlyPlan } from "@/api/manage/plan";
import {
listSchedule,
getSchedule,
delSchedule,
addSchedule,
updateSchedule,
findPreviousSchedule,
} from "@/api/manage/schedule";
import useUserStore from "@/store/modules/user";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
const scheduleList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const planNode = ref({});
const previousSchedule = ref({});
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
comId: null,
projectId: null,
planId: null,
taskId: null,
taskUniqueId: null,
taskName: null,
bimId: null,
isDel: null,
createUserId: null,
},
rules: {
projectId: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
taskName: [{ required: true, message: "工程计划不能为空", trigger: "blur" }],
schedulePercent: [{ required: true, message: "当前完成进度不能为空", trigger: "blur" }],
finishDate: [{ required: true, message: "完成时间不能为空", trigger: "change" }],
description: [{ required: true, message: "施工进度描述不能为空", trigger: "blur" }],
images1: [{ required: true, message: "施工作业图不能为空", trigger: "change" }],
},
});
const { queryParams, form, rules } = toRefs(data);
/** 查询项目进度列表 */
function getList() {
loading.value = true;
listSchedule(queryParams.value).then((response) => {
scheduleList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
comId: null,
projectId: null,
planId: null,
taskId: null,
taskUniqueId: null,
taskName: null,
bimId: null,
schedulePercent: null,
finishDate: null,
description: null,
images: null,
isDel: null,
createBy: null,
createUserId: null,
createDate: null,
updateBy: null,
updateDate: null,
};
proxy.resetForm("scheduleRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
if (!userStore.currentComId) {
proxy.$modal.msgWarning("请切换到项目数据!!!");
open.value = false;
return false;
}
reset();
open.value = true;
form.value.comId = userStore.currentComId;
form.value.comName = userStore.currentComName;
form.value.projectId = userStore.currentPrjId;
form.value.projectName = userStore.currentProName;
initPlan(userStore.currentPrjId);
title.value = "添加项目进度";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value;
getSchedule(_id).then((response) => {
form.value = response.data;
open.value = true;
title.value = "修改项目进度";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["scheduleRef"].validate((valid) => {
if (valid) {
if (form.value.id != null) {
updateSchedule(form.value).then((response) => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addSchedule(form.value).then((response) => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal
.confirm('是否确认删除项目进度编号为"' + _ids + '"的数据项?')
.then(function () {
return delSchedule(_ids);
})
.then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download(
"manage/schedule/export",
{
...queryParams.value,
},
`schedule_${new Date().getTime()}.xlsx`
);
}
/** 初始化计划管理 */
function initPlan(proId) {
findOnlyPlan(proId).then((res) => {
planNode.value = res.data;
form.value.planId = res.data.id;
form.value.taskId = res.data.taskId;
form.value.taskUniqueId = res.data.taskUniqueId;
form.value.taskName = res.data.taskName;
form.value.bimId = res.data.bimId;
initPreviousSchedule(res.data.id);
});
}
/** 查询上次计划进度 */
function initPreviousSchedule(taskId) {
findPreviousSchedule(taskId).then((res) => {
if (res.data) {
previousSchedule.value = res.data;
form.value.schedulePercent = res.data.schedulePercent;
}else{
previousSchedule.value = 1;
form.value.schedulePercent = {};
}
});
}
getList();
</script>

View File

@ -0,0 +1,230 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentPrjId">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="计划名称" prop="taskName">
<el-input
v-model="queryParams.taskName"
placeholder="请输入计划名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="计划状态" prop="activeTags">
<el-select
v-model="queryParams.activeTags"
placeholder="请选择计划状态"
clearable
>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row>
<div class="flex gap-2">
<el-tag type="success" effect="dark">正常完工</el-tag>
<el-tag type="warning" effect="dark">延期完工</el-tag>
<el-tag type="primary" effect="dark">正在进行</el-tag>
</div>
</el-row>
<el-table
v-loading="loading"
:data="planList"
row-key="taskId"
default-expand-all
>
<el-table-column label="任务名称" align="left" prop="taskName" />
<el-table-column label="任务工期" align="center" prop="taskDuation" width="120">
<template #default="scope">{{ scope.row.taskDuation }}d</template>
</el-table-column>
<el-table-column
label="计划开始时间"
align="center"
prop="planStartDate"
width="120"
>
<template #default="scope">
<span>{{ scope.row.planStartDate }}</span>
</template>
</el-table-column>
<el-table-column
label="计划结束时间"
align="center"
prop="planFinishDate"
width="120"
>
<template #default="scope">
<span>{{ scope.row.planFinishDate }}</span>
</template>
</el-table-column>
<el-table-column label="进度开始时间" align="center" prop="startDate" width="120">
<template #default="scope">
<span>{{ scope.row.startDate }}</span>
</template>
</el-table-column>
<el-table-column label="进度结束时间" align="center" prop="finishDate" width="120">
<template #default="scope">
<span>{{ scope.row.finishDate }}</span>
</template>
</el-table-column>
<el-table-column label="延期天数" align="center" width="120" />
<el-table-column label="完成进度" align="center" prop="operator" width="250">
<template #default="scope">
<el-progress
v-if="scope.row.Progress==0"
:percentage="Number(scope.row.scheduleNode)"
:stroke-width="15"
:text-inside="true"
/>
<el-progress
v-if="scope.row.Progress==-2"
:percentage="Number(scope.row.scheduleNode)"
:stroke-width="15"
status="exception"
:text-inside="true"
:indeterminate="true"
/>
<el-progress
v-if="scope.row.Progress==-1"
:percentage="Number(scope.row.scheduleNode)"
:stroke-width="15"
status="warning"
:text-inside="true"
/>
<el-progress
v-if="scope.row.Progress==1"
:percentage="Number(scope.row.scheduleNode)"
:stroke-width="15"
status="success"
:text-inside="true"
/>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup name="Plan">
import { listPlan } from "@/api/manage/plan";
import useUserStore from "@/store/modules/user";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
const planList = ref([]);
const loading = ref(true);
const showSearch = ref(true);
const data = reactive({
queryParams: {
comid: null,
projectId: null,
activeTags: "",
},
compId: "",
projectId: "",
});
const { queryParams } = toRefs(data);
function buildTree(all, id) {
let tmps = all.filter((d) => d.parentId == id);
if (tmps.length > 0) {
tmps.forEach((it) => {
it.children = buildTree(all, it.taskId);
});
}
return tmps;
}
/** 查询计划管理列表 */
function getList() {
if (!queryParams.value.projectId) {
planList.value = [];
proxy.$modal.msgWarning("请切换到项目数据!!!");
loading.value = false;
return;
}
loading.value = true;
listPlan(queryParams.value).then((response) => {
let tmps = response.data || [];
tmps.forEach(tmp => {
tmp.Progress = compareDate(tmp.planFinishDate,tmp.finishDate);
})
let objs = buildTree(tmps, 0);
planList.value = objs;
loading.value = false;
});
}
/** 搜索按钮操作 */
function handleQuery() {
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
function compareDate(planFinishDate,finishDate) {
let _planFinishDate = new Date(planFinishDate).getTime();
let _finishDate = new Date(finishDate).getTime();
if(planFinishDate && !finishDate){
let date = new Date().getTime();
if(_planFinishDate>date){
return -2;
}else{
return 0;
}
}else{
if(_planFinishDate>_finishDate){
return 1;
}else{
return -1;
}
}
}
data.compId = userStore.currentComId;
data.projectId = userStore.currentPrjId;
queryParams.value.projectId = data.projectId;
getList();
</script>
<style lang="scss" scope>
.gap-2 {
position: absolute;
right: 0px;
z-index: 99;
margin-top: -33px;
.el-tag--default {
margin: 2px 10px;
.el-tag__content {
font-weight: 800;
padding: 0 20px;
}
}
}
.el-progress-bar__outer{
background-color: #453838 !important;
}
</style>

View File

@ -3,7 +3,7 @@
<el-form ref="videoMonitorRef" label-width="120px" v-if="!data.currentPrjId">
<el-form-item label="项目名称">
<el-select :disabled="data.currentPrjId != '' || data.type == 'edit'" v-model="data.selPrjId"
placeholder="请选择项目" clearable style="width:150px;" @change="loadData()">
placeholder="请选择项目" clearable style="width:192px;" @change="loadData()">
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
</el-option>
</el-select>

View File

@ -4,7 +4,7 @@
<el-form ref="videoMonitorRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="项目名称" prop="projectId">
<el-select :disabled="data.currentPrjId != ''||data.type=='edit'" v-model="form.projectId" placeholder="请选择项目" clearable
style="width:150px;">
style="width:192px;">
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
</el-option>
</el-select>