懒羊羊
2023-12-11 4dbe17839c13ca3cd55377c6a4faab37ff40e454
生产工单
已添加8个文件
1654 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java 527 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/mapper/OmProductionOrdeInfoMapper.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/IOmProductionOrdeInfoService.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/impl/OmProductionOrdeInfoServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml 215 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/om/productionOrde/productionOrde.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/om/productionOrde/index.vue 543 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,105 @@
package com.jcdm.main.om.productionOrde.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService;
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.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * ç”Ÿäº§å·¥å•Controller
 *
 * @author ruimin
 * @date 2023-12-11
 */
@RestController
@RequestMapping("/om/productionOrde")
public class OmProductionOrdeInfoController extends BaseController
{
    @Autowired
    private IOmProductionOrdeInfoService omProductionOrdeInfoService;
    /**
     * æŸ¥è¯¢ç”Ÿäº§å·¥å•åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('om:productionOrde:list')")
    @GetMapping("/list")
    public TableDataInfo list(OmProductionOrdeInfo omProductionOrdeInfo)
    {
        startPage();
        List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.selectOmProductionOrdeInfoList(omProductionOrdeInfo);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºç”Ÿäº§å·¥å•åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('om:productionOrde:export')")
    @Log(title = "生产工单", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, OmProductionOrdeInfo omProductionOrdeInfo)
    {
        List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.selectOmProductionOrdeInfoList(omProductionOrdeInfo);
        ExcelUtil<OmProductionOrdeInfo> util = new ExcelUtil<OmProductionOrdeInfo>(OmProductionOrdeInfo.class);
        util.exportExcel(response, list, "生产工单数据");
    }
    /**
     * èŽ·å–生产工单详细信息
     */
    @PreAuthorize("@ss.hasPermi('om:productionOrde:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(omProductionOrdeInfoService.selectOmProductionOrdeInfoById(id));
    }
    /**
     * æ–°å¢žç”Ÿäº§å·¥å•
     */
    @PreAuthorize("@ss.hasPermi('om:productionOrde:add')")
    @Log(title = "生产工单", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody OmProductionOrdeInfo omProductionOrdeInfo)
    {
        return toAjax(omProductionOrdeInfoService.insertOmProductionOrdeInfo(omProductionOrdeInfo));
    }
    /**
     * ä¿®æ”¹ç”Ÿäº§å·¥å•
     */
    @PreAuthorize("@ss.hasPermi('om:productionOrde:edit')")
    @Log(title = "生产工单", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody OmProductionOrdeInfo omProductionOrdeInfo)
    {
        return toAjax(omProductionOrdeInfoService.updateOmProductionOrdeInfo(omProductionOrdeInfo));
    }
    /**
     * åˆ é™¤ç”Ÿäº§å·¥å•
     */
    @PreAuthorize("@ss.hasPermi('om:productionOrde:remove')")
    @Log(title = "生产工单", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(omProductionOrdeInfoService.deleteOmProductionOrdeInfoByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,527 @@
package com.jcdm.main.om.productionOrde.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
 * ç”Ÿäº§å·¥å•å¯¹è±¡ om_production_orde_info
 *
 * @author ruimin
 * @date 2023-12-11
 */
public class OmProductionOrdeInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
    /** ç”Ÿäº§å·¥å•å· */
    @Excel(name = "生产工单号")
    private String workOrderNo;
    /** è®¢å•ç¼–号 */
    @Excel(name = "订单编号")
    private String salesOrderCode;
    /** äº§å“ç¼–号 */
    @Excel(name = "产品编号")
    private String productCode;
    /** äº§å“åç§° */
    @Excel(name = "产品名称")
    private String productName;
    /** è½¦é—´ç¼–号 */
    @Excel(name = "车间编号")
    private String workshopCode;
    /** äº§çº¿ç¼–号 */
    @Excel(name = "产线编号")
    private String lineCode;
    /** å·¥è‰ºæµç¨‹ */
    @Excel(name = "工艺流程")
    private String routeCode;
    /** äº§å“BOM */
    @Excel(name = "产品BOM")
    private String bomCode;
    /** å·¥è‰ºé…æ–¹ */
    @Excel(name = "工艺配方")
    private String recipeCode;
    /** è®¡åˆ’数量 */
    @Excel(name = "计划数量")
    private Long planQty;
    /** å®žé™…数量 */
    @Excel(name = "实际数量")
    private Long actualQty;
    /** ä¸è‰¯æ•°é‡ */
    @Excel(name = "不良数量")
    private Long badQty;
    /** æŠ¥åºŸæ•°é‡ */
    @Excel(name = "报废数量")
    private Long scrapQty;
    /** è¿”修数量 */
    @Excel(name = "返修数量")
    private Long repairQty;
    /** å®žé™…上线数量 */
    @Excel(name = "实际上线数量")
    private Long actualOnlineQty;
    /** ä¸Šçº¿å®Œå·¥æ ‡è®° */
    private String onlineCompletionMark;
    /** éœ€æ±‚日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date demandDate;
    /** è®¡åˆ’开始时间 */
    @Excel(name = "计划开始时间")
    private String planStartTime;
    /** è®¡åˆ’结束时间 */
    @Excel(name = "计划结束时间")
    private String planEndTime;
    /** å®žé™…开始时间 */
    @Excel(name = "实际开始时间")
    private String actualStartTime;
    /** å®žé™…结束时间 */
    @Excel(name = "实际结束时间")
    private String actualEndTime;
    /** é¡ºåºå· */
    @Excel(name = "顺序号")
    private Long serialNumber;
    /** å·¥å•çŠ¶æ€ï¼ˆ1创建、2已发布、3生产中、4已冻结、5已完工、6已关闭) */
    @Excel(name = "工单状态", readConverterExp = "1=创建、2已发布、3生产中、4已冻结、5已完工、6已关闭")
    private String orderStatus;
    /** åˆ›å»ºäºº */
    @Excel(name = "创建人")
    private String createUser;
    /** ä¿®æ”¹äºº */
    @Excel(name = "修改人")
    private String updateUser;
    /** å¤‡æ³¨ */
    @Excel(name = "备注")
    private String remarks;
    /** æµæ°´å· */
    @Excel(name = "流水号")
    private String streamNumber;
    /** å®¢æˆ· */
    @Excel(name = "客户")
    private String custom;
    /** å¸‚场区域编码 */
    @Excel(name = "市场区域编码")
    private String marketAreaCode;
    /** è½¯ä»¶ç‰ˆæœ¬ç¼–码 */
    @Excel(name = "软件版本编码")
    private String softwareVersionCode;
    /** äº§å“å…¬å¸ç¼–码 */
    @Excel(name = "产品公司编码")
    private String productCompanyCode;
    /** é¢„留字段1 */
    private String spareField1;
    /** é¢„留字段2 */
    private String spareField2;
    /** é¢„留字段3 */
    private String spareField3;
    /** é¢„留字段4 */
    private String spareField4;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setWorkOrderNo(String workOrderNo)
    {
        this.workOrderNo = workOrderNo;
    }
    public String getWorkOrderNo()
    {
        return workOrderNo;
    }
    public void setSalesOrderCode(String salesOrderCode)
    {
        this.salesOrderCode = salesOrderCode;
    }
    public String getSalesOrderCode()
    {
        return salesOrderCode;
    }
    public void setProductCode(String productCode)
    {
        this.productCode = productCode;
    }
    public String getProductCode()
    {
        return productCode;
    }
    public void setProductName(String productName)
    {
        this.productName = productName;
    }
    public String getProductName()
    {
        return productName;
    }
    public void setWorkshopCode(String workshopCode)
    {
        this.workshopCode = workshopCode;
    }
    public String getWorkshopCode()
    {
        return workshopCode;
    }
    public void setLineCode(String lineCode)
    {
        this.lineCode = lineCode;
    }
    public String getLineCode()
    {
        return lineCode;
    }
    public void setRouteCode(String routeCode)
    {
        this.routeCode = routeCode;
    }
    public String getRouteCode()
    {
        return routeCode;
    }
    public void setBomCode(String bomCode)
    {
        this.bomCode = bomCode;
    }
    public String getBomCode()
    {
        return bomCode;
    }
    public void setRecipeCode(String recipeCode)
    {
        this.recipeCode = recipeCode;
    }
    public String getRecipeCode()
    {
        return recipeCode;
    }
    public void setPlanQty(Long planQty)
    {
        this.planQty = planQty;
    }
    public Long getPlanQty()
    {
        return planQty;
    }
    public void setActualQty(Long actualQty)
    {
        this.actualQty = actualQty;
    }
    public Long getActualQty()
    {
        return actualQty;
    }
    public void setBadQty(Long badQty)
    {
        this.badQty = badQty;
    }
    public Long getBadQty()
    {
        return badQty;
    }
    public void setScrapQty(Long scrapQty)
    {
        this.scrapQty = scrapQty;
    }
    public Long getScrapQty()
    {
        return scrapQty;
    }
    public void setRepairQty(Long repairQty)
    {
        this.repairQty = repairQty;
    }
    public Long getRepairQty()
    {
        return repairQty;
    }
    public void setActualOnlineQty(Long actualOnlineQty)
    {
        this.actualOnlineQty = actualOnlineQty;
    }
    public Long getActualOnlineQty()
    {
        return actualOnlineQty;
    }
    public void setOnlineCompletionMark(String onlineCompletionMark)
    {
        this.onlineCompletionMark = onlineCompletionMark;
    }
    public String getOnlineCompletionMark()
    {
        return onlineCompletionMark;
    }
    public void setDemandDate(Date demandDate)
    {
        this.demandDate = demandDate;
    }
    public Date getDemandDate()
    {
        return demandDate;
    }
    public void setPlanStartTime(String planStartTime)
    {
        this.planStartTime = planStartTime;
    }
    public String getPlanStartTime()
    {
        return planStartTime;
    }
    public void setPlanEndTime(String planEndTime)
    {
        this.planEndTime = planEndTime;
    }
    public String getPlanEndTime()
    {
        return planEndTime;
    }
    public void setActualStartTime(String actualStartTime)
    {
        this.actualStartTime = actualStartTime;
    }
    public String getActualStartTime()
    {
        return actualStartTime;
    }
    public void setActualEndTime(String actualEndTime)
    {
        this.actualEndTime = actualEndTime;
    }
    public String getActualEndTime()
    {
        return actualEndTime;
    }
    public void setSerialNumber(Long serialNumber)
    {
        this.serialNumber = serialNumber;
    }
    public Long getSerialNumber()
    {
        return serialNumber;
    }
    public void setOrderStatus(String orderStatus)
    {
        this.orderStatus = orderStatus;
    }
    public String getOrderStatus()
    {
        return orderStatus;
    }
    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 setRemarks(String remarks)
    {
        this.remarks = remarks;
    }
    public String getRemarks()
    {
        return remarks;
    }
    public void setStreamNumber(String streamNumber)
    {
        this.streamNumber = streamNumber;
    }
    public String getStreamNumber()
    {
        return streamNumber;
    }
    public void setCustom(String custom)
    {
        this.custom = custom;
    }
    public String getCustom()
    {
        return custom;
    }
    public void setMarketAreaCode(String marketAreaCode)
    {
        this.marketAreaCode = marketAreaCode;
    }
    public String getMarketAreaCode()
    {
        return marketAreaCode;
    }
    public void setSoftwareVersionCode(String softwareVersionCode)
    {
        this.softwareVersionCode = softwareVersionCode;
    }
    public String getSoftwareVersionCode()
    {
        return softwareVersionCode;
    }
    public void setProductCompanyCode(String productCompanyCode)
    {
        this.productCompanyCode = productCompanyCode;
    }
    public String getProductCompanyCode()
    {
        return productCompanyCode;
    }
    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;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("workOrderNo", getWorkOrderNo())
            .append("salesOrderCode", getSalesOrderCode())
            .append("productCode", getProductCode())
            .append("productName", getProductName())
            .append("workshopCode", getWorkshopCode())
            .append("lineCode", getLineCode())
            .append("routeCode", getRouteCode())
            .append("bomCode", getBomCode())
            .append("recipeCode", getRecipeCode())
            .append("planQty", getPlanQty())
            .append("actualQty", getActualQty())
            .append("badQty", getBadQty())
            .append("scrapQty", getScrapQty())
            .append("repairQty", getRepairQty())
            .append("actualOnlineQty", getActualOnlineQty())
            .append("onlineCompletionMark", getOnlineCompletionMark())
            .append("demandDate", getDemandDate())
            .append("planStartTime", getPlanStartTime())
            .append("planEndTime", getPlanEndTime())
            .append("actualStartTime", getActualStartTime())
            .append("actualEndTime", getActualEndTime())
            .append("serialNumber", getSerialNumber())
            .append("orderStatus", getOrderStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("createUser", getCreateUser())
            .append("updateUser", getUpdateUser())
            .append("remarks", getRemarks())
            .append("streamNumber", getStreamNumber())
            .append("custom", getCustom())
            .append("marketAreaCode", getMarketAreaCode())
            .append("softwareVersionCode", getSoftwareVersionCode())
            .append("productCompanyCode", getProductCompanyCode())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .append("spareField3", getSpareField3())
            .append("spareField4", getSpareField4())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/mapper/OmProductionOrdeInfoMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.jcdm.main.om.productionOrde.mapper;
import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
import java.util.List;
/**
 * ç”Ÿäº§å·¥å•Mapper接口
 *
 * @author ruimin
 * @date 2023-12-11
 */
public interface OmProductionOrdeInfoMapper
{
    /**
     * æŸ¥è¯¢ç”Ÿäº§å·¥å•
     *
     * @param id ç”Ÿäº§å·¥å•ä¸»é”®
     * @return ç”Ÿäº§å·¥å•
     */
    public OmProductionOrdeInfo selectOmProductionOrdeInfoById(Long id);
    /**
     * æŸ¥è¯¢ç”Ÿäº§å·¥å•åˆ—表
     *
     * @param omProductionOrdeInfo ç”Ÿäº§å·¥å•
     * @return ç”Ÿäº§å·¥å•é›†åˆ
     */
    public List<OmProductionOrdeInfo> selectOmProductionOrdeInfoList(OmProductionOrdeInfo omProductionOrdeInfo);
    /**
     * æ–°å¢žç”Ÿäº§å·¥å•
     *
     * @param omProductionOrdeInfo ç”Ÿäº§å·¥å•
     * @return ç»“æžœ
     */
    public int insertOmProductionOrdeInfo(OmProductionOrdeInfo omProductionOrdeInfo);
    /**
     * ä¿®æ”¹ç”Ÿäº§å·¥å•
     *
     * @param omProductionOrdeInfo ç”Ÿäº§å·¥å•
     * @return ç»“æžœ
     */
    public int updateOmProductionOrdeInfo(OmProductionOrdeInfo omProductionOrdeInfo);
    /**
     * åˆ é™¤ç”Ÿäº§å·¥å•
     *
     * @param id ç”Ÿäº§å·¥å•ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteOmProductionOrdeInfoById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤ç”Ÿäº§å·¥å•
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteOmProductionOrdeInfoByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/IOmProductionOrdeInfoService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.jcdm.main.om.productionOrde.service;
import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
import java.util.List;
/**
 * ç”Ÿäº§å·¥å•Service接口
 *
 * @author ruimin
 * @date 2023-12-11
 */
public interface IOmProductionOrdeInfoService
{
    /**
     * æŸ¥è¯¢ç”Ÿäº§å·¥å•
     *
     * @param id ç”Ÿäº§å·¥å•ä¸»é”®
     * @return ç”Ÿäº§å·¥å•
     */
    public OmProductionOrdeInfo selectOmProductionOrdeInfoById(Long id);
    /**
     * æŸ¥è¯¢ç”Ÿäº§å·¥å•åˆ—表
     *
     * @param omProductionOrdeInfo ç”Ÿäº§å·¥å•
     * @return ç”Ÿäº§å·¥å•é›†åˆ
     */
    public List<OmProductionOrdeInfo> selectOmProductionOrdeInfoList(OmProductionOrdeInfo omProductionOrdeInfo);
    /**
     * æ–°å¢žç”Ÿäº§å·¥å•
     *
     * @param omProductionOrdeInfo ç”Ÿäº§å·¥å•
     * @return ç»“æžœ
     */
    public int insertOmProductionOrdeInfo(OmProductionOrdeInfo omProductionOrdeInfo);
    /**
     * ä¿®æ”¹ç”Ÿäº§å·¥å•
     *
     * @param omProductionOrdeInfo ç”Ÿäº§å·¥å•
     * @return ç»“æžœ
     */
    public int updateOmProductionOrdeInfo(OmProductionOrdeInfo omProductionOrdeInfo);
    /**
     * æ‰¹é‡åˆ é™¤ç”Ÿäº§å·¥å•
     *
     * @param ids éœ€è¦åˆ é™¤çš„生产工单主键集合
     * @return ç»“æžœ
     */
    public int deleteOmProductionOrdeInfoByIds(Long[] ids);
    /**
     * åˆ é™¤ç”Ÿäº§å·¥å•ä¿¡æ¯
     *
     * @param id ç”Ÿäº§å·¥å•ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteOmProductionOrdeInfoById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/service/impl/OmProductionOrdeInfoServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
package com.jcdm.main.om.productionOrde.service.impl;
import java.util.List;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
import com.jcdm.main.om.productionOrde.mapper.OmProductionOrdeInfoMapper;
import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * ç”Ÿäº§å·¥å•Service业务层处理
 *
 * @author ruimin
 * @date 2023-12-11
 */
@Service
public class OmProductionOrdeInfoServiceImpl implements IOmProductionOrdeInfoService
{
    @Autowired
    private OmProductionOrdeInfoMapper omProductionOrdeInfoMapper;
    /**
     * æŸ¥è¯¢ç”Ÿäº§å·¥å•
     *
     * @param id ç”Ÿäº§å·¥å•ä¸»é”®
     * @return ç”Ÿäº§å·¥å•
     */
    @Override
    public OmProductionOrdeInfo selectOmProductionOrdeInfoById(Long id)
    {
        return omProductionOrdeInfoMapper.selectOmProductionOrdeInfoById(id);
    }
    /**
     * æŸ¥è¯¢ç”Ÿäº§å·¥å•åˆ—表
     *
     * @param omProductionOrdeInfo ç”Ÿäº§å·¥å•
     * @return ç”Ÿäº§å·¥å•
     */
    @Override
    public List<OmProductionOrdeInfo> selectOmProductionOrdeInfoList(OmProductionOrdeInfo omProductionOrdeInfo)
    {
        return omProductionOrdeInfoMapper.selectOmProductionOrdeInfoList(omProductionOrdeInfo);
    }
    /**
     * æ–°å¢žç”Ÿäº§å·¥å•
     *
     * @param omProductionOrdeInfo ç”Ÿäº§å·¥å•
     * @return ç»“æžœ
     */
    @Override
    public int insertOmProductionOrdeInfo(OmProductionOrdeInfo omProductionOrdeInfo)
    {
        omProductionOrdeInfo.setCreateTime(DateUtils.getNowDate());
        return omProductionOrdeInfoMapper.insertOmProductionOrdeInfo(omProductionOrdeInfo);
    }
    /**
     * ä¿®æ”¹ç”Ÿäº§å·¥å•
     *
     * @param omProductionOrdeInfo ç”Ÿäº§å·¥å•
     * @return ç»“æžœ
     */
    @Override
    public int updateOmProductionOrdeInfo(OmProductionOrdeInfo omProductionOrdeInfo)
    {
        omProductionOrdeInfo.setUpdateTime(DateUtils.getNowDate());
        return omProductionOrdeInfoMapper.updateOmProductionOrdeInfo(omProductionOrdeInfo);
    }
    /**
     * æ‰¹é‡åˆ é™¤ç”Ÿäº§å·¥å•
     *
     * @param ids éœ€è¦åˆ é™¤çš„生产工单主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteOmProductionOrdeInfoByIds(Long[] ids)
    {
        return omProductionOrdeInfoMapper.deleteOmProductionOrdeInfoByIds(ids);
    }
    /**
     * åˆ é™¤ç”Ÿäº§å·¥å•ä¿¡æ¯
     *
     * @param id ç”Ÿäº§å·¥å•ä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteOmProductionOrdeInfoById(Long id)
    {
        return omProductionOrdeInfoMapper.deleteOmProductionOrdeInfoById(id);
    }
}
jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,215 @@
<?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.om.productionOrde.mapper.OmProductionOrdeInfoMapper">
    <resultMap type="OmProductionOrdeInfo" id="OmProductionOrdeInfoResult">
        <result property="id"    column="id"    />
        <result property="workOrderNo"    column="work_order_no"    />
        <result property="salesOrderCode"    column="sales_order_code"    />
        <result property="productCode"    column="product_code"    />
        <result property="productName"    column="product_name"    />
        <result property="workshopCode"    column="workshop_code"    />
        <result property="lineCode"    column="line_code"    />
        <result property="routeCode"    column="route_code"    />
        <result property="bomCode"    column="bom_code"    />
        <result property="recipeCode"    column="recipe_code"    />
        <result property="planQty"    column="plan_qty"    />
        <result property="actualQty"    column="actual_qty"    />
        <result property="badQty"    column="bad_qty"    />
        <result property="scrapQty"    column="scrap_qty"    />
        <result property="repairQty"    column="repair_qty"    />
        <result property="actualOnlineQty"    column="actual_online_qty"    />
        <result property="onlineCompletionMark"    column="online_completion_mark"    />
        <result property="demandDate"    column="demand_date"    />
        <result property="planStartTime"    column="plan_start_time"    />
        <result property="planEndTime"    column="plan_end_time"    />
        <result property="actualStartTime"    column="actual_start_time"    />
        <result property="actualEndTime"    column="actual_end_time"    />
        <result property="serialNumber"    column="serial_number"    />
        <result property="orderStatus"    column="order_status"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createUser"    column="create_user"    />
        <result property="updateUser"    column="update_user"    />
        <result property="remarks"    column="remarks"    />
        <result property="streamNumber"    column="stream_number"    />
        <result property="custom"    column="custom"    />
        <result property="marketAreaCode"    column="market_area_code"    />
        <result property="softwareVersionCode"    column="software_version_code"    />
        <result property="productCompanyCode"    column="product_company_code"    />
        <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"    />
    </resultMap>
    <sql id="selectOmProductionOrdeInfoVo">
        select id, work_order_no, sales_order_code, product_code, product_name, workshop_code, line_code, route_code, bom_code, recipe_code, plan_qty, actual_qty, bad_qty, scrap_qty, repair_qty, actual_online_qty, online_completion_mark, demand_date, plan_start_time, plan_end_time, actual_start_time, actual_end_time, serial_number, order_status, create_time, update_time, create_user, update_user, remarks, stream_number, custom, market_area_code, software_version_code, product_company_code, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from om_production_orde_info
    </sql>
    <select id="selectOmProductionOrdeInfoList" parameterType="OmProductionOrdeInfo" resultMap="OmProductionOrdeInfoResult">
        <include refid="selectOmProductionOrdeInfoVo"/>
        <where>
            <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no like concat('%', #{workOrderNo}, '%')</if>
            <if test="salesOrderCode != null  and salesOrderCode != ''"> and sales_order_code like concat('%', #{salesOrderCode}, '%')</if>
            <if test="productCode != null  and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
            <if test="productName != null  and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
            <if test="workshopCode != null  and workshopCode != ''"> and workshop_code like concat('%', #{workshopCode}, '%')</if>
            <if test="lineCode != null  and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if>
            <if test="routeCode != null  and routeCode != ''"> and route_code like concat('%', #{routeCode}, '%')</if>
            <if test="bomCode != null  and bomCode != ''"> and bom_code like concat('%', #{bomCode}, '%')</if>
            <if test="recipeCode != null  and recipeCode != ''"> and recipe_code like concat('%', #{recipeCode}, '%')</if>
            <if test="orderStatus != null  and orderStatus != ''"> and order_status = #{orderStatus}</if>
            <if test="custom != null  and custom != ''"> and custom like concat('%', #{custom}, '%')</if>
            <if test="marketAreaCode != null  and marketAreaCode != ''"> and market_area_code like concat('%', #{marketAreaCode}, '%')</if>
            <if test="softwareVersionCode != null  and softwareVersionCode != ''"> and software_version_code like concat('%', #{softwareVersionCode}, '%')</if>
            <if test="productCompanyCode != null  and productCompanyCode != ''"> and product_company_code like concat('%', #{productCompanyCode}, '%')</if>
        </where>
    </select>
    <select id="selectOmProductionOrdeInfoById" parameterType="Long" resultMap="OmProductionOrdeInfoResult">
        <include refid="selectOmProductionOrdeInfoVo"/>
        where id = #{id}
    </select>
    <insert id="insertOmProductionOrdeInfo" parameterType="OmProductionOrdeInfo">
        insert into om_production_orde_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="workOrderNo != null">work_order_no,</if>
            <if test="salesOrderCode != null">sales_order_code,</if>
            <if test="productCode != null">product_code,</if>
            <if test="productName != null">product_name,</if>
            <if test="workshopCode != null">workshop_code,</if>
            <if test="lineCode != null">line_code,</if>
            <if test="routeCode != null">route_code,</if>
            <if test="bomCode != null">bom_code,</if>
            <if test="recipeCode != null">recipe_code,</if>
            <if test="planQty != null">plan_qty,</if>
            <if test="actualQty != null">actual_qty,</if>
            <if test="badQty != null">bad_qty,</if>
            <if test="scrapQty != null">scrap_qty,</if>
            <if test="repairQty != null">repair_qty,</if>
            <if test="actualOnlineQty != null">actual_online_qty,</if>
            <if test="onlineCompletionMark != null">online_completion_mark,</if>
            <if test="demandDate != null">demand_date,</if>
            <if test="planStartTime != null">plan_start_time,</if>
            <if test="planEndTime != null">plan_end_time,</if>
            <if test="actualStartTime != null">actual_start_time,</if>
            <if test="actualEndTime != null">actual_end_time,</if>
            <if test="serialNumber != null">serial_number,</if>
            <if test="orderStatus != null">order_status,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createUser != null">create_user,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="remarks != null">remarks,</if>
            <if test="streamNumber != null">stream_number,</if>
            <if test="custom != null">custom,</if>
            <if test="marketAreaCode != null">market_area_code,</if>
            <if test="softwareVersionCode != null">software_version_code,</if>
            <if test="productCompanyCode != null">product_company_code,</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>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="workOrderNo != null">#{workOrderNo},</if>
            <if test="salesOrderCode != null">#{salesOrderCode},</if>
            <if test="productCode != null">#{productCode},</if>
            <if test="productName != null">#{productName},</if>
            <if test="workshopCode != null">#{workshopCode},</if>
            <if test="lineCode != null">#{lineCode},</if>
            <if test="routeCode != null">#{routeCode},</if>
            <if test="bomCode != null">#{bomCode},</if>
            <if test="recipeCode != null">#{recipeCode},</if>
            <if test="planQty != null">#{planQty},</if>
            <if test="actualQty != null">#{actualQty},</if>
            <if test="badQty != null">#{badQty},</if>
            <if test="scrapQty != null">#{scrapQty},</if>
            <if test="repairQty != null">#{repairQty},</if>
            <if test="actualOnlineQty != null">#{actualOnlineQty},</if>
            <if test="onlineCompletionMark != null">#{onlineCompletionMark},</if>
            <if test="demandDate != null">#{demandDate},</if>
            <if test="planStartTime != null">#{planStartTime},</if>
            <if test="planEndTime != null">#{planEndTime},</if>
            <if test="actualStartTime != null">#{actualStartTime},</if>
            <if test="actualEndTime != null">#{actualEndTime},</if>
            <if test="serialNumber != null">#{serialNumber},</if>
            <if test="orderStatus != null">#{orderStatus},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="streamNumber != null">#{streamNumber},</if>
            <if test="custom != null">#{custom},</if>
            <if test="marketAreaCode != null">#{marketAreaCode},</if>
            <if test="softwareVersionCode != null">#{softwareVersionCode},</if>
            <if test="productCompanyCode != null">#{productCompanyCode},</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>
         </trim>
    </insert>
    <update id="updateOmProductionOrdeInfo" parameterType="OmProductionOrdeInfo">
        update om_production_orde_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if>
            <if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if>
            <if test="productCode != null">product_code = #{productCode},</if>
            <if test="productName != null">product_name = #{productName},</if>
            <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
            <if test="lineCode != null">line_code = #{lineCode},</if>
            <if test="routeCode != null">route_code = #{routeCode},</if>
            <if test="bomCode != null">bom_code = #{bomCode},</if>
            <if test="recipeCode != null">recipe_code = #{recipeCode},</if>
            <if test="planQty != null">plan_qty = #{planQty},</if>
            <if test="actualQty != null">actual_qty = #{actualQty},</if>
            <if test="badQty != null">bad_qty = #{badQty},</if>
            <if test="scrapQty != null">scrap_qty = #{scrapQty},</if>
            <if test="repairQty != null">repair_qty = #{repairQty},</if>
            <if test="actualOnlineQty != null">actual_online_qty = #{actualOnlineQty},</if>
            <if test="onlineCompletionMark != null">online_completion_mark = #{onlineCompletionMark},</if>
            <if test="demandDate != null">demand_date = #{demandDate},</if>
            <if test="planStartTime != null">plan_start_time = #{planStartTime},</if>
            <if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
            <if test="actualStartTime != null">actual_start_time = #{actualStartTime},</if>
            <if test="actualEndTime != null">actual_end_time = #{actualEndTime},</if>
            <if test="serialNumber != null">serial_number = #{serialNumber},</if>
            <if test="orderStatus != null">order_status = #{orderStatus},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="streamNumber != null">stream_number = #{streamNumber},</if>
            <if test="custom != null">custom = #{custom},</if>
            <if test="marketAreaCode != null">market_area_code = #{marketAreaCode},</if>
            <if test="softwareVersionCode != null">software_version_code = #{softwareVersionCode},</if>
            <if test="productCompanyCode != null">product_company_code = #{productCompanyCode},</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>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteOmProductionOrdeInfoById" parameterType="Long">
        delete from om_production_orde_info where id = #{id}
    </delete>
    <delete id="deleteOmProductionOrdeInfoByIds" parameterType="String">
        delete from om_production_orde_info where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-ui/src/api/main/om/productionOrde/productionOrde.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢ç”Ÿäº§å·¥å•åˆ—表
export function listProductionOrde(query) {
  return request({
    url: '/om/productionOrde/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢ç”Ÿäº§å·¥å•è¯¦ç»†
export function getProductionOrde(id) {
  return request({
    url: '/om/productionOrde/' + id,
    method: 'get'
  })
}
// æ–°å¢žç”Ÿäº§å·¥å•
export function addProductionOrde(data) {
  return request({
    url: '/om/productionOrde',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹ç”Ÿäº§å·¥å•
export function updateProductionOrde(data) {
  return request({
    url: '/om/productionOrde',
    method: 'put',
    data: data
  })
}
// åˆ é™¤ç”Ÿäº§å·¥å•
export function delProductionOrde(id) {
  return request({
    url: '/om/productionOrde/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/views/main/om/productionOrde/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,543 @@
<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="workOrderNo">
        <el-input
          v-model="queryParams.workOrderNo"
          placeholder="请输入生产工单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="订单编号" prop="salesOrderCode">
        <el-input
          v-model="queryParams.salesOrderCode"
          placeholder="请输入订单编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品编号" prop="productCode">
        <el-input
          v-model="queryParams.productCode"
          placeholder="请输入产品编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品名称" prop="productName">
        <el-input
          v-model="queryParams.productName"
          placeholder="请输入产品名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="车间编号" prop="workshopCode">
        <el-input
          v-model="queryParams.workshopCode"
          placeholder="请输入车间编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产线编号" prop="lineCode">
        <el-input
          v-model="queryParams.lineCode"
          placeholder="请输入产线编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工艺流程" prop="routeCode">
        <el-input
          v-model="queryParams.routeCode"
          placeholder="请输入工艺流程"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品BOM" prop="bomCode">
        <el-input
          v-model="queryParams.bomCode"
          placeholder="请输入产品BOM"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工艺配方" prop="recipeCode">
        <el-input
          v-model="queryParams.recipeCode"
          placeholder="请输入工艺配方"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
<!--      <el-form-item label="工单状态" prop="orderStatus">-->
<!--        <el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable>-->
<!--          <el-option-->
<!--            v-for="dict in dict.type.${dictType}"-->
<!--            :key="dict.value"-->
<!--            :label="dict.label"-->
<!--            :value="dict.value"-->
<!--          />-->
<!--        </el-select>-->
<!--      </el-form-item>-->
      <el-form-item label="客户" prop="custom">
        <el-input
          v-model="queryParams.custom"
          placeholder="请输入客户"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="市场区域编码" prop="marketAreaCode">
        <el-input
          v-model="queryParams.marketAreaCode"
          placeholder="请输入市场区域编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="软件版本编码" prop="softwareVersionCode">
        <el-input
          v-model="queryParams.softwareVersionCode"
          placeholder="请输入软件版本编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品公司编码" prop="productCompanyCode">
        <el-input
          v-model="queryParams.productCompanyCode"
          placeholder="请输入产品公司编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </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="['om:productionOrde: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="['om:productionOrde: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="['om:productionOrde: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="['om:productionOrde:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="productionOrdeList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="生产工单号" align="center" prop="workOrderNo">
      </el-table-column>
      <el-table-column label="订单编号" align="center" prop="salesOrderCode">
      </el-table-column>
      <el-table-column label="产品编号" align="center" prop="productCode">
      </el-table-column>
      <el-table-column label="产品名称" align="center" prop="productName">
      </el-table-column>
      <el-table-column label="车间编号" align="center" prop="workshopCode">
      </el-table-column>
      <el-table-column label="产线编号" align="center" prop="lineCode">
      </el-table-column>
      <el-table-column label="工艺流程" align="center" prop="routeCode">
      </el-table-column>
      <el-table-column label="产品BOM" align="center" prop="bomCode">
      </el-table-column>
      <el-table-column label="工艺配方" align="center" prop="recipeCode">
      </el-table-column>
      <el-table-column label="计划数量" align="center" prop="planQty">
      </el-table-column>
      <el-table-column label="实际数量" align="center" prop="actualQty">
      </el-table-column>
      <el-table-column label="不良数量" align="center" prop="badQty">
      </el-table-column>
      <el-table-column label="报废数量" align="center" prop="scrapQty">
      </el-table-column>
      <el-table-column label="返修数量" align="center" prop="repairQty">
      </el-table-column>
      <el-table-column label="实际上线数量" align="center" prop="actualOnlineQty">
      </el-table-column>
      <el-table-column label="需求日期" align="center" prop="demandDate" width="180">
      </el-table-column>
      <el-table-column label="计划开始时间" align="center" prop="planStartTime">
      </el-table-column>
      <el-table-column label="计划结束时间" align="center" prop="planEndTime">
      </el-table-column>
      <el-table-column label="实际开始时间" align="center" prop="actualStartTime">
      </el-table-column>
      <el-table-column label="实际结束时间" align="center" prop="actualEndTime">
      </el-table-column>
      <el-table-column label="顺序号" align="center" prop="serialNumber">
      </el-table-column>
      <el-table-column label="工单状态" align="center" prop="orderStatus">
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime">
      </el-table-column>
      <el-table-column label="更新时间" align="center" prop="updateTime">
      </el-table-column>
      <el-table-column label="创建人" align="center" prop="createUser">
      </el-table-column>
      <el-table-column label="修改人" align="center" prop="updateUser">
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remarks">
      </el-table-column>
      <el-table-column label="流水号" align="center" prop="streamNumber">
      </el-table-column>
      <el-table-column label="客户" align="center" prop="custom">
      </el-table-column>
      <el-table-column label="市场区域编码" align="center" prop="marketAreaCode">
      </el-table-column>
      <el-table-column label="软件版本编码" align="center" prop="softwareVersionCode">
      </el-table-column>
      <el-table-column label="产品公司编码" align="center" prop="productCompanyCode">
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['om:productionOrde:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['om:productionOrde: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="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="生产工单号" prop="workOrderNo">
          <el-input v-model="form.workOrderNo" placeholder="请输入生产工单号" />
        </el-form-item>
        <el-form-item label="订单编号" prop="salesOrderCode">
          <el-input v-model="form.salesOrderCode" placeholder="请输入订单编号" />
        </el-form-item>
        <el-form-item label="产品编号" prop="productCode">
          <el-input v-model="form.productCode" placeholder="请输入产品编号" />
        </el-form-item>
        <el-form-item label="产品名称" prop="productName">
          <el-input v-model="form.productName" placeholder="请输入产品名称" />
        </el-form-item>
        <el-form-item label="车间编号" prop="workshopCode">
          <el-input v-model="form.workshopCode" placeholder="请输入车间编号" />
        </el-form-item>
        <el-form-item label="产线编号" prop="lineCode">
          <el-input v-model="form.lineCode" placeholder="请输入产线编号" />
        </el-form-item>
        <el-form-item label="工艺流程" prop="routeCode">
          <el-input v-model="form.routeCode" placeholder="请输入工艺流程" />
        </el-form-item>
        <el-form-item label="产品BOM" prop="bomCode">
          <el-input v-model="form.bomCode" placeholder="请输入产品BOM" />
        </el-form-item>
        <el-form-item label="工艺配方" prop="recipeCode">
          <el-input v-model="form.recipeCode" placeholder="请输入工艺配方" />
        </el-form-item>
        <el-form-item label="计划数量" prop="planQty">
          <el-input v-model="form.planQty" placeholder="请输入计划数量" />
        </el-form-item>
        <el-form-item label="实际数量" prop="actualQty">
          <el-input v-model="form.actualQty" placeholder="请输入实际数量" />
        </el-form-item>
        <el-form-item label="不良数量" prop="badQty">
          <el-input v-model="form.badQty" placeholder="请输入不良数量" />
        </el-form-item>
        <el-form-item label="报废数量" prop="scrapQty">
          <el-input v-model="form.scrapQty" placeholder="请输入报废数量" />
        </el-form-item>
        <el-form-item label="返修数量" prop="repairQty">
          <el-input v-model="form.repairQty" placeholder="请输入返修数量" />
        </el-form-item>
        <el-form-item label="需求日期" prop="demandDate">
          <el-date-picker clearable
            v-model="form.demandDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择需求日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="顺序号" prop="serialNumber">
          <el-input v-model="form.serialNumber" placeholder="请输入顺序号" />
        </el-form-item>
<!--        <el-form-item label="工单状态" prop="orderStatus">-->
<!--          <el-radio-group v-model="form.orderStatus">-->
<!--            <el-radio-->
<!--              v-for="dict in dict.type.${dictType}"-->
<!--              :key="dict.value"-->
<!--              :label="dict.value"-->
<!--            >{{dict.label}}</el-radio>-->
<!--          </el-radio-group>-->
<!--        </el-form-item>-->
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="流水号" prop="streamNumber">
          <el-input v-model="form.streamNumber" placeholder="请输入流水号" />
        </el-form-item>
        <el-form-item label="客户" prop="custom">
          <el-input v-model="form.custom" placeholder="请输入客户" />
        </el-form-item>
        <el-form-item label="市场区域编码" prop="marketAreaCode">
          <el-input v-model="form.marketAreaCode" placeholder="请输入市场区域编码" />
        </el-form-item>
        <el-form-item label="软件版本编码" prop="softwareVersionCode">
          <el-input v-model="form.softwareVersionCode" placeholder="请输入软件版本编码" />
        </el-form-item>
        <el-form-item label="产品公司编码" prop="productCompanyCode">
          <el-input v-model="form.productCompanyCode" 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 { listProductionOrde, getProductionOrde, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde";
export default {
  name: "ProductionOrde",
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // ç”Ÿäº§å·¥å•è¡¨æ ¼æ•°æ®
      productionOrdeList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        workOrderNo: null,
        salesOrderCode: null,
        productCode: null,
        productName: null,
        workshopCode: null,
        lineCode: null,
        routeCode: null,
        bomCode: null,
        recipeCode: null,
        orderStatus: null,
        custom: null,
        marketAreaCode: null,
        softwareVersionCode: null,
        productCompanyCode: null,
      },
      // è¡¨å•å‚æ•°
      form: {},
      // è¡¨å•æ ¡éªŒ
      rules: {
        id: [
          { required: true, message: "ID不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢ç”Ÿäº§å·¥å•åˆ—表 */
    getList() {
      this.loading = true;
      listProductionOrde(this.queryParams).then(response => {
        this.productionOrdeList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // å–消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // è¡¨å•é‡ç½®
    reset() {
      this.form = {
        id: null,
        workOrderNo: null,
        salesOrderCode: null,
        productCode: null,
        productName: null,
        workshopCode: null,
        lineCode: null,
        routeCode: null,
        bomCode: null,
        recipeCode: null,
        planQty: null,
        actualQty: null,
        badQty: null,
        scrapQty: null,
        repairQty: null,
        actualOnlineQty: null,
        onlineCompletionMark: null,
        demandDate: null,
        planStartTime: null,
        planEndTime: null,
        actualStartTime: null,
        actualEndTime: null,
        serialNumber: null,
        orderStatus: null,
        createTime: null,
        updateTime: null,
        createUser: null,
        updateUser: null,
        remarks: null,
        streamNumber: null,
        custom: null,
        marketAreaCode: null,
        softwareVersionCode: null,
        productCompanyCode: null,
        spareField1: null,
        spareField2: null,
        spareField3: null,
        spareField4: 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
      getProductionOrde(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) {
            updateProductionOrde(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addProductionOrde(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 delProductionOrde(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('om/productionOrde/export', {
        ...this.queryParams
      }, `productionOrde_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>