Ver código fonte

-新增维修任务分配

jiangbiao 2 anos atrás
pai
commit
8edc50fdb5

+ 123 - 0
master/src/main/java/com/ruoyi/project/task/controller/TTaskRepairController.java

@@ -0,0 +1,123 @@
+package com.ruoyi.project.task.controller;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Date;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.StringUtils;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.project.task.domain.TTaskRepair;
+import com.ruoyi.project.task.service.ITTaskRepairService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 维修任务Controller
+ *
+ * @author ruoyi
+ * @date 2022-11-30
+ */
+@RestController
+@RequestMapping("/task/repair")
+public class TTaskRepairController extends BaseController
+{
+    @Autowired
+    private ITTaskRepairService tTaskRepairService;
+
+    /**
+     * 查询维修任务列表
+     */
+    @PreAuthorize("@ss.hasPermi('task:repair:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TTaskRepair tTaskRepair)
+    {
+        startPage();
+        List<TTaskRepair> list = tTaskRepairService.selectTTaskRepairList(tTaskRepair);
+        list.forEach(item -> {
+            if (StringUtils.isNotEmpty(item.getTaskDoneNum()) && StringUtils.isNotEmpty(item.getTaskNum())) {
+                item.setPercentage(new BigDecimal(item.getTaskDoneNum()).divide(new BigDecimal(item.getTaskNum()), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).doubleValue());
+            }
+            if (item.getEndTime() != null) {
+                if (item.getEndTime().before(new Date())) {
+                    item.setTimeOut("是");
+                } else {
+                    item.setTimeOut("否");
+                }
+            }
+        });
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出维修任务列表
+     */
+    @PreAuthorize("@ss.hasPermi('task:repair:export')")
+    @Log(title = "维修任务", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TTaskRepair tTaskRepair)
+    {
+        List<TTaskRepair> list = tTaskRepairService.selectTTaskRepairList(tTaskRepair);
+        ExcelUtil<TTaskRepair> util = new ExcelUtil<TTaskRepair>(TTaskRepair.class);
+        util.exportExcel(response, list, "维修任务数据");
+    }
+
+    /**
+     * 获取维修任务详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('task:repair:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tTaskRepairService.selectTTaskRepairById(id));
+    }
+
+    /**
+     * 新增维修任务
+     */
+    @PreAuthorize("@ss.hasPermi('task:repair:add')")
+    @Log(title = "维修任务", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TTaskRepair tTaskRepair)
+    {
+        tTaskRepair.setCreaterCode(getUserId());
+        return toAjax(tTaskRepairService.insertTTaskRepair(tTaskRepair));
+    }
+
+    /**
+     * 修改维修任务
+     */
+    @PreAuthorize("@ss.hasPermi('task:repair:edit')")
+    @Log(title = "维修任务", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TTaskRepair tTaskRepair)
+    {
+        tTaskRepair.setUpdaterCode(getUserId());
+        return toAjax(tTaskRepairService.updateTTaskRepair(tTaskRepair));
+    }
+
+    /**
+     * 删除维修任务
+     */
+    @PreAuthorize("@ss.hasPermi('task:repair:remove')")
+    @Log(title = "维修任务", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tTaskRepairService.deleteTTaskRepairByIds(ids));
+    }
+}

+ 319 - 0
master/src/main/java/com/ruoyi/project/task/domain/TTaskRepair.java

@@ -0,0 +1,319 @@
+package com.ruoyi.project.task.domain;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 维修任务对象 t_task_repair
+ *
+ * @author ruoyi
+ * @date 2022-11-30
+ */
+public class TTaskRepair extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 唯一标识id */
+    private Long id;
+
+    /** 装置id */
+    @Excel(name = "装置id")
+    private Long plantId;
+
+    /** 任务名称 */
+    @Excel(name = "任务名称")
+    private String taskName;
+
+    /** 任务编号 */
+    @Excel(name = "任务编号")
+    private String taskCode;
+
+    /** 任务类型 */
+    @Excel(name = "任务类型")
+    private String taskType;
+
+    /** 任务起始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "任务起始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 任务截止时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "任务截止时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endTime;
+
+    /** 接收人 */
+    @Excel(name = "接收人")
+    private Long recipient;
+
+    /** 维修点数 */
+    @Excel(name = "维修点数")
+    private String taskNum;
+
+    /** 已维修点数 */
+    @Excel(name = "已维修点数")
+    private String taskDoneNum;
+
+    /** 未维修点数 */
+    @Excel(name = "未维修点数")
+    private String taskUndoneNum;
+
+    @TableField(exist = false)
+    private Double percentage;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private String status;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 状态  0:正常 ;1:删除 */
+    private Integer delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private Long createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 修改人 */
+    @Excel(name = "修改人")
+    private Long updaterCode;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    @Excel(name = "是否超时")
+    @TableField(exist = false)
+    private String timeOut;
+
+    public String getTimeOut() {
+        return timeOut;
+    }
+
+    public void setTimeOut(String timeOut) {
+        this.timeOut = timeOut;
+    }
+
+    public Double getPercentage() {
+        return percentage;
+    }
+
+    public void setPercentage(Double percentage) {
+        this.percentage = percentage;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setPlantId(Long plantId)
+    {
+        this.plantId = plantId;
+    }
+
+    public Long getPlantId()
+    {
+        return plantId;
+    }
+    public void setTaskName(String taskName)
+    {
+        this.taskName = taskName;
+    }
+
+    public String getTaskName()
+    {
+        return taskName;
+    }
+    public void setTaskCode(String taskCode)
+    {
+        this.taskCode = taskCode;
+    }
+
+    public String getTaskCode()
+    {
+        return taskCode;
+    }
+    public void setTaskType(String taskType)
+    {
+        this.taskType = taskType;
+    }
+
+    public String getTaskType()
+    {
+        return taskType;
+    }
+    public void setStartTime(Date startTime)
+    {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime()
+    {
+        return startTime;
+    }
+    public void setEndTime(Date endTime)
+    {
+        this.endTime = endTime;
+    }
+
+    public Date getEndTime()
+    {
+        return endTime;
+    }
+    public void setRecipient(Long recipient)
+    {
+        this.recipient = recipient;
+    }
+
+    public Long getRecipient()
+    {
+        return recipient;
+    }
+    public void setTaskNum(String taskNum)
+    {
+        this.taskNum = taskNum;
+    }
+
+    public String getTaskNum()
+    {
+        return taskNum;
+    }
+    public void setTaskDoneNum(String taskDoneNum)
+    {
+        this.taskDoneNum = taskDoneNum;
+    }
+
+    public String getTaskDoneNum()
+    {
+        return taskDoneNum;
+    }
+    public void setTaskUndoneNum(String taskUndoneNum)
+    {
+        this.taskUndoneNum = taskUndoneNum;
+    }
+
+    public String getTaskUndoneNum()
+    {
+        return taskUndoneNum;
+    }
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setDelFlag(Integer delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Integer getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(Long createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public Long getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(Long updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public Long getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("plantId", getPlantId())
+            .append("taskName", getTaskName())
+            .append("taskCode", getTaskCode())
+            .append("taskType", getTaskType())
+            .append("startTime", getStartTime())
+            .append("endTime", getEndTime())
+            .append("recipient", getRecipient())
+            .append("taskNum", getTaskNum())
+            .append("taskDoneNum", getTaskDoneNum())
+            .append("taskUndoneNum", getTaskUndoneNum())
+            .append("status", getStatus())
+            .append("remarks", getRemarks())
+            .append("deptId", getDeptId())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .toString();
+    }
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/task/mapper/TTaskRepairMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.task.mapper;
+
+import java.util.List;
+import com.ruoyi.project.task.domain.TTaskRepair;
+
+/**
+ * 维修任务Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-11-30
+ */
+public interface TTaskRepairMapper 
+{
+    /**
+     * 查询维修任务
+     * 
+     * @param id 维修任务主键
+     * @return 维修任务
+     */
+    public TTaskRepair selectTTaskRepairById(Long id);
+
+    /**
+     * 查询维修任务列表
+     * 
+     * @param tTaskRepair 维修任务
+     * @return 维修任务集合
+     */
+    public List<TTaskRepair> selectTTaskRepairList(TTaskRepair tTaskRepair);
+
+    /**
+     * 新增维修任务
+     * 
+     * @param tTaskRepair 维修任务
+     * @return 结果
+     */
+    public int insertTTaskRepair(TTaskRepair tTaskRepair);
+
+    /**
+     * 修改维修任务
+     * 
+     * @param tTaskRepair 维修任务
+     * @return 结果
+     */
+    public int updateTTaskRepair(TTaskRepair tTaskRepair);
+
+    /**
+     * 删除维修任务
+     * 
+     * @param id 维修任务主键
+     * @return 结果
+     */
+    public int deleteTTaskRepairById(Long id);
+
+    /**
+     * 批量删除维修任务
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTTaskRepairByIds(Long[] ids);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/task/service/ITTaskRepairService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.task.service;
+
+import java.util.List;
+import com.ruoyi.project.task.domain.TTaskRepair;
+
+/**
+ * 维修任务Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-11-30
+ */
+public interface ITTaskRepairService 
+{
+    /**
+     * 查询维修任务
+     * 
+     * @param id 维修任务主键
+     * @return 维修任务
+     */
+    public TTaskRepair selectTTaskRepairById(Long id);
+
+    /**
+     * 查询维修任务列表
+     * 
+     * @param tTaskRepair 维修任务
+     * @return 维修任务集合
+     */
+    public List<TTaskRepair> selectTTaskRepairList(TTaskRepair tTaskRepair);
+
+    /**
+     * 新增维修任务
+     * 
+     * @param tTaskRepair 维修任务
+     * @return 结果
+     */
+    public int insertTTaskRepair(TTaskRepair tTaskRepair);
+
+    /**
+     * 修改维修任务
+     * 
+     * @param tTaskRepair 维修任务
+     * @return 结果
+     */
+    public int updateTTaskRepair(TTaskRepair tTaskRepair);
+
+    /**
+     * 批量删除维修任务
+     * 
+     * @param ids 需要删除的维修任务主键集合
+     * @return 结果
+     */
+    public int deleteTTaskRepairByIds(Long[] ids);
+
+    /**
+     * 删除维修任务信息
+     * 
+     * @param id 维修任务主键
+     * @return 结果
+     */
+    public int deleteTTaskRepairById(Long id);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/task/service/impl/TTaskRepairServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.task.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.task.mapper.TTaskRepairMapper;
+import com.ruoyi.project.task.domain.TTaskRepair;
+import com.ruoyi.project.task.service.ITTaskRepairService;
+
+/**
+ * 维修任务Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-11-30
+ */
+@Service
+public class TTaskRepairServiceImpl implements ITTaskRepairService 
+{
+    @Autowired
+    private TTaskRepairMapper tTaskRepairMapper;
+
+    /**
+     * 查询维修任务
+     * 
+     * @param id 维修任务主键
+     * @return 维修任务
+     */
+    @Override
+    public TTaskRepair selectTTaskRepairById(Long id)
+    {
+        return tTaskRepairMapper.selectTTaskRepairById(id);
+    }
+
+    /**
+     * 查询维修任务列表
+     * 
+     * @param tTaskRepair 维修任务
+     * @return 维修任务
+     */
+    @Override
+    public List<TTaskRepair> selectTTaskRepairList(TTaskRepair tTaskRepair)
+    {
+        return tTaskRepairMapper.selectTTaskRepairList(tTaskRepair);
+    }
+
+    /**
+     * 新增维修任务
+     * 
+     * @param tTaskRepair 维修任务
+     * @return 结果
+     */
+    @Override
+    public int insertTTaskRepair(TTaskRepair tTaskRepair)
+    {
+        return tTaskRepairMapper.insertTTaskRepair(tTaskRepair);
+    }
+
+    /**
+     * 修改维修任务
+     * 
+     * @param tTaskRepair 维修任务
+     * @return 结果
+     */
+    @Override
+    public int updateTTaskRepair(TTaskRepair tTaskRepair)
+    {
+        return tTaskRepairMapper.updateTTaskRepair(tTaskRepair);
+    }
+
+    /**
+     * 批量删除维修任务
+     * 
+     * @param ids 需要删除的维修任务主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTTaskRepairByIds(Long[] ids)
+    {
+        return tTaskRepairMapper.deleteTTaskRepairByIds(ids);
+    }
+
+    /**
+     * 删除维修任务信息
+     * 
+     * @param id 维修任务主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTTaskRepairById(Long id)
+    {
+        return tTaskRepairMapper.deleteTTaskRepairById(id);
+    }
+}

+ 141 - 0
master/src/main/resources/mybatis/task/TTaskRepairMapper.xml

@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.project.task.mapper.TTaskRepairMapper">
+
+    <resultMap type="TTaskRepair" id="TTaskRepairResult">
+        <result property="id"    column="id"    />
+        <result property="plantId"    column="plant_id"    />
+        <result property="taskName"    column="task_name"    />
+        <result property="taskCode"    column="task_code"    />
+        <result property="taskType"    column="task_type"    />
+        <result property="startTime"    column="start_time"    />
+        <result property="endTime"    column="end_time"    />
+        <result property="recipient"    column="recipient"    />
+        <result property="taskNum"    column="task_num"    />
+        <result property="taskDoneNum"    column="task_done_num"    />
+        <result property="taskUndoneNum"    column="task_undone_num"    />
+        <result property="status"    column="status"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+    </resultMap>
+
+    <sql id="selectTTaskRepairVo">
+        select id, plant_id, task_name, task_code, task_type, start_time, end_time, recipient, task_num, task_done_num, task_undone_num, status, remarks, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_task_repair
+    </sql>
+
+    <select id="selectTTaskRepairList" parameterType="TTaskRepair" resultMap="TTaskRepairResult">
+        <include refid="selectTTaskRepairVo"/>
+        <where>
+            <if test="plantId != null "> and plant_id = #{plantId}</if>
+            <if test="taskName != null  and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
+            <if test="taskCode != null  and taskCode != ''"> and task_code = #{taskCode}</if>
+            <if test="taskType != null  and taskType != ''"> and task_type = #{taskType}</if>
+            <if test="startTime != null "> and start_time = #{startTime}</if>
+            <if test="endTime != null "> and end_time = #{endTime}</if>
+            <if test="recipient != null "> and recipient = #{recipient}</if>
+            <if test="taskNum != null  and taskNum != ''"> and task_num = #{taskNum}</if>
+            <if test="taskDoneNum != null  and taskDoneNum != ''"> and task_done_num = #{taskDoneNum}</if>
+            <if test="taskUndoneNum != null  and taskUndoneNum != ''"> and task_undone_num = #{taskUndoneNum}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="createrCode != null "> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+        and del_flag = 0
+        </where>
+    </select>
+
+    <select id="selectTTaskRepairById" parameterType="Long" resultMap="TTaskRepairResult">
+        <include refid="selectTTaskRepairVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTTaskRepair" parameterType="TTaskRepair" useGeneratedKeys="true" keyProperty="id">
+        insert into t_task_repair
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="plantId != null">plant_id,</if>
+            <if test="taskName != null">task_name,</if>
+            <if test="taskCode != null">task_code,</if>
+            <if test="taskType != null">task_type,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="recipient != null">recipient,</if>
+            <if test="taskNum != null">task_num,</if>
+            <if test="taskDoneNum != null">task_done_num,</if>
+            <if test="taskUndoneNum != null">task_undone_num,</if>
+            <if test="status != null">status,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="plantId != null">#{plantId},</if>
+            <if test="taskName != null">#{taskName},</if>
+            <if test="taskCode != null">#{taskCode},</if>
+            <if test="taskType != null">#{taskType},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="recipient != null">#{recipient},</if>
+            <if test="taskNum != null">#{taskNum},</if>
+            <if test="taskDoneNum != null">#{taskDoneNum},</if>
+            <if test="taskUndoneNum != null">#{taskUndoneNum},</if>
+            <if test="status != null">#{status},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTTaskRepair" parameterType="TTaskRepair">
+        update t_task_repair
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="plantId != null">plant_id = #{plantId},</if>
+            <if test="taskName != null">task_name = #{taskName},</if>
+            <if test="taskCode != null">task_code = #{taskCode},</if>
+            <if test="taskType != null">task_type = #{taskType},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="recipient != null">recipient = #{recipient},</if>
+            <if test="taskNum != null">task_num = #{taskNum},</if>
+            <if test="taskDoneNum != null">task_done_num = #{taskDoneNum},</if>
+            <if test="taskUndoneNum != null">task_undone_num = #{taskUndoneNum},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTTaskRepairById" parameterType="Long">
+        update t_task_repair set del_flag=1 where id = #{id}
+    </delete>
+
+    <delete id="deleteTTaskRepairByIds" parameterType="String">
+        update t_task_repair set del_flag=1 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 44 - 0
ui/src/api/task/repair.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询维修任务列表
+export function listRepair(query) {
+  return request({
+    url: '/task/repair/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询维修任务详细
+export function getRepair(id) {
+  return request({
+    url: '/task/repair/' + id,
+    method: 'get'
+  })
+}
+
+// 新增维修任务
+export function addRepair(data) {
+  return request({
+    url: '/task/repair',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改维修任务
+export function updateRepair(data) {
+  return request({
+    url: '/task/repair',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除维修任务
+export function delRepair(id) {
+  return request({
+    url: '/task/repair/' + id,
+    method: 'delete'
+  })
+}

BIN
ui/src/assets/images/login-background.jpg


BIN
ui/src/assets/images/login-background2.jpg


+ 401 - 0
ui/src/views/check/inspectionCheck/index.vue

@@ -0,0 +1,401 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="任务名称" prop="taskName">
+        <el-input
+          v-model="queryParams.taskName"
+          placeholder="请输入任务名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="任务起始时间" prop="startTime">
+        <el-date-picker clearable
+                        v-model="queryParams.startTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="请选择任务起始时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="任务截止时间" prop="endTime">
+        <el-date-picker clearable
+                        v-model="queryParams.endTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="请选择任务截止时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click=""
+          v-hasPermi="['check:inspection:export']"
+        >导出任务清单
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="inspectionList" @selection-change="handleSelectionChange"
+              :height="clientHeight" border :cell-style="tableCellStyle">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="是否超时" align="center" prop="timeOut" fixed="left" width="85"/>
+      <el-table-column label="装置名称" align="center" prop="plantName" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="计划名称" align="center" prop="planName" :show-overflow-tooltip="true" width="280"/>
+      <el-table-column label="任务名称" align="center" prop="taskName" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="任务编号" align="center" prop="taskCode" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="任务类型" align="center" prop="taskType" :show-overflow-tooltip="true" :formatter="taskTypeFormat"
+       width="130"/>
+      <el-table-column label="任务起始时间" align="center" prop="startTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="任务截止时间" align="center" prop="endTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="接收人" align="center" prop="recipient" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="任务点数" align="center" prop="taskNum" :show-overflow-tooltip="true" width="100"/>
+      <el-table-column label="已检测点数" align="center" prop="taskDoneNum" :show-overflow-tooltip="true" width="100"/>
+      <el-table-column label="未检测点数" align="center" prop="taskUndoneNum" :show-overflow-tooltip="true"
+                       width="100"/>
+      <el-table-column label="完成率" align="center" width="250" prop="percentage">
+        <template slot-scope="scope">
+          <el-progress :text-inside="true" :stroke-width="14" :percentage="scope.row.percentage"
+                       status="success"></el-progress>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-s-order"
+            @click=""
+          >检测点清单
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改检测任务对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="检测计划" prop="planId">
+          <el-select v-model="form.planId" placeholder="请选择计划" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in planOperation"
+              :key="dict.id"
+              :label="dict.inspectionPlanName"
+              :value="dict.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="任务名称" prop="taskName">
+          <el-input v-model="form.taskName" placeholder="请输入任务名称"/>
+        </el-form-item>
+        <el-form-item label="任务编号" prop="taskCode">
+          <el-input v-model="form.taskCode" placeholder="请输入任务编号"/>
+        </el-form-item>
+        <el-form-item label="任务类型" prop="planId">
+          <el-select v-model="form.taskType" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in taskTypeOperation"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="任务起始时间" prop="startTime">
+          <el-date-picker clearable style="width: 100%"
+                          v-model="form.startTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="请选择任务起始时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="任务截止时间" prop="endTime">
+          <el-date-picker clearable style="width: 100%"
+                          v-model="form.endTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="请选择任务截止时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="接收人" prop="recipient">
+          <el-input v-model="form.recipient" placeholder="请输入接收人"/>
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  addInspection,
+  delInspection,
+  divideInspection,
+  getInspection,
+  listInspection,
+  updateInspection
+} from "@/api/task/inspection";
+import {getAllPlan} from "@/api/task/plan";
+
+export default {
+  name: "InspectionCheck",
+  data() {
+    return {
+      taskTypeOperation: [],
+      planOperation: [],
+      divideOperation: [],
+      // 页面高度
+      clientHeight: 300,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      status: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 检测任务表格数据
+      inspectionList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        plantId: null,
+        planId: null,
+        taskName: null,
+        taskCode: null,
+        taskType: null,
+        startTime: null,
+        endTime: null,
+        recipient: null,
+        taskNum: null,
+        taskDoneNum: null,
+        taskUndoneNum: null,
+        status: null,
+        remarks: null,
+        deptId: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    this.getList();
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    });
+    this.getDicts("task_type").then(response => {
+      this.taskTypeOperation = response.data;
+    });
+    this.getDicts("divide_status").then(response => {
+      this.divideOperation = response.data;
+    });
+    getAllPlan().then(response => {
+      this.planOperation = response.data;
+    });
+  },
+  methods: {
+    tableCellStyle({row, column, rowIndex, columnIndex}) {
+      if (columnIndex === 1 && row.timeOut === '是') {
+        return "color:#ff0000;";
+      }
+      if (columnIndex === 1 && row.timeOut === '否') {
+        return "color:#00cc00;";
+      }
+      if (columnIndex === 6 && row.taskType == 2) {
+        return "color:#ff0000;";
+      }
+      if (columnIndex === 6 && row.taskType == 1) {
+        return "color:#00cc00;";
+      }
+    },
+    taskTypeFormat(row, column) {
+      return this.selectDictLabel(this.taskTypeOperation, row.taskType);
+    },
+    divideFormat(row, column) {
+      return this.selectDictLabel(this.divideOperation, row.status);
+    },
+    /** 查询检测任务列表 */
+    getList() {
+      this.loading = true;
+      listInspection(this.queryParams).then(response => {
+        this.inspectionList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        plantId: null,
+        planId: null,
+        taskName: null,
+        taskCode: null,
+        taskType: null,
+        startTime: null,
+        endTime: null,
+        recipient: null,
+        taskNum: null,
+        taskDoneNum: null,
+        taskUndoneNum: null,
+        status: "0",
+        percentage: 0,
+        remarks: null,
+        deptId: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.status = selection.map(item => item.status)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加检测任务";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getInspection(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改检测任务";
+      });
+    },
+    handleDivide() {
+      console.log(this.status)
+      for (const statusKey in this.status) {
+        if (statusKey === "1") {
+          this.$alert('已分配的任务不可再次分配!', '注意!', {
+            confirmButtonText: '确定',
+          });
+          return
+        }
+      }
+      this.reset();
+      const ids =  this.ids
+      this.$modal.confirm('是否确认分配?').then(function () {
+        return divideInspection(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("分配成功");
+      }).catch(() => {
+        this.$modal.msg("取消分配");
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateInspection(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addInspection(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除数据项?').then(function () {
+        return delInspection(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('task/inspection/export', {
+        ...this.queryParams
+      }, `inspection_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 41 - 1
ui/src/views/task/inspection/index.vue

@@ -9,6 +9,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="任务类型" prop="planId">
+        <el-select v-model="form.taskType" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
+          <el-option
+            v-for="dict in taskTypeOperation"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="任务起始时间" prop="startTime">
         <el-date-picker clearable
                         v-model="queryParams.startTime"
@@ -79,6 +89,17 @@
         >确认分配
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click=""
+          v-hasPermi="['task:inspection:export']"
+        >导出任务清单
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -104,7 +125,7 @@
         </template>
       </el-table-column>
       <el-table-column label="接收人" align="center" prop="recipient" :show-overflow-tooltip="true" width="130"/>
-      <el-table-column label="任务点数" align="center" prop="taskNum" :show-overflow-tooltip="true" width="100"/>
+      <el-table-column label="检测点数" align="center" prop="taskNum" :show-overflow-tooltip="true" width="100"/>
       <el-table-column label="已检测点数" align="center" prop="taskDoneNum" :show-overflow-tooltip="true" width="100"/>
       <el-table-column label="未检测点数" align="center" prop="taskUndoneNum" :show-overflow-tooltip="true"
                        width="100"/>
@@ -117,6 +138,13 @@
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="130"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-s-order"
+            @click=""
+          >检测点清单
+          </el-button>
           <el-button
             size="mini"
             type="text"
@@ -297,6 +325,18 @@ export default {
       if (columnIndex === 1 && row.status == 1) {
         return "color:#00cc00;";
       }
+      if (columnIndex === 2 && row.timeOut === '是') {
+        return "color:#ff0000;";
+      }
+      if (columnIndex === 2 && row.timeOut === '否') {
+        return "color:#00cc00;";
+      }
+      if (columnIndex === 7 && row.taskType == 2) {
+        return "color:#ff0000;";
+      }
+      if (columnIndex === 7 && row.taskType == 1) {
+        return "color:#00cc00;";
+      }
     },
     taskTypeFormat(row, column) {
       return this.selectDictLabel(this.taskTypeOperation, row.taskType);

+ 427 - 0
ui/src/views/task/repair/index.vue

@@ -0,0 +1,427 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="任务名称" prop="taskName">
+        <el-input
+          v-model="queryParams.taskName"
+          placeholder="请输入任务名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="任务类型" prop="planId">
+        <el-select v-model="form.taskType" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
+          <el-option
+            v-for="dict in taskTypeOperation"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="任务起始时间" prop="startTime">
+        <el-date-picker clearable
+                        v-model="queryParams.startTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="请选择任务起始时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="任务截止时间" prop="endTime">
+        <el-date-picker clearable
+                        v-model="queryParams.endTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="请选择任务截止时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @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="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['task:repair:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['task:repair:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['task:repair:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-check"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDivide"
+          v-hasPermi="['task:inspection:edit']"
+        >确认分配
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click=""
+          v-hasPermi="['task:repair:export']"
+        >导出任务清单
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="repairList" @selection-change="handleSelectionChange" :height="clientHeight"
+              border>
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="状态" align="center" prop="status" width="85" :formatter="divideFormat"/>
+      <el-table-column label="是否超时" align="center" prop="timeOut" fixed="left" width="85"/>
+      <el-table-column label="装置名称" align="center" prop="plantName" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="装置id" align="center" prop="plantId" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="任务名称" align="center" prop="taskName" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="任务编号" align="center" prop="taskCode" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="任务类型" align="center" prop="taskType" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="任务起始时间" align="center" prop="startTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="任务截止时间" align="center" prop="endTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="接收人" align="center" prop="recipient" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="维修点数" align="center" prop="taskNum" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="已维修点数" align="center" prop="taskDoneNum" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="未维修点数" align="center" prop="taskUndoneNum" :show-overflow-tooltip="true"
+                       width="130"/>
+      <el-table-column label="完成率" align="center" width="250" prop="percentage">
+        <template slot-scope="scope">
+          <el-progress :text-inside="true" :stroke-width="14" :percentage="scope.row.percentage"
+                       status="success"></el-progress>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="130">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-s-order"
+            @click=""
+          >维修点清单
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['task:repair:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['task:repair:remove']"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改维修任务对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="任务名称" prop="taskName">
+          <el-input v-model="form.taskName" placeholder="请输入任务名称"/>
+        </el-form-item>
+        <el-form-item label="任务编号" prop="taskCode">
+          <el-input v-model="form.taskCode" placeholder="请输入任务编号"/>
+        </el-form-item>
+        <el-form-item label="任务类型" prop="planId">
+          <el-select v-model="form.taskType" placeholder="请选择任务类型" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in taskTypeOperation"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="任务起始时间" prop="startTime">
+          <el-date-picker clearable style="width: 100%"
+                          v-model="form.startTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="请选择任务起始时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="任务截止时间" prop="endTime">
+          <el-date-picker clearable style="width: 100%"
+                          v-model="form.endTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="请选择任务截止时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="接收人" prop="recipient">
+          <el-input v-model="form.recipient" placeholder="请输入接收人"/>
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {listRepair, getRepair, delRepair, addRepair, updateRepair} from "@/api/task/repair";
+import {divideInspection} from "@/api/task/inspection";
+
+export default {
+  name: "Repair",
+  data() {
+    return {
+      divideOperation: [],
+      // 页面高度
+      clientHeight: 300,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 维修任务表格数据
+      repairList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        plantId: null,
+        taskName: null,
+        taskCode: null,
+        taskType: null,
+        startTime: null,
+        endTime: null,
+        recipient: null,
+        taskNum: null,
+        taskDoneNum: null,
+        taskUndoneNum: null,
+        status: null,
+        remarks: null,
+        deptId: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    this.getList();
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    });
+    this.getDicts("divide_status").then(response => {
+      this.divideOperation = response.data;
+    });
+  },
+  methods: {
+    handleDivide() {
+      console.log(this.status)
+      for (const statusKey in this.status) {
+        if (statusKey === "1") {
+          this.$alert('已分配的任务不可再次分配!', '注意!', {
+            confirmButtonText: '确定',
+          });
+          return
+        }
+      }
+      this.reset();
+      const ids =  this.ids
+      this.$modal.confirm('是否确认分配?').then(function () {
+        //return divideRepair(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("分配成功");
+      }).catch(() => {
+        this.$modal.msg("取消分配");
+      });
+    },
+    divideFormat(row, column) {
+      return this.selectDictLabel(this.divideOperation, row.status);
+    },
+    /** 查询维修任务列表 */
+    getList() {
+      this.loading = true;
+      listRepair(this.queryParams).then(response => {
+        this.repairList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        plantId: null,
+        taskName: null,
+        taskCode: null,
+        taskType: null,
+        startTime: null,
+        endTime: null,
+        recipient: null,
+        taskNum: null,
+        taskDoneNum: null,
+        taskUndoneNum: null,
+        status: "0",
+        remarks: null,
+        deptId: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加维修任务";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getRepair(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改维修任务";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateRepair(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addRepair(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除维修任务编号为"' + ids + '"的数据项?').then(function () {
+        return delRepair(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('task/repair/export', {
+        ...this.queryParams
+      }, `repair_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>