hdy
2024-03-22 4ca73594828312fba2fd60afaae3928981ca6701
设备保养计划修改
已添加10个文件
1807 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/controller/EmInspectionPlanInfoController.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/domain/EmInspectionPlanInfo.java 417 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/mapper/EmInspectionPlanInfoMapper.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/service/IEmInspectionPlanInfoService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/service/impl/EmInspectionPlanInfoServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/em/inspectionPlanInfo/EmInspectionPlanInfoMapper.xml 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/em/inspectionPlanInfo/inspectionPlanInfo.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/inspectionPlanInfo/index.vue 519 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/inspectionPlanInfo/machinery.vue 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/inspectionPlanInfo/subject.vue 152 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/controller/EmInspectionPlanInfoController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
package com.jcdm.main.em.inspectionPlanInfo.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.jcdm.common.annotation.Log;
import com.jcdm.common.core.controller.BaseController;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.main.em.inspectionPlanInfo.domain.EmInspectionPlanInfo;
import com.jcdm.main.em.inspectionPlanInfo.service.IEmInspectionPlanInfoService;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’Controller
 *
 * @author Yi
 * @date 2024-03-19
 */
@RestController
@RequestMapping("/em/inspectionPlanInfo")
public class EmInspectionPlanInfoController extends BaseController
{
    @Autowired
    private IEmInspectionPlanInfoService emInspectionPlanInfoService;
    /**
     * æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’列表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanInfo:list')")
    @GetMapping("/list")
    public TableDataInfo list(EmInspectionPlanInfo emInspectionPlanInfo)
    {
        startPage();
        List<EmInspectionPlanInfo> list = emInspectionPlanInfoService.selectEmInspectionPlanInfoList(emInspectionPlanInfo);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºè®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’列表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanInfo:export')")
    @Log(title = "设备点检保养计划", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, EmInspectionPlanInfo emInspectionPlanInfo)
    {
        List<EmInspectionPlanInfo> list = emInspectionPlanInfoService.selectEmInspectionPlanInfoList(emInspectionPlanInfo);
        ExcelUtil<EmInspectionPlanInfo> util = new ExcelUtil<EmInspectionPlanInfo>(EmInspectionPlanInfo.class);
        util.exportExcel(response, list, "设备点检保养计划数据");
    }
    /**
     * èŽ·å–设备点检保养计划详细信息
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanInfo:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(emInspectionPlanInfoService.selectEmInspectionPlanInfoById(id));
    }
    /**
     * æ–°å¢žè®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanInfo:add')")
    @Log(title = "设备点检保养计划", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EmInspectionPlanInfo emInspectionPlanInfo)
    {
        return toAjax(emInspectionPlanInfoService.insertEmInspectionPlanInfo(emInspectionPlanInfo));
    }
    /**
     * ä¿®æ”¹è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanInfo:edit')")
    @Log(title = "设备点检保养计划", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EmInspectionPlanInfo emInspectionPlanInfo)
    {
        return toAjax(emInspectionPlanInfoService.updateEmInspectionPlanInfo(emInspectionPlanInfo));
    }
    /**
     * åˆ é™¤è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanInfo:remove')")
    @Log(title = "设备点检保养计划", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(emInspectionPlanInfoService.deleteEmInspectionPlanInfoByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/domain/EmInspectionPlanInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,417 @@
package com.jcdm.main.em.inspectionPlanInfo.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
/**
 * è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’对象 em_inspection_plan_info
 *
 * @author Yi
 * @date 2024-03-19
 */
public class EmInspectionPlanInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
    /** è®¡åˆ’编号 */
    @Excel(name = "计划编号")
    private String planCode;
    /** è®¡åˆ’名称 */
    @Excel(name = "计划名称")
    private String planName;
    /** è®¡åˆ’类型 */
    @Excel(name = "计划类型")
    private String planType;
    /** çŠ¶æ€ */
    @Excel(name = "状态")
    private String state;
    /** é¢‘率 */
    @Excel(name = "频率")
    private String frequency;
    /** ç»´åº¦ */
    @Excel(name = "维度")
    private String dimension;
    /** ä¸Šæ¬¡ç”Ÿæˆæ—¶é—´ */
    @Excel(name = "上次生成时间")
    private String lastGenerationTime;
    /** å¼€å§‹æ—¶é—´ */
    @Excel(name = "开始时间")
    private String startTime;
    /** ç»“束时间 */
    @Excel(name = "结束时间")
    private String endTime;
    /** è®¾å¤‡æ¸…单 */
    @Excel(name = "设备清单")
    private String devices;
    /** ç‚¹æ£€é¡¹ç›® */
    @Excel(name = "点检项目")
    private String inspectionItems;
    /** å¤‡æ³¨ */
    @Excel(name = "备注")
    private String remarks;
    /** åˆ›å»ºäºº */
    @Excel(name = "创建人")
    private String createUser;
    /** ä¿®æ”¹äºº */
    @Excel(name = "修改人")
    private String updateUser;
    /** é¢„留字段1 */
    @Excel(name = "预留字段1")
    private String spareField1;
    /** é¢„留字段2 */
    @Excel(name = "预留字段2")
    private String spareField2;
    /** é¢„留字段3 */
    @Excel(name = "预留字段3")
    private String spareField3;
    /** é¢„留字段4 */
    @Excel(name = "预留字段4")
    private String spareField4;
    /** è®¾å¤‡ç¼–码 */
    @Excel(name = "设备编码")
    private String equipmentCode;
    /** è®¾å¤‡åç§° */
    @Excel(name = "设备名称")
    private String equipmentName;
    /** å“ç‰Œ */
    @Excel(name = "品牌")
    private String equipmentBrand;
    /** è§„格型号 */
    @Excel(name = "规格型号")
    private String equipmentSpec;
    /** é¡¹ç›®ç¼–号 */
    @Excel(name = "项目编号")
    private String itemsCode;
    /** é¡¹ç›®åç§° */
    @Excel(name = "项目名称")
    private String itemsName;
    /** é¡¹ç›®ç±»åž‹ */
    @Excel(name = "项目类型")
    private String itemsType;
    /** æ ‡å‡† */
    @Excel(name = "标准")
    private String standard;
    /** é¡¹ç›®å†…容 */
    @Excel(name = "项目内容")
    private String itemsContent;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setPlanCode(String planCode)
    {
        this.planCode = planCode;
    }
    public String getPlanCode()
    {
        return planCode;
    }
    public void setPlanName(String planName)
    {
        this.planName = planName;
    }
    public String getPlanName()
    {
        return planName;
    }
    public void setPlanType(String planType)
    {
        this.planType = planType;
    }
    public String getPlanType()
    {
        return planType;
    }
    public void setState(String state)
    {
        this.state = state;
    }
    public String getState()
    {
        return state;
    }
    public void setFrequency(String frequency)
    {
        this.frequency = frequency;
    }
    public String getFrequency()
    {
        return frequency;
    }
    public void setDimension(String dimension)
    {
        this.dimension = dimension;
    }
    public String getDimension()
    {
        return dimension;
    }
    public void setLastGenerationTime(String lastGenerationTime)
    {
        this.lastGenerationTime = lastGenerationTime;
    }
    public String getLastGenerationTime()
    {
        return lastGenerationTime;
    }
    public void setStartTime(String startTime)
    {
        this.startTime = startTime;
    }
    public String getStartTime()
    {
        return startTime;
    }
    public void setEndTime(String endTime)
    {
        this.endTime = endTime;
    }
    public String getEndTime()
    {
        return endTime;
    }
    public void setDevices(String devices)
    {
        this.devices = devices;
    }
    public String getDevices()
    {
        return devices;
    }
    public void setInspectionItems(String inspectionItems)
    {
        this.inspectionItems = inspectionItems;
    }
    public String getInspectionItems()
    {
        return inspectionItems;
    }
    public void setRemarks(String remarks)
    {
        this.remarks = remarks;
    }
    public String getRemarks()
    {
        return remarks;
    }
    public void setCreateUser(String createUser)
    {
        this.createUser = createUser;
    }
    public String getCreateUser()
    {
        return createUser;
    }
    public void setUpdateUser(String updateUser)
    {
        this.updateUser = updateUser;
    }
    public String getUpdateUser()
    {
        return updateUser;
    }
    public void setSpareField1(String spareField1)
    {
        this.spareField1 = spareField1;
    }
    public String getSpareField1()
    {
        return spareField1;
    }
    public void setSpareField2(String spareField2)
    {
        this.spareField2 = spareField2;
    }
    public String getSpareField2()
    {
        return spareField2;
    }
    public void setSpareField3(String spareField3)
    {
        this.spareField3 = spareField3;
    }
    public String getSpareField3()
    {
        return spareField3;
    }
    public void setSpareField4(String spareField4)
    {
        this.spareField4 = spareField4;
    }
    public String getSpareField4()
    {
        return spareField4;
    }
    public void setEquipmentCode(String equipmentCode)
    {
        this.equipmentCode = equipmentCode;
    }
    public String getEquipmentCode()
    {
        return equipmentCode;
    }
    public void setEquipmentName(String equipmentName)
    {
        this.equipmentName = equipmentName;
    }
    public String getEquipmentName()
    {
        return equipmentName;
    }
    public void setEquipmentBrand(String equipmentBrand)
    {
        this.equipmentBrand = equipmentBrand;
    }
    public String getEquipmentBrand()
    {
        return equipmentBrand;
    }
    public void setEquipmentSpec(String equipmentSpec)
    {
        this.equipmentSpec = equipmentSpec;
    }
    public String getEquipmentSpec()
    {
        return equipmentSpec;
    }
    public void setItemsCode(String itemsCode)
    {
        this.itemsCode = itemsCode;
    }
    public String getItemsCode()
    {
        return itemsCode;
    }
    public void setItemsName(String itemsName)
    {
        this.itemsName = itemsName;
    }
    public String getItemsName()
    {
        return itemsName;
    }
    public void setItemsType(String itemsType)
    {
        this.itemsType = itemsType;
    }
    public String getItemsType()
    {
        return itemsType;
    }
    public void setStandard(String standard)
    {
        this.standard = standard;
    }
    public String getStandard()
    {
        return standard;
    }
    public void setItemsContent(String itemsContent)
    {
        this.itemsContent = itemsContent;
    }
    public String getItemsContent()
    {
        return itemsContent;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("planCode", getPlanCode())
            .append("planName", getPlanName())
            .append("planType", getPlanType())
            .append("state", getState())
            .append("frequency", getFrequency())
            .append("dimension", getDimension())
            .append("lastGenerationTime", getLastGenerationTime())
            .append("startTime", getStartTime())
            .append("endTime", getEndTime())
            .append("devices", getDevices())
            .append("inspectionItems", getInspectionItems())
            .append("remarks", getRemarks())
            .append("createTime", getCreateTime())
            .append("createUser", getCreateUser())
            .append("updateTime", getUpdateTime())
            .append("updateUser", getUpdateUser())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .append("spareField3", getSpareField3())
            .append("spareField4", getSpareField4())
            .append("equipmentCode", getEquipmentCode())
            .append("equipmentName", getEquipmentName())
            .append("equipmentBrand", getEquipmentBrand())
            .append("equipmentSpec", getEquipmentSpec())
            .append("itemsCode", getItemsCode())
            .append("itemsName", getItemsName())
            .append("itemsType", getItemsType())
            .append("standard", getStandard())
            .append("itemsContent", getItemsContent())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/mapper/EmInspectionPlanInfoMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionPlanInfo.mapper;
import java.util.List;
import com.jcdm.main.em.inspectionPlanInfo.domain.EmInspectionPlanInfo;
/**
 * è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’Mapper接口
 *
 * @author Yi
 * @date 2024-03-19
 */
public interface EmInspectionPlanInfoMapper
{
    /**
     * æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param id è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    public EmInspectionPlanInfo selectEmInspectionPlanInfoById(Long id);
    /**
     * æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’列表
     *
     * @param emInspectionPlanInfo è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’集合
     */
    public List<EmInspectionPlanInfo> selectEmInspectionPlanInfoList(EmInspectionPlanInfo emInspectionPlanInfo);
    /**
     * æ–°å¢žè®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlanInfo è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    public int insertEmInspectionPlanInfo(EmInspectionPlanInfo emInspectionPlanInfo);
    /**
     * ä¿®æ”¹è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlanInfo è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    public int updateEmInspectionPlanInfo(EmInspectionPlanInfo emInspectionPlanInfo);
    /**
     * åˆ é™¤è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param id è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanInfoById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanInfoByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/service/IEmInspectionPlanInfoService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionPlanInfo.service;
import java.util.List;
import com.jcdm.main.em.inspectionPlanInfo.domain.EmInspectionPlanInfo;
/**
 * è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’Service接口
 *
 * @author Yi
 * @date 2024-03-19
 */
public interface IEmInspectionPlanInfoService
{
    /**
     * æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param id è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    public EmInspectionPlanInfo selectEmInspectionPlanInfoById(Long id);
    /**
     * æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’列表
     *
     * @param emInspectionPlanInfo è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’集合
     */
    public List<EmInspectionPlanInfo> selectEmInspectionPlanInfoList(EmInspectionPlanInfo emInspectionPlanInfo);
    /**
     * æ–°å¢žè®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlanInfo è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    public int insertEmInspectionPlanInfo(EmInspectionPlanInfo emInspectionPlanInfo);
    /**
     * ä¿®æ”¹è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlanInfo è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    public int updateEmInspectionPlanInfo(EmInspectionPlanInfo emInspectionPlanInfo);
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param ids éœ€è¦åˆ é™¤çš„设备点检保养计划主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanInfoByIds(Long[] ids);
    /**
     * åˆ é™¤è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’信息
     *
     * @param id è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanInfoById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanInfo/service/impl/EmInspectionPlanInfoServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
package com.jcdm.main.em.inspectionPlanInfo.service.impl;
import java.util.List;
import com.jcdm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcdm.main.em.inspectionPlanInfo.mapper.EmInspectionPlanInfoMapper;
import com.jcdm.main.em.inspectionPlanInfo.domain.EmInspectionPlanInfo;
import com.jcdm.main.em.inspectionPlanInfo.service.IEmInspectionPlanInfoService;
/**
 * è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’Service业务层处理
 *
 * @author Yi
 * @date 2024-03-19
 */
@Service
public class EmInspectionPlanInfoServiceImpl implements IEmInspectionPlanInfoService
{
    @Autowired
    private EmInspectionPlanInfoMapper emInspectionPlanInfoMapper;
    /**
     * æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param id è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @Override
    public EmInspectionPlanInfo selectEmInspectionPlanInfoById(Long id)
    {
        return emInspectionPlanInfoMapper.selectEmInspectionPlanInfoById(id);
    }
    /**
     * æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’列表
     *
     * @param emInspectionPlanInfo è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     */
    @Override
    public List<EmInspectionPlanInfo> selectEmInspectionPlanInfoList(EmInspectionPlanInfo emInspectionPlanInfo)
    {
        return emInspectionPlanInfoMapper.selectEmInspectionPlanInfoList(emInspectionPlanInfo);
    }
    /**
     * æ–°å¢žè®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlanInfo è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    @Override
    public int insertEmInspectionPlanInfo(EmInspectionPlanInfo emInspectionPlanInfo)
    {
        emInspectionPlanInfo.setCreateTime(DateUtils.getNowDate());
        return emInspectionPlanInfoMapper.insertEmInspectionPlanInfo(emInspectionPlanInfo);
    }
    /**
     * ä¿®æ”¹è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param emInspectionPlanInfo è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     * @return ç»“æžœ
     */
    @Override
    public int updateEmInspectionPlanInfo(EmInspectionPlanInfo emInspectionPlanInfo)
    {
        emInspectionPlanInfo.setUpdateTime(DateUtils.getNowDate());
        return emInspectionPlanInfoMapper.updateEmInspectionPlanInfo(emInspectionPlanInfo);
    }
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
     *
     * @param ids éœ€è¦åˆ é™¤çš„设备点检保养计划主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionPlanInfoByIds(Long[] ids)
    {
        return emInspectionPlanInfoMapper.deleteEmInspectionPlanInfoByIds(ids);
    }
    /**
     * åˆ é™¤è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’信息
     *
     * @param id è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionPlanInfoById(Long id)
    {
        return emInspectionPlanInfoMapper.deleteEmInspectionPlanInfoById(id);
    }
}
jcdm-main/src/main/resources/mapper/em/inspectionPlanInfo/EmInspectionPlanInfoMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,194 @@
<?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.jcdm.main.em.inspectionPlanInfo.mapper.EmInspectionPlanInfoMapper">
    <resultMap type="EmInspectionPlanInfo" id="EmInspectionPlanInfoResult">
        <result property="id"    column="id"    />
        <result property="planCode"    column="plan_code"    />
        <result property="planName"    column="plan_name"    />
        <result property="planType"    column="plan_type"    />
        <result property="state"    column="state"    />
        <result property="frequency"    column="frequency"    />
        <result property="dimension"    column="dimension"    />
        <result property="lastGenerationTime"    column="last_generation_time"    />
        <result property="startTime"    column="start_time"    />
        <result property="endTime"    column="end_time"    />
        <result property="devices"    column="devices"    />
        <result property="inspectionItems"    column="Inspection_items"    />
        <result property="remarks"    column="remarks"    />
        <result property="createTime"    column="create_time"    />
        <result property="createUser"    column="create_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
        <result property="spareField3"    column="spare_field_3"    />
        <result property="spareField4"    column="spare_field_4"    />
        <result property="equipmentCode"    column="equipment_code"    />
        <result property="equipmentName"    column="equipment_name"    />
        <result property="equipmentBrand"    column="equipment_brand"    />
        <result property="equipmentSpec"    column="equipment_spec"    />
        <result property="itemsCode"    column="items_code"    />
        <result property="itemsName"    column="items_name"    />
        <result property="itemsType"    column="items_type"    />
        <result property="standard"    column="standard"    />
        <result property="itemsContent"    column="items_content"    />
    </resultMap>
    <sql id="selectEmInspectionPlanInfoVo">
        select id, plan_code, plan_name, plan_type, state, frequency, dimension, last_generation_time, start_time, end_time, devices, Inspection_items, remarks, create_time, create_user, update_time, update_user, spare_field_1, spare_field_2, spare_field_3, spare_field_4, equipment_code, equipment_name, equipment_brand, equipment_spec, items_code, items_name, items_type, standard, items_content from em_inspection_plan_info
    </sql>
    <select id="selectEmInspectionPlanInfoList" parameterType="EmInspectionPlanInfo" resultMap="EmInspectionPlanInfoResult">
        <include refid="selectEmInspectionPlanInfoVo"/>
        <where>
            <if test="planCode != null  and planCode != ''"> and plan_code = #{planCode}</if>
            <if test="planName != null  and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
            <if test="planType != null  and planType != ''"> and plan_type = #{planType}</if>
            <if test="state != null  and state != ''"> and state = #{state}</if>
            <if test="frequency != null  and frequency != ''"> and frequency = #{frequency}</if>
            <if test="dimension != null  and dimension != ''"> and dimension = #{dimension}</if>
            <if test="lastGenerationTime != null  and lastGenerationTime != ''"> and last_generation_time = #{lastGenerationTime}</if>
            <if test="startTime != null  and startTime != ''"> and start_time = #{startTime}</if>
            <if test="endTime != null  and endTime != ''"> and end_time = #{endTime}</if>
            <if test="devices != null  and devices != ''"> and devices = #{devices}</if>
            <if test="inspectionItems != null  and inspectionItems != ''"> and Inspection_items = #{inspectionItems}</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
            <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
            <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
            <if test="spareField3 != null  and spareField3 != ''"> and spare_field_3 = #{spareField3}</if>
            <if test="spareField4 != null  and spareField4 != ''"> and spare_field_4 = #{spareField4}</if>
            <if test="equipmentCode != null  and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
            <if test="equipmentName != null  and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
            <if test="equipmentBrand != null  and equipmentBrand != ''"> and equipment_brand = #{equipmentBrand}</if>
            <if test="equipmentSpec != null  and equipmentSpec != ''"> and equipment_spec = #{equipmentSpec}</if>
            <if test="itemsCode != null  and itemsCode != ''"> and items_code = #{itemsCode}</if>
            <if test="itemsName != null  and itemsName != ''"> and items_name like concat('%', #{itemsName}, '%')</if>
            <if test="itemsType != null  and itemsType != ''"> and items_type = #{itemsType}</if>
            <if test="standard != null  and standard != ''"> and standard = #{standard}</if>
            <if test="itemsContent != null  and itemsContent != ''"> and items_content = #{itemsContent}</if>
        </where>
    </select>
    <select id="selectEmInspectionPlanInfoById" parameterType="Long" resultMap="EmInspectionPlanInfoResult">
        <include refid="selectEmInspectionPlanInfoVo"/>
        where id = #{id}
    </select>
    <insert id="insertEmInspectionPlanInfo" parameterType="EmInspectionPlanInfo" useGeneratedKeys="true" keyProperty="id">
        insert into em_inspection_plan_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="planCode != null">plan_code,</if>
            <if test="planName != null">plan_name,</if>
            <if test="planType != null">plan_type,</if>
            <if test="state != null">state,</if>
            <if test="frequency != null">frequency,</if>
            <if test="dimension != null">dimension,</if>
            <if test="lastGenerationTime != null">last_generation_time,</if>
            <if test="startTime != null">start_time,</if>
            <if test="endTime != null">end_time,</if>
            <if test="devices != null">devices,</if>
            <if test="inspectionItems != null">Inspection_items,</if>
            <if test="remarks != null">remarks,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createUser != null">create_user,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</if>
            <if test="spareField3 != null">spare_field_3,</if>
            <if test="spareField4 != null">spare_field_4,</if>
            <if test="equipmentCode != null">equipment_code,</if>
            <if test="equipmentName != null">equipment_name,</if>
            <if test="equipmentBrand != null">equipment_brand,</if>
            <if test="equipmentSpec != null">equipment_spec,</if>
            <if test="itemsCode != null">items_code,</if>
            <if test="itemsName != null">items_name,</if>
            <if test="itemsType != null">items_type,</if>
            <if test="standard != null">standard,</if>
            <if test="itemsContent != null">items_content,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="planCode != null">#{planCode},</if>
            <if test="planName != null">#{planName},</if>
            <if test="planType != null">#{planType},</if>
            <if test="state != null">#{state},</if>
            <if test="frequency != null">#{frequency},</if>
            <if test="dimension != null">#{dimension},</if>
            <if test="lastGenerationTime != null">#{lastGenerationTime},</if>
            <if test="startTime != null">#{startTime},</if>
            <if test="endTime != null">#{endTime},</if>
            <if test="devices != null">#{devices},</if>
            <if test="inspectionItems != null">#{inspectionItems},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</if>
            <if test="spareField3 != null">#{spareField3},</if>
            <if test="spareField4 != null">#{spareField4},</if>
            <if test="equipmentCode != null">#{equipmentCode},</if>
            <if test="equipmentName != null">#{equipmentName},</if>
            <if test="equipmentBrand != null">#{equipmentBrand},</if>
            <if test="equipmentSpec != null">#{equipmentSpec},</if>
            <if test="itemsCode != null">#{itemsCode},</if>
            <if test="itemsName != null">#{itemsName},</if>
            <if test="itemsType != null">#{itemsType},</if>
            <if test="standard != null">#{standard},</if>
            <if test="itemsContent != null">#{itemsContent},</if>
         </trim>
    </insert>
    <update id="updateEmInspectionPlanInfo" parameterType="EmInspectionPlanInfo">
        update em_inspection_plan_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="planCode != null">plan_code = #{planCode},</if>
            <if test="planName != null">plan_name = #{planName},</if>
            <if test="planType != null">plan_type = #{planType},</if>
            <if test="state != null">state = #{state},</if>
            <if test="frequency != null">frequency = #{frequency},</if>
            <if test="dimension != null">dimension = #{dimension},</if>
            <if test="lastGenerationTime != null">last_generation_time = #{lastGenerationTime},</if>
            <if test="startTime != null">start_time = #{startTime},</if>
            <if test="endTime != null">end_time = #{endTime},</if>
            <if test="devices != null">devices = #{devices},</if>
            <if test="inspectionItems != null">Inspection_items = #{inspectionItems},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
            <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
            <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
            <if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
            <if test="equipmentName != null">equipment_name = #{equipmentName},</if>
            <if test="equipmentBrand != null">equipment_brand = #{equipmentBrand},</if>
            <if test="equipmentSpec != null">equipment_spec = #{equipmentSpec},</if>
            <if test="itemsCode != null">items_code = #{itemsCode},</if>
            <if test="itemsName != null">items_name = #{itemsName},</if>
            <if test="itemsType != null">items_type = #{itemsType},</if>
            <if test="standard != null">standard = #{standard},</if>
            <if test="itemsContent != null">items_content = #{itemsContent},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteEmInspectionPlanInfoById" parameterType="Long">
        delete from em_inspection_plan_info where id = #{id}
    </delete>
    <delete id="deleteEmInspectionPlanInfoByIds" parameterType="String">
        delete from em_inspection_plan_info where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-ui/src/api/main/em/inspectionPlanInfo/inspectionPlanInfo.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’列表
export function listInspectionPlanInfo(query) {
  return request({
    url: '/em/inspectionPlanInfo/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’详细
export function getInspectionPlanInfo(id) {
  return request({
    url: '/em/inspectionPlanInfo/' + id,
    method: 'get'
  })
}
// æ–°å¢žè®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
export function addInspectionPlanInfo(data) {
  return request({
    url: '/em/inspectionPlanInfo',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
export function updateInspectionPlanInfo(data) {
  return request({
    url: '/em/inspectionPlanInfo',
    method: 'put',
    data: data
  })
}
// åˆ é™¤è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’
export function delInspectionPlanInfo(id) {
  return request({
    url: '/em/inspectionPlanInfo/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/views/main/em/inspectionPlanInfo/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,519 @@
<template>
  <div class="app-container">
    <el-card class="box-card">
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
        <el-form-item label="计划编号" prop="planCode">
          <el-input
            v-model="queryParams.planCode"
            placeholder="请输入计划编号"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="计划名称" prop="planName">
          <el-input
            v-model="queryParams.planName"
            placeholder="请输入计划名称"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="状态" prop="status">
          <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
            <el-option
              v-for="dict in dict.type.plan_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label-width="130" label="开始时间" prop="startTime">
          <el-date-picker
            v-model="queryParams.startTime"
            type="datetimerange"
            value-format="yyyy-MM-dd HH:mm:ss"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            align="right">
          </el-date-picker>
        </el-form-item>
        <el-form-item style="float: right">
          <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-card>
    <el-card style="margin-top: 10px" class="box-card">
      <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="['em:inspectionPlan: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="['em:inspectionPlan: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="['em:inspectionPlan:remove']"
          >删除</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="warning"
            plain
            icon="el-icon-download"
            size="mini"
            @click="handleExport"
            v-hasPermi="['em:inspectionPlan:export']"
          >导出</el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
      <el-table border v-loading="loading" :data="inspectionPlanInfoList" @selection-change="handleSelectionChange" >
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="计划名称" align="center" prop="planName">
        </el-table-column>
        <el-table-column label="计划编号" align="center" prop="planCode">
        </el-table-column>
        <el-table-column label="计划类型" align="center" prop="planType">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.plan_type" :value="scope.row.planType"/>
          </template>
        </el-table-column>
        <el-table-column label="频率" align="center" prop="frequency">
        </el-table-column>
        <el-table-column label="维度" align="center" prop="dimension">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.dimension" :value="scope.row.dimension"/>
          </template>
        </el-table-column>
        <el-table-column label="开始时间" align="center" prop="startTime">
        </el-table-column>
        <el-table-column label="结束时间" align="center" prop="endTime">
        </el-table-column>
        <el-table-column label="状态" align="center" prop="state">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.plan_status" :value="scope.row.state"/>
          </template>
        </el-table-column>
        <el-table-column label="上次生成时间" align="center" prop="lastGenerationTime">
        </el-table-column>
        <el-table-column label="备注" align="center" prop="remarks">
        </el-table-column>
        <el-table-column label="创建时间" align="center" prop="createTime">
        </el-table-column>
        <el-table-column label="创建人" align="center" prop="createUser">
        </el-table-column>
        <el-table-column label="修改时间" align="center" prop="updateTime">
        </el-table-column>
        <el-table-column label="修改人" align="center" prop="updateUser">
        </el-table-column>
      </el-table>
    </el-card>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- æ·»åŠ æˆ–修改点检保养计划对话框 -->
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="1200px" append-to-body>
      <span slot="title">
        <i class="el-icon-s-order"></i>
        {{titleName}}
      </span>
      <el-form ref="form" inline :model="form" :rules="rules" label-width="80px" >
        <el-form-item label="计划名称" prop="planName" >
          <el-input style="width: 450px" v-model="form.planName" placeholder="请输入计划名称" />
        </el-form-item>
        <el-form-item label="计划编号" prop="planCode">
          <el-input style="width: 450px" v-model="form.planCode" placeholder="请输入计划编号" />
        </el-form-item>
        <el-form-item label="状态" prop="state">
          <el-radio-group style="width: 450px" v-model="form.status">
            <el-radio
              v-for="dict in dict.type.plan_status"
              :key="dict.value"
              :label="dict.value"
            >{{dict.label}}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="计划类型" prop="state">
          <el-radio-group style="width: 450px" v-model="form.planType">
            <el-radio
              v-for="dict in dict.type.plan_type"
              :key="dict.value"
              :label="dict.value"
            >{{dict.label}}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="频率" prop="frequency">
          <el-input style="width: 450px" v-model="form.frequency" placeholder="请输入频率" />
        </el-form-item>
        <el-form-item label="维度" prop="dimension">
          <el-select v-model="form.dimension" placeholder="请选择维度" style="width: 450px">
            <el-option
              v-for="dict in dict.type.dimension"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="开始时间" prop="startTime">
          <el-date-picker
            style="width: 450px"
            clearable
            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
            style="width: 450px"
            clearable
            v-model="form.endTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择出站时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input style="width: 1000px" v-model="form.remarks" placeholder="请输入备注" />
        </el-form-item>
      </el-form>
      <el-tabs type="border-card" >
        <el-tab-pane label="设备清单" >
          <Checkmachinery ref="machinerylist" :optType="optType" :id="form.id" @inSelected="onMachineryAdd"></Checkmachinery>
        </el-tab-pane>
        <el-tab-pane label="点检项目">
          <Checksubject ref="subjectlist"   :optType="optType"  :id="form.id"  @subSelected="subMachineryAdd"></Checksubject>
        </el-tab-pane>
      </el-tabs>
      <el-divider></el-divider>
      <el-button type="primary" @click="submitForm">ç¡® å®š</el-button>
      <el-button @click="cancel">取 æ¶ˆ</el-button>
    </el-dialog>
  </div>
</template>
<script>
import { listInspectionPlanInfo, getInspectionPlanInfo, delInspectionPlanInfo, addInspectionPlanInfo, updateInspectionPlanInfo } from "@/api/main/em/inspectionPlanInfo/inspectionPlanInfo";
import Checksubject from "@/views/main/em/inspectionPlanInfo/subject.vue";
import Checkmachinery from "@/views/main/em/inspectionPlanInfo/machinery.vue";
export default {
  name: "InspectionPlanInfo",
  dicts: ['plan_status','plan_type','dimension'],
  components:{Checkmachinery,Checksubject},
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      optType: null,
      titleName: "",
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’表格数据
      inspectionPlanInfoList: [],
      machineryList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        planCode: null,
        planName: null,
        planType: null,
        state: null,
        frequency: null,
        dimension: null,
        lastGenerationTime: null,
        startTime: null,
        endTime: null,
        devices: null,
        inspectionItems: null,
        remarks: null,
        createUser: null,
        updateUser: null,
        spareField1: null,
        spareField2: null,
        spareField3: null,
        spareField4: null,
        equipmentCode: null,
        equipmentName: null,
        equipmentBrand: null,
        equipmentSpec: null,
        itemsCode: null,
        itemsName: null,
        itemsType: null,
        standard: null,
        itemsContent: null
      },
      // è¡¨å•å‚æ•°
      form: {},
      // è¡¨å•æ ¡éªŒ
      rules: {
        id: [
          { required: true, message: "id不能为空", trigger: "blur" }
        ],
        planName: [
          { required: true, message: "计划名称不能为空", trigger: "blur" }
        ],
        planCode: [
          { required: true, message: "计划编号不能为空", trigger: "blur" }
        ],
        planType: [
          { required: true, message: "计划类型不能为空", trigger: "blur" }
        ],
        dimension: [
          { required: true, message: "维度不能为空", trigger: "blur" }
        ],
        frequency: [
          { required: true, message: '频率不能为空', trigger: 'blur' },
          {
            validator: (rule, value, callback) => {
              if (value === '' || value === undefined || value === null) {
                callback(new Error('频率不能为空'));
              } else if (!Number.isInteger(Number(value))) {
                callback(new Error('频率必须是整数'));
              } else {
                callback();
              }
            },
            trigger: 'blur'
          }
        ],
      },
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', [start, end]);
          },
          class: 'custom-shortcut' // æ·»åŠ class属性
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            picker.$emit('pick', [start, end]);
          },
          class: 'custom-shortcut' // æ·»åŠ class属性
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            picker.$emit('pick', [start, end]);
          },
        }]
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢è®¾å¤‡ç‚¹æ£€ä¿å…»è®¡åˆ’列表 */
    getList() {
      this.loading = true;
      this.queryParams.spareField1 = 1;
      listInspectionPlanInfo(this.queryParams).then(response => {
        this.inspectionPlanInfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
      console.log(this.queryParams.spareField1)
    },
    // å–消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // è¡¨å•é‡ç½®
    reset() {
      this.form = {
        id: null,
        planCode: null,
        planName: null,
        planType: null,
        state: null,
        frequency: null,
        dimension: null,
        lastGenerationTime: null,
        startTime: null,
        endTime: null,
        devices: null,
        inspectionItems: null,
        remarks: null,
        createTime: null,
        createUser: null,
        updateTime: null,
        updateUser: null,
        spareField1: null,
        spareField2: null,
        spareField3: null,
        spareField4: null,
        equipmentCode: null,
        equipmentName: null,
        equipmentBrand: null,
        equipmentSpec: null,
        itemsCode: null,
        itemsName: null,
        itemsType: null,
        standard: null,
        itemsContent: null
      };
      this.resetForm("form");
    },
    /** å­è¡¨æ•°æ®å›žä¼ */
    onMachineryAdd(checkmachineryList){
      if(checkmachineryList !=null && checkmachineryList.length >0){
        this.machineryList = checkmachineryList
        console.log(this.machineryList)
      }
    },
    subMachineryAdd(checksubjectList){
      if(checksubjectList !=null && checksubjectList.length >0){
        this.subjectList = checksubjectList
      }
    },
    /** å­è¡¨æ¸…单新增 */
    checkAdd(){
      for (let i = 0; i < this.machineryList.length; i++) {
        this.machineryList[i].spareField2 = this.form.id
        this.machineryList[i].spareField1 = '设备清单'
        addInspectionPlanInfo(this.machineryList[i]).then(response =>{
        });
      }
      for (let i = 0; i < this.subjectList.length; i++) {
        this.subjectList[i].spareField2 = this.form.id
        this.subjectList[i].spareField1 = '项目清单'
        addInspectionPlanInfo(this.subjectList[i]).then(response =>{
        });
      }
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    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
      console.log(this.ids)
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
      this.reset();
      this.open = true;
      this.optType = "add";
      this.titleName = "添加设备点检保养计划";
    },
    /** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getInspectionPlanInfo(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.optType = "edit";
        this.titleName = "修改设备点检保养计划";
      });
    },
    /** æäº¤æŒ‰é’® */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            this.form.spareField1 =1;
            updateInspectionPlanInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
            this.checkAdd()
          } else {
            this.form.spareField1 =1;
            addInspectionPlanInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
            this.checkAdd()
          }
        }
      });
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除设备点检保养计划编号为"' + ids + '"的数据项?').then(function() {
        return delInspectionPlanInfo(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('em/inspectionPlanInfo/export', {
        ...this.queryParams
      }, `inspectionPlanInfo_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
jcdm-ui/src/views/main/em/inspectionPlanInfo/machinery.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,159 @@
<template>
  <div class="app-container">
    <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="['mes:dv:checkplan:add']"
        >新增</el-button>
      </el-col>
    </el-row>
    <MachinerySelect ref="machinerySelect" @onSelected="onMachineryAdd" ></MachinerySelect>
    <el-table v-loading="loading" :data="checkmachineryList" >
      <el-table-column label="设备编码" align="center" prop="equipmentCode" />
      <el-table-column label="设备名称" align="center" prop="equipmentName" />
      <el-table-column label="品牌" align="center" prop="equipmentBrand" />
      <el-table-column label="规格型号" align="center" prop="equipmentSpec" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="danger"
            icon="el-icon-delete"
            @click="deleteSelectedColumns(scope.row)"
          >删除</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"
    />
  </div>
</template>
<script>
import { listInspectionPlanInfo, getInspectionPlanInfo, delInspectionPlanInfo, addInspectionPlanInfo, updateInspectionPlanInfo } from "@/api/main/em/inspectionPlanInfo/inspectionPlanInfo";
import MachinerySelect from "@/components/inspectionPlanArchives/index.vue";
export default {
  name: "Checkmachinery",
  components:{MachinerySelect},
  props:{
    id: null,
    optType: null
  },
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // ç‚¹æ£€è®¾å¤‡è¡¨æ ¼æ•°æ®
      checkmachineryList: [],
        // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        equipmentId: null,
        equipmentCode: null,
        equipmentName: null,
        equipmentBrand: null,
        equipmentSpec: null,
      },
      // è¡¨å•å‚æ•°
      form: {},
    };
  },
  created() {
    if(this.optType === 'add'){
      this.getList();
    }
    if(this.optType === 'edit'){
      this.getListedit();
    }
    console.log(this.planCode)
  },
  methods: {
    deleteSelectedColumns(row) {
      const index = this.checkmachineryList.findIndex(item => item.id === row.id);
      if (index !== -1) {
        this.checkmachineryList.splice(index, 1);
      } else {
        this.$message({
          message: '未找到具有该ID的项目',
          type: 'warning'
        });
      }
      this.$emit('inSelected',this.checkmachineryList);
    },
  /** æŸ¥è¯¢ç‚¹æ£€è®¾å¤‡åˆ—表 */
    getList() {
      this.loading = true;
      this.queryParams.spareField1 = '设备清单'
    listInspectionPlanInfo(this.queryParams).then(response => {
        // this.checkmachineryList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getListedit() {
      this.loading = true;
      this.queryParams.spareField1 = '设备清单'
      this.queryParams.spareField2 = this.id;
      listInspectionPlanInfo(this.queryParams).then(response => {
        this.checkmachineryList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
      this.$refs.machinerySelect.showFlag = true;
    },
      //设备资源选择回调
    // onMachineryAdd(rows){
    //   if(rows !=null && rows.length >0){
    //      rows.forEach(row => {
    //         row.planId = this.planId;
    //        addInspectionPlanArchives(row).then(response =>{
    //           this.getList();
    //         });
    //      });
    //   }
    // },
    onMachineryAdd(selectedRows){
      if(selectedRows !=null && selectedRows.length >0){
        this.checkmachineryList = selectedRows
      }
      this.$emit('inSelected',this.checkmachineryList);
    },
  }
};
</script>
jcdm-ui/src/views/main/em/inspectionPlanInfo/subject.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,152 @@
<template>
  <div class="app-container">
    <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="['mes:dv:checkplan:add']"
        >新增</el-button>
      </el-col>
    </el-row>
    <DvsubjectSelect ref="subjectSelect"  @onSelected="onSubjectSelected"></DvsubjectSelect>
    <el-table v-loading="loading" :data="checksubjectList" >
      <el-table-column label="项目编码" align="center" prop="itemsCode" />
      <el-table-column label="项目名称" align="center" prop="itemsName" />
      <el-table-column label="项目类型" align="center" prop="itemsType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.spotmaintenance" :value="scope.row.itemsType"/>
        </template>
      </el-table-column>
      <el-table-column label="项目内容" align="center" width="300px" prop="itemsContent" />
      <el-table-column label="标准" align="center" width="300px" prop="standard" />
      <el-table-column label="操作" align="center" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="danger"
            icon="el-icon-delete"
            @click="deleteSelectedColumns(scope.row)"
          >删除</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"
    />
  </div>
</template>
<script>
import { listInspectionPlanInfo, getInspectionPlanInfo, delInspectionPlanInfo, addInspectionPlanInfo, updateInspectionPlanInfo } from "@/api/main/em/inspectionPlanInfo/inspectionPlanInfo";
import DvsubjectSelect from "@/components/inspectionPlanItems/index.vue"
export default {
  name: "Checksubject",
  components:{DvsubjectSelect},
  dicts: ['spotmaintenance'],
  props:{
      id: null,
      optType: null
  },
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      // é€‰ä¸­æ•°ç»„
      ids: [],
        selectedRows: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // ç‚¹æ£€é¡¹ç›®è¡¨æ ¼æ•°æ®
      checksubjectList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        planId: this.planId,
        itemsCode: null,
        itemsName: null,
        itemsType: null,
        standard: null,
        itemsContent: null,
      },
      // è¡¨å•å‚æ•°
      form: {}
    };
  },
  created() {
    if(this.optType === 'add'){
      this.getList();
    }
    if(this.optType === 'edit'){
      this.getListedit();
    }
  },
  methods: {
    deleteSelectedColumns(row) {
      const index = this.checksubjectList.findIndex(item => item.id === row.id);
      if (index !== -1) {
        this.checksubjectList.splice(index, 1);
      } else {
        this.$message({
          message: '未找到具有该ID的项目',
          type: 'warning'
        });
      }
      this.$emit('subSelected',this.checksubjectList);
    },
    /** æŸ¥è¯¢ç‚¹æ£€é¡¹ç›®åˆ—表 */
    getList() {
      this.loading = true;
      listInspectionPlanInfo(this.queryParams).then(response => {
        // this.checksubjectList = response.rows;
        this.total = response.total;
        this.loading = false;
        // console.log(response.rows)
      });
    },
    getListedit() {
      this.loading = true;
      this.queryParams.spareField1 = '项目清单'
      this.queryParams.spareField2 = this.id;
      listInspectionPlanInfo(this.queryParams).then(response => {
        this.checksubjectList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
        this.$refs.subjectSelect.showFlag = true;
    },
    onSubjectSelected(selectedRows){
      if(selectedRows !=null && selectedRows.length >0){
        this.checksubjectList = selectedRows
      }
      this.$emit('subSelected',this.checksubjectList);
    },
  }
};
</script>