change - add工艺路线、关联工艺路线组成信息

master
yinq 10 months ago
parent f349297028
commit c688d612a1

@ -47,6 +47,16 @@ public class MesBaseProcessInfoController extends BaseController
return getDataTable(list);
}
/**
*
*/
@GetMapping("/findProcessList")
public AjaxResult findProcessList(MesBaseProcessInfo mesBaseProcessInfo)
{
List<MesBaseProcessInfo> list = mesBaseProcessInfoService.selectMesBaseProcessInfoList(mesBaseProcessInfo);
return success(list);
}
/**
*
*/

@ -0,0 +1,115 @@
package com.hw.mes.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesBaseRoute;
import com.hw.mes.service.IMesBaseRouteService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.core.web.page.TableDataInfo;
/**
* 线Controller
*
* @author Yinq
* @date 2024-01-25
*/
@RestController
@RequestMapping("/baseRoute")
public class MesBaseRouteController extends BaseController
{
@Autowired
private IMesBaseRouteService mesBaseRouteService;
/**
* 线
*/
@RequiresPermissions("mes:baseRoute:list")
@GetMapping("/list")
public TableDataInfo list(MesBaseRoute mesBaseRoute)
{
startPage();
List<MesBaseRoute> list = mesBaseRouteService.selectMesBaseRouteList(mesBaseRoute);
return getDataTable(list);
}
/**
* 线
*/
@GetMapping("/findRouteList")
public AjaxResult findRouteList(MesBaseRoute mesBaseRoute)
{
List<MesBaseRoute> list = mesBaseRouteService.selectMesBaseRouteList(mesBaseRoute);
return success(list);
}
/**
* 线
*/
@RequiresPermissions("mes:baseRoute:export")
@Log(title = "工艺路线", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesBaseRoute mesBaseRoute)
{
List<MesBaseRoute> list = mesBaseRouteService.selectMesBaseRouteList(mesBaseRoute);
ExcelUtil<MesBaseRoute> util = new ExcelUtil<MesBaseRoute>(MesBaseRoute.class);
util.exportExcel(response, list, "工艺路线数据");
}
/**
* 线
*/
@RequiresPermissions("mes:baseRoute:query")
@GetMapping(value = "/{routeId}")
public AjaxResult getInfo(@PathVariable("routeId") Long routeId)
{
return success(mesBaseRouteService.selectMesBaseRouteByRouteId(routeId));
}
/**
* 线
*/
@RequiresPermissions("mes:baseRoute:add")
@Log(title = "工艺路线", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesBaseRoute mesBaseRoute)
{
return toAjax(mesBaseRouteService.insertMesBaseRoute(mesBaseRoute));
}
/**
* 线
*/
@RequiresPermissions("mes:baseRoute:edit")
@Log(title = "工艺路线", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesBaseRoute mesBaseRoute)
{
return toAjax(mesBaseRouteService.updateMesBaseRoute(mesBaseRoute));
}
/**
* 线
*/
@RequiresPermissions("mes:baseRoute:remove")
@Log(title = "工艺路线", businessType = BusinessType.DELETE)
@DeleteMapping("/{routeIds}")
public AjaxResult remove(@PathVariable Long[] routeIds)
{
return toAjax(mesBaseRouteService.deleteMesBaseRouteByRouteIds(routeIds));
}
}

@ -0,0 +1,105 @@
package com.hw.mes.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesBaseRouteProcess;
import com.hw.mes.service.IMesBaseRouteProcessService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.core.web.page.TableDataInfo;
/**
* 线Controller
*
* @author Yinq
* @date 2024-01-25
*/
@RestController
@RequestMapping("/baseRouteProcess")
public class MesBaseRouteProcessController extends BaseController
{
@Autowired
private IMesBaseRouteProcessService mesBaseRouteProcessService;
/**
* 线
*/
@RequiresPermissions("mes:baseRouteProcess:list")
@GetMapping("/list")
public TableDataInfo list(MesBaseRouteProcess mesBaseRouteProcess)
{
startPage();
List<MesBaseRouteProcess> list = mesBaseRouteProcessService.selectMesBaseRouteProcessList(mesBaseRouteProcess);
return getDataTable(list);
}
/**
* 线
*/
@RequiresPermissions("mes:baseRouteProcess:export")
@Log(title = "工艺路线组成信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesBaseRouteProcess mesBaseRouteProcess)
{
List<MesBaseRouteProcess> list = mesBaseRouteProcessService.selectMesBaseRouteProcessList(mesBaseRouteProcess);
ExcelUtil<MesBaseRouteProcess> util = new ExcelUtil<MesBaseRouteProcess>(MesBaseRouteProcess.class);
util.exportExcel(response, list, "工艺路线组成信息数据");
}
/**
* 线
*/
@RequiresPermissions("mes:baseRouteProcess:query")
@GetMapping(value = "/{routeProcessId}")
public AjaxResult getInfo(@PathVariable("routeProcessId") Long routeProcessId)
{
return success(mesBaseRouteProcessService.selectMesBaseRouteProcessByRouteProcessId(routeProcessId));
}
/**
* 线
*/
@RequiresPermissions("mes:baseRouteProcess:add")
@Log(title = "工艺路线组成信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesBaseRouteProcess mesBaseRouteProcess)
{
return toAjax(mesBaseRouteProcessService.insertMesBaseRouteProcess(mesBaseRouteProcess));
}
/**
* 线
*/
@RequiresPermissions("mes:baseRouteProcess:edit")
@Log(title = "工艺路线组成信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesBaseRouteProcess mesBaseRouteProcess)
{
return toAjax(mesBaseRouteProcessService.updateMesBaseRouteProcess(mesBaseRouteProcess));
}
/**
* 线
*/
@RequiresPermissions("mes:baseRouteProcess:remove")
@Log(title = "工艺路线组成信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{routeProcessIds}")
public AjaxResult remove(@PathVariable Long[] routeProcessIds)
{
return toAjax(mesBaseRouteProcessService.deleteMesBaseRouteProcessByRouteProcessIds(routeProcessIds));
}
}

@ -0,0 +1,102 @@
package com.hw.mes.domain;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* 线 mes_base_route
*
* @author Yinq
* @date 2024-01-25
*/
public class MesBaseRoute extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 线ID
*/
private Long routeId;
/**
* 线
*/
@Excel(name = "工艺路线名称")
private String routeName;
/**
* 线
*/
@Excel(name = "工艺路线说明")
private String routeDesc;
/**
*
*/
@Excel(name = "激活标识")
private String activeFlag;
/**
* 线
*/
private List<MesBaseRouteProcess> mesBaseRouteProcessList;
public void setRouteId(Long routeId) {
this.routeId = routeId;
}
public Long getRouteId() {
return routeId;
}
public void setRouteName(String routeName) {
this.routeName = routeName;
}
public String getRouteName() {
return routeName;
}
public void setRouteDesc(String routeDesc) {
this.routeDesc = routeDesc;
}
public String getRouteDesc() {
return routeDesc;
}
public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag;
}
public String getActiveFlag() {
return activeFlag;
}
public List<MesBaseRouteProcess> getMesBaseRouteProcessList() {
return mesBaseRouteProcessList;
}
public void setMesBaseRouteProcessList(List<MesBaseRouteProcess> mesBaseRouteProcessList) {
this.mesBaseRouteProcessList = mesBaseRouteProcessList;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("routeId", getRouteId())
.append("routeName", getRouteName())
.append("routeDesc", getRouteDesc())
.append("activeFlag", getActiveFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("mesBaseRouteProcessList", getMesBaseRouteProcessList())
.toString();
}
}

@ -0,0 +1,86 @@
package com.hw.mes.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* 线 mes_base_route_process
*
* @author Yinq
* @date 2024-01-25
*/
public class MesBaseRouteProcess extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 线ID
*/
private Long routeProcessId;
/**
* 线ID
*/
@Excel(name = "工艺路线ID")
private Long routeId;
/**
* ID
*/
@Excel(name = "工序ID")
private Long processId;
/**
* 线
*/
@Excel(name = "工艺路线顺序")
private Long processOrder;
public void setRouteProcessId(Long routeProcessId) {
this.routeProcessId = routeProcessId;
}
public Long getRouteProcessId() {
return routeProcessId;
}
public void setRouteId(Long routeId) {
this.routeId = routeId;
}
public Long getRouteId() {
return routeId;
}
public void setProcessId(Long processId) {
this.processId = processId;
}
public Long getProcessId() {
return processId;
}
public void setProcessOrder(Long processOrder) {
this.processOrder = processOrder;
}
public Long getProcessOrder() {
return processOrder;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("routeProcessId", getRouteProcessId())
.append("routeId", getRouteId())
.append("processId", getProcessId())
.append("processOrder", getProcessOrder())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,87 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesBaseRoute;
import com.hw.mes.domain.MesBaseRouteProcess;
/**
* 线Mapper
*
* @author Yinq
* @date 2024-01-25
*/
public interface MesBaseRouteMapper
{
/**
* 线
*
* @param routeId 线
* @return 线
*/
public MesBaseRoute selectMesBaseRouteByRouteId(Long routeId);
/**
* 线
*
* @param mesBaseRoute 线
* @return 线
*/
public List<MesBaseRoute> selectMesBaseRouteList(MesBaseRoute mesBaseRoute);
/**
* 线
*
* @param mesBaseRoute 线
* @return
*/
public int insertMesBaseRoute(MesBaseRoute mesBaseRoute);
/**
* 线
*
* @param mesBaseRoute 线
* @return
*/
public int updateMesBaseRoute(MesBaseRoute mesBaseRoute);
/**
* 线
*
* @param routeId 线
* @return
*/
public int deleteMesBaseRouteByRouteId(Long routeId);
/**
* 线
*
* @param routeIds
* @return
*/
public int deleteMesBaseRouteByRouteIds(Long[] routeIds);
/**
* 线
*
* @param routeIds
* @return
*/
public int deleteMesBaseRouteProcessByRouteIds(Long[] routeIds);
/**
* 线
*
* @param mesBaseRouteProcessList 线
* @return
*/
public int batchMesBaseRouteProcess(List<MesBaseRouteProcess> mesBaseRouteProcessList);
/**
* 线线
*
* @param routeId 线ID
* @return
*/
public int deleteMesBaseRouteProcessByRouteId(Long routeId);
}

@ -0,0 +1,61 @@
package com.hw.mes.mapper;
import java.util.List;
import com.hw.mes.domain.MesBaseRouteProcess;
/**
* 线Mapper
*
* @author Yinq
* @date 2024-01-25
*/
public interface MesBaseRouteProcessMapper
{
/**
* 线
*
* @param routeProcessId 线
* @return 线
*/
public MesBaseRouteProcess selectMesBaseRouteProcessByRouteProcessId(Long routeProcessId);
/**
* 线
*
* @param mesBaseRouteProcess 线
* @return 线
*/
public List<MesBaseRouteProcess> selectMesBaseRouteProcessList(MesBaseRouteProcess mesBaseRouteProcess);
/**
* 线
*
* @param mesBaseRouteProcess 线
* @return
*/
public int insertMesBaseRouteProcess(MesBaseRouteProcess mesBaseRouteProcess);
/**
* 线
*
* @param mesBaseRouteProcess 线
* @return
*/
public int updateMesBaseRouteProcess(MesBaseRouteProcess mesBaseRouteProcess);
/**
* 线
*
* @param routeProcessId 线
* @return
*/
public int deleteMesBaseRouteProcessByRouteProcessId(Long routeProcessId);
/**
* 线
*
* @param routeProcessIds
* @return
*/
public int deleteMesBaseRouteProcessByRouteProcessIds(Long[] routeProcessIds);
}

@ -0,0 +1,61 @@
package com.hw.mes.service;
import java.util.List;
import com.hw.mes.domain.MesBaseRouteProcess;
/**
* 线Service
*
* @author Yinq
* @date 2024-01-25
*/
public interface IMesBaseRouteProcessService
{
/**
* 线
*
* @param routeProcessId 线
* @return 线
*/
public MesBaseRouteProcess selectMesBaseRouteProcessByRouteProcessId(Long routeProcessId);
/**
* 线
*
* @param mesBaseRouteProcess 线
* @return 线
*/
public List<MesBaseRouteProcess> selectMesBaseRouteProcessList(MesBaseRouteProcess mesBaseRouteProcess);
/**
* 线
*
* @param mesBaseRouteProcess 线
* @return
*/
public int insertMesBaseRouteProcess(MesBaseRouteProcess mesBaseRouteProcess);
/**
* 线
*
* @param mesBaseRouteProcess 线
* @return
*/
public int updateMesBaseRouteProcess(MesBaseRouteProcess mesBaseRouteProcess);
/**
* 线
*
* @param routeProcessIds 线
* @return
*/
public int deleteMesBaseRouteProcessByRouteProcessIds(Long[] routeProcessIds);
/**
* 线
*
* @param routeProcessId 线
* @return
*/
public int deleteMesBaseRouteProcessByRouteProcessId(Long routeProcessId);
}

@ -0,0 +1,61 @@
package com.hw.mes.service;
import java.util.List;
import com.hw.mes.domain.MesBaseRoute;
/**
* 线Service
*
* @author Yinq
* @date 2024-01-25
*/
public interface IMesBaseRouteService
{
/**
* 线
*
* @param routeId 线
* @return 线
*/
public MesBaseRoute selectMesBaseRouteByRouteId(Long routeId);
/**
* 线
*
* @param mesBaseRoute 线
* @return 线
*/
public List<MesBaseRoute> selectMesBaseRouteList(MesBaseRoute mesBaseRoute);
/**
* 线
*
* @param mesBaseRoute 线
* @return
*/
public int insertMesBaseRoute(MesBaseRoute mesBaseRoute);
/**
* 线
*
* @param mesBaseRoute 线
* @return
*/
public int updateMesBaseRoute(MesBaseRoute mesBaseRoute);
/**
* 线
*
* @param routeIds 线
* @return
*/
public int deleteMesBaseRouteByRouteIds(Long[] routeIds);
/**
* 线
*
* @param routeId 线
* @return
*/
public int deleteMesBaseRouteByRouteId(Long routeId);
}

@ -0,0 +1,96 @@
package com.hw.mes.service.impl;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseRouteProcessMapper;
import com.hw.mes.domain.MesBaseRouteProcess;
import com.hw.mes.service.IMesBaseRouteProcessService;
/**
* 线Service
*
* @author Yinq
* @date 2024-01-25
*/
@Service
public class MesBaseRouteProcessServiceImpl implements IMesBaseRouteProcessService
{
@Autowired
private MesBaseRouteProcessMapper mesBaseRouteProcessMapper;
/**
* 线
*
* @param routeProcessId 线
* @return 线
*/
@Override
public MesBaseRouteProcess selectMesBaseRouteProcessByRouteProcessId(Long routeProcessId)
{
return mesBaseRouteProcessMapper.selectMesBaseRouteProcessByRouteProcessId(routeProcessId);
}
/**
* 线
*
* @param mesBaseRouteProcess 线
* @return 线
*/
@Override
public List<MesBaseRouteProcess> selectMesBaseRouteProcessList(MesBaseRouteProcess mesBaseRouteProcess)
{
return mesBaseRouteProcessMapper.selectMesBaseRouteProcessList(mesBaseRouteProcess);
}
/**
* 线
*
* @param mesBaseRouteProcess 线
* @return
*/
@Override
public int insertMesBaseRouteProcess(MesBaseRouteProcess mesBaseRouteProcess)
{
mesBaseRouteProcess.setCreateTime(DateUtils.getNowDate());
return mesBaseRouteProcessMapper.insertMesBaseRouteProcess(mesBaseRouteProcess);
}
/**
* 线
*
* @param mesBaseRouteProcess 线
* @return
*/
@Override
public int updateMesBaseRouteProcess(MesBaseRouteProcess mesBaseRouteProcess)
{
mesBaseRouteProcess.setUpdateTime(DateUtils.getNowDate());
return mesBaseRouteProcessMapper.updateMesBaseRouteProcess(mesBaseRouteProcess);
}
/**
* 线
*
* @param routeProcessIds 线
* @return
*/
@Override
public int deleteMesBaseRouteProcessByRouteProcessIds(Long[] routeProcessIds)
{
return mesBaseRouteProcessMapper.deleteMesBaseRouteProcessByRouteProcessIds(routeProcessIds);
}
/**
* 线
*
* @param routeProcessId 线
* @return
*/
@Override
public int deleteMesBaseRouteProcessByRouteProcessId(Long routeProcessId)
{
return mesBaseRouteProcessMapper.deleteMesBaseRouteProcessByRouteProcessId(routeProcessId);
}
}

@ -0,0 +1,137 @@
package com.hw.mes.service.impl;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.hw.common.core.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.hw.mes.domain.MesBaseRouteProcess;
import com.hw.mes.mapper.MesBaseRouteMapper;
import com.hw.mes.domain.MesBaseRoute;
import com.hw.mes.service.IMesBaseRouteService;
/**
* 线Service
*
* @author Yinq
* @date 2024-01-25
*/
@Service
public class MesBaseRouteServiceImpl implements IMesBaseRouteService
{
@Autowired
private MesBaseRouteMapper mesBaseRouteMapper;
/**
* 线
*
* @param routeId 线
* @return 线
*/
@Override
public MesBaseRoute selectMesBaseRouteByRouteId(Long routeId)
{
return mesBaseRouteMapper.selectMesBaseRouteByRouteId(routeId);
}
/**
* 线
*
* @param mesBaseRoute 线
* @return 线
*/
@Override
public List<MesBaseRoute> selectMesBaseRouteList(MesBaseRoute mesBaseRoute)
{
return mesBaseRouteMapper.selectMesBaseRouteList(mesBaseRoute);
}
/**
* 线
*
* @param mesBaseRoute 线
* @return
*/
@Transactional
@Override
public int insertMesBaseRoute(MesBaseRoute mesBaseRoute)
{
mesBaseRoute.setCreateTime(DateUtils.getNowDate());
int rows = mesBaseRouteMapper.insertMesBaseRoute(mesBaseRoute);
insertMesBaseRouteProcess(mesBaseRoute);
return rows;
}
/**
* 线
*
* @param mesBaseRoute 线
* @return
*/
@Transactional
@Override
public int updateMesBaseRoute(MesBaseRoute mesBaseRoute)
{
mesBaseRoute.setUpdateTime(DateUtils.getNowDate());
mesBaseRouteMapper.deleteMesBaseRouteProcessByRouteId(mesBaseRoute.getRouteId());
insertMesBaseRouteProcess(mesBaseRoute);
return mesBaseRouteMapper.updateMesBaseRoute(mesBaseRoute);
}
/**
* 线
*
* @param routeIds 线
* @return
*/
@Transactional
@Override
public int deleteMesBaseRouteByRouteIds(Long[] routeIds)
{
mesBaseRouteMapper.deleteMesBaseRouteProcessByRouteIds(routeIds);
return mesBaseRouteMapper.deleteMesBaseRouteByRouteIds(routeIds);
}
/**
* 线
*
* @param routeId 线
* @return
*/
@Transactional
@Override
public int deleteMesBaseRouteByRouteId(Long routeId)
{
mesBaseRouteMapper.deleteMesBaseRouteProcessByRouteId(routeId);
return mesBaseRouteMapper.deleteMesBaseRouteByRouteId(routeId);
}
/**
* 线
*
* @param mesBaseRoute 线
*/
public void insertMesBaseRouteProcess(MesBaseRoute mesBaseRoute)
{
List<MesBaseRouteProcess> mesBaseRouteProcessList = mesBaseRoute.getMesBaseRouteProcessList();
Long routeId = mesBaseRoute.getRouteId();
if (StringUtils.isNotNull(mesBaseRouteProcessList))
{
List<MesBaseRouteProcess> list = new ArrayList<MesBaseRouteProcess>();
for (MesBaseRouteProcess mesBaseRouteProcess : mesBaseRouteProcessList)
{
mesBaseRouteProcess.setRouteId(routeId);
mesBaseRouteProcess.setCreateTime(DateUtils.getNowDate());
mesBaseRouteProcess.setCreateBy(SecurityUtils.getUsername());
list.add(mesBaseRouteProcess);
}
if (list.size() > 0)
{
mesBaseRouteMapper.batchMesBaseRouteProcess(list);
}
}
}
}

@ -0,0 +1,127 @@
<?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.hw.mes.mapper.MesBaseRouteMapper">
<resultMap type="MesBaseRoute" id="MesBaseRouteResult">
<result property="routeId" column="route_id" />
<result property="routeName" column="route_name" />
<result property="routeDesc" column="route_desc" />
<result property="activeFlag" column="active_flag" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap id="MesBaseRouteMesBaseRouteProcessResult" type="MesBaseRoute" extends="MesBaseRouteResult">
<collection property="mesBaseRouteProcessList" notNullColumn="sub_route_process_id" javaType="java.util.List" resultMap="MesBaseRouteProcessResult" />
</resultMap>
<resultMap type="MesBaseRouteProcess" id="MesBaseRouteProcessResult">
<result property="routeProcessId" column="sub_route_process_id" />
<result property="routeId" column="sub_route_id" />
<result property="processId" column="sub_process_id" />
<result property="processOrder" column="sub_process_order" />
<result property="remark" column="sub_remark" />
<result property="createBy" column="sub_create_by" />
<result property="createTime" column="sub_create_time" />
<result property="updateBy" column="sub_update_by" />
<result property="updateTime" column="sub_update_time" />
</resultMap>
<sql id="selectMesBaseRouteVo">
select route_id, route_name, route_desc, active_flag, remark, create_by, create_time, update_by, update_time from mes_base_route
</sql>
<select id="selectMesBaseRouteList" parameterType="MesBaseRoute" resultMap="MesBaseRouteResult">
<include refid="selectMesBaseRouteVo"/>
<where>
<if test="routeName != null and routeName != ''"> and route_name like concat('%', #{routeName}, '%')</if>
<if test="routeDesc != null and routeDesc != ''"> and route_desc = #{routeDesc}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
</select>
<select id="selectMesBaseRouteByRouteId" parameterType="Long" resultMap="MesBaseRouteMesBaseRouteProcessResult">
select a.route_id, a.route_name, a.route_desc, a.active_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,
b.route_process_id as sub_route_process_id, b.route_id as sub_route_id, b.process_id as sub_process_id, b.process_order as sub_process_order, b.remark as sub_remark, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time
from mes_base_route a
left join mes_base_route_process b on b.route_id = a.route_id
where a.route_id = #{routeId}
</select>
<insert id="insertMesBaseRoute" parameterType="MesBaseRoute" useGeneratedKeys="true" keyProperty="routeId">
insert into mes_base_route
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="routeName != null and routeName != ''">route_name,</if>
<if test="routeDesc != null">route_desc,</if>
<if test="activeFlag != null and activeFlag != ''">active_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="routeName != null and routeName != ''">#{routeName},</if>
<if test="routeDesc != null">#{routeDesc},</if>
<if test="activeFlag != null and activeFlag != ''">#{activeFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateMesBaseRoute" parameterType="MesBaseRoute">
update mes_base_route
<trim prefix="SET" suffixOverrides=",">
<if test="routeName != null and routeName != ''">route_name = #{routeName},</if>
<if test="routeDesc != null">route_desc = #{routeDesc},</if>
<if test="activeFlag != null and activeFlag != ''">active_flag = #{activeFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where route_id = #{routeId}
</update>
<delete id="deleteMesBaseRouteByRouteId" parameterType="Long">
delete from mes_base_route where route_id = #{routeId}
</delete>
<delete id="deleteMesBaseRouteByRouteIds" parameterType="String">
delete from mes_base_route where route_id in
<foreach item="routeId" collection="array" open="(" separator="," close=")">
#{routeId}
</foreach>
</delete>
<delete id="deleteMesBaseRouteProcessByRouteIds" parameterType="String">
delete from mes_base_route_process where route_id in
<foreach item="routeId" collection="array" open="(" separator="," close=")">
#{routeId}
</foreach>
</delete>
<delete id="deleteMesBaseRouteProcessByRouteId" parameterType="Long">
delete from mes_base_route_process where route_id = #{routeId}
</delete>
<insert id="batchMesBaseRouteProcess">
insert into mes_base_route_process( route_process_id, route_id, process_id, process_order, remark, create_by, create_time, update_by, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.routeProcessId}, #{item.routeId}, #{item.processId}, #{item.processOrder}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
</insert>
</mapper>

@ -0,0 +1,91 @@
<?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.hw.mes.mapper.MesBaseRouteProcessMapper">
<resultMap type="MesBaseRouteProcess" id="MesBaseRouteProcessResult">
<result property="routeProcessId" column="route_process_id" />
<result property="routeId" column="route_id" />
<result property="processId" column="process_id" />
<result property="processOrder" column="process_order" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectMesBaseRouteProcessVo">
select route_process_id, route_id, process_id, process_order, remark, create_by, create_time, update_by, update_time from mes_base_route_process
</sql>
<select id="selectMesBaseRouteProcessList" parameterType="MesBaseRouteProcess" resultMap="MesBaseRouteProcessResult">
<include refid="selectMesBaseRouteProcessVo"/>
<where>
<if test="routeId != null "> and route_id = #{routeId}</if>
<if test="processId != null "> and process_id = #{processId}</if>
<if test="processOrder != null "> and process_order = #{processOrder}</if>
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
</select>
<select id="selectMesBaseRouteProcessByRouteProcessId" parameterType="Long" resultMap="MesBaseRouteProcessResult">
<include refid="selectMesBaseRouteProcessVo"/>
where route_process_id = #{routeProcessId}
</select>
<insert id="insertMesBaseRouteProcess" parameterType="MesBaseRouteProcess" useGeneratedKeys="true" keyProperty="routeProcessId">
insert into mes_base_route_process
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="routeId != null">route_id,</if>
<if test="processId != null">process_id,</if>
<if test="processOrder != null">process_order,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="routeId != null">#{routeId},</if>
<if test="processId != null">#{processId},</if>
<if test="processOrder != null">#{processOrder},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateMesBaseRouteProcess" parameterType="MesBaseRouteProcess">
update mes_base_route_process
<trim prefix="SET" suffixOverrides=",">
<if test="routeId != null">route_id = #{routeId},</if>
<if test="processId != null">process_id = #{processId},</if>
<if test="processOrder != null">process_order = #{processOrder},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where route_process_id = #{routeProcessId}
</update>
<delete id="deleteMesBaseRouteProcessByRouteProcessId" parameterType="Long">
delete from mes_base_route_process where route_process_id = #{routeProcessId}
</delete>
<delete id="deleteMesBaseRouteProcessByRouteProcessIds" parameterType="String">
delete from mes_base_route_process where route_process_id in
<foreach item="routeProcessId" collection="array" open="(" separator="," close=")">
#{routeProcessId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询工艺路线列表
export function listBaseRoute(query) {
return request({
url: '/mes/baseRoute/list',
method: 'get',
params: query
})
}
// 查询工艺路线下拉框列表
export function findRouteList(query) {
return request({
url: '/mes/baseRoute/findRouteList',
method: 'get',
params: query
})
}
// 查询工艺路线详细
export function getBaseRoute(routeId) {
return request({
url: '/mes/baseRoute/' + routeId,
method: 'get'
})
}
// 新增工艺路线
export function addBaseRoute(data) {
return request({
url: '/mes/baseRoute',
method: 'post',
data: data
})
}
// 修改工艺路线
export function updateBaseRoute(data) {
return request({
url: '/mes/baseRoute',
method: 'put',
data: data
})
}
// 删除工艺路线
export function delBaseRoute(routeId) {
return request({
url: '/mes/baseRoute/' + routeId,
method: 'delete'
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询工艺路线组成信息列表
export function listBaseRouteProcess(query) {
return request({
url: '/mes/baseRouteProcess/list',
method: 'get',
params: query
})
}
// 查询工艺路线组成信息详细
export function getBaseRouteProcess(routeProcessId) {
return request({
url: '/mes/baseRouteProcess/' + routeProcessId,
method: 'get'
})
}
// 新增工艺路线组成信息
export function addBaseRouteProcess(data) {
return request({
url: '/mes/baseRouteProcess',
method: 'post',
data: data
})
}
// 修改工艺路线组成信息
export function updateBaseRouteProcess(data) {
return request({
url: '/mes/baseRouteProcess',
method: 'put',
data: data
})
}
// 删除工艺路线组成信息
export function delBaseRouteProcess(routeProcessId) {
return request({
url: '/mes/baseRouteProcess/' + routeProcessId,
method: 'delete'
})
}

@ -9,6 +9,15 @@ export function listProcessInfo(query) {
})
}
// 查询工序下拉框列表
export function findProcessList(query) {
return request({
url: '/mes/processInfo/findProcessList',
method: 'get',
params: query
})
}
// 查询工序信息详细
export function getProcessInfo(processId) {
return request({

@ -0,0 +1,426 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="工艺路线名称" prop="routeName">
<el-input
v-model="queryParams.routeName"
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="['mes:baseRoute: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="['mes:baseRoute: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="['mes:baseRoute: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="['mes:baseRoute:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="baseRouteList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="工艺路线ID" align="center" prop="routeId" v-if="columns[0].visible"/>
<el-table-column label="工艺路线名称" align="center" prop="routeName" v-if="columns[1].visible"/>
<el-table-column label="工艺路线说明" align="center" prop="routeDesc" v-if="columns[2].visible"/>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[3].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.activeFlag"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[4].visible"/>
<el-table-column label="创建人" align="center" prop="createBy" v-if="columns[5].visible"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180" v-if="columns[6].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新人" align="center" prop="updateBy" v-if="columns[7].visible"/>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" v-if="columns[8].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</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="['mes:baseRoute:edit']"-->
<!-- >修改</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="routeProcessUpdate(scope.row)"
v-hasPermi="['mes:baseRoute:edit']"
>工艺步骤</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="110px">
<el-form-item label="工艺路线名称" prop="routeName">
<el-input v-model="form.routeName" placeholder="请输入工艺路线名称" />
</el-form-item>
<el-form-item label="工艺路线说明" prop="routeDesc">
<el-input v-model="form.routeDesc" placeholder="请输入工艺路线说明" />
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-radio-group v-model="form.activeFlag">
<el-radio
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" 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>
<!-- 添加或修改工艺路线步骤对话框 -->
<el-dialog :title="title" :visible.sync="routeProcess0pen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="工艺路线名称" prop="routeName">
<el-input v-model="form.routeName" placeholder="请输入工艺路线名称" :disabled="true"/>
</el-form-item>
<el-divider content-position="center">工艺路线组成信息</el-divider>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddMesBaseRouteProcess"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteMesBaseRouteProcess"></el-button>
</el-col>
</el-row>
<el-table :data="mesBaseRouteProcessList" :row-class-name="rowMesBaseRouteProcessIndex" @selection-change="handleMesBaseRouteProcessSelectionChange" ref="mesBaseRouteProcess">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" prop="index" v-if="false"/>
<el-table-column label="工艺路线顺序" prop="processOrder" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.processOrder" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="工序" prop="processId">
<template slot-scope="scope">
<el-select v-model="scope.row.processId" filterable placeholder="请选择工序" clearable>
<el-option
v-for="item in processList"
:key="item.processId"
:label="item.processName"
:value="item.processId"
:disabled="isProcessIdDisabled(item.processId)"
></el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</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 {
listBaseRoute,
getBaseRoute,
delBaseRoute,
addBaseRoute,
updateBaseRoute,
findRouteList
} from "@/api/mes/baseRoute";
import {findProcessList} from "@//api/mes/processInfo";
export default {
name: "BaseRoute",
dicts: ['active_flag'],
data() {
return {
//
loading: true,
//
ids: [],
//
checkedMesBaseRouteProcess: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 线
baseRouteList: [],
// 线
mesBaseRouteProcessList: [],
//
title: "",
//
open: false,
//
routeProcess0pen: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
routeName: null,
routeDesc: null,
activeFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
},
//
form: {},
//
rules: {
routeName: [
{ required: true, message: "工艺路线名称不能为空", trigger: "blur" }
],
activeFlag: [
{ required: true, message: "激活标识不能为空", trigger: "change" }
],
},
columns: [
{ key: 0, label: `工艺路线ID`, visible: true },
{ key: 1, label: `工艺路线名称`, visible: true },
{ key: 2, label: `工艺路线说明`, visible: true },
{ key: 3, label: `激活标识`, visible: true },
{ key: 4, label: `备注`, visible: true },
{ key: 5, label: `创建人`, visible: true },
{ key: 6, label: `创建时间`, visible: true },
{ key: 7, label: `更新人`, visible: true },
{ key: 8, label: `更新时间`, visible: true },
],
//
processList: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询工艺路线列表 */
getList() {
this.loading = true;
findProcessList(null).then(response => {
this.processList = response.data
})
listBaseRoute(this.queryParams).then(response => {
this.baseRouteList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.routeProcess0pen = false;
this.reset();
},
//
reset() {
this.form = {
routeId: null,
routeName: null,
routeDesc: null,
activeFlag: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.mesBaseRouteProcessList = [];
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.routeId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加工艺路线";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const routeId = row.routeId || this.ids
getBaseRoute(routeId).then(response => {
this.form = response.data;
this.mesBaseRouteProcessList = response.data.mesBaseRouteProcessList;
this.open = true;
this.title = "修改工艺路线";
});
},
isProcessIdDisabled(processId) {
// true false
return this.mesBaseRouteProcessList.some(item => item.processId === processId);
},
//线
routeProcessUpdate(row) {
this.reset();
const routeId = row.routeId || this.ids
getBaseRoute(routeId).then(response => {
this.form = response.data;
this.mesBaseRouteProcessList = response.data.mesBaseRouteProcessList;
this.routeProcess0pen = true;
this.title = "维护工艺路线步骤";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.mesBaseRouteProcessList = this.mesBaseRouteProcessList;
if (this.form.routeId != null) {
updateBaseRoute(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.routeProcess0pen = false;
this.getList();
});
} else {
addBaseRoute(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const routeIds = row.routeId || this.ids;
this.$modal.confirm('是否确认删除工艺路线编号为"' + routeIds + '"的数据项?').then(function() {
return delBaseRoute(routeIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 工艺路线组成信息序号 */
rowMesBaseRouteProcessIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
row.processOrder = (rowIndex + 1) * 10;
},
/** 工艺路线组成信息添加按钮操作 */
handleAddMesBaseRouteProcess() {
let obj = {};
obj.processId = "";
obj.processOrder = "";
obj.remark = "";
obj.createBy = "";
obj.createTime = "";
obj.updateBy = "";
obj.updateTime = "";
this.mesBaseRouteProcessList.push(obj);
},
/** 工艺路线组成信息删除按钮操作 */
handleDeleteMesBaseRouteProcess() {
if (this.checkedMesBaseRouteProcess.length == 0) {
this.$modal.msgError("请先选择要删除的工艺路线组成信息数据");
} else {
const mesBaseRouteProcessList = this.mesBaseRouteProcessList;
const checkedMesBaseRouteProcess = this.checkedMesBaseRouteProcess;
this.mesBaseRouteProcessList = mesBaseRouteProcessList.filter(function(item) {
return checkedMesBaseRouteProcess.indexOf(item.index) == -1
});
}
},
/** 复选框选中数据 */
handleMesBaseRouteProcessSelectionChange(selection) {
this.checkedMesBaseRouteProcess = selection.map(item => item.index)
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/baseRoute/export', {
...this.queryParams
}, `baseRoute_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,338 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="工艺路线" prop="routeId">
<el-select v-model="queryParams.routeId" filterable placeholder="请选择工艺路线" clearable>
<el-option
v-for="item in routeList"
:key="item.routeId"
:label="item.routeName"
:value="item.routeId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工序" prop="processId">
<el-select v-model="queryParams.processId" filterable placeholder="请选择工序" clearable>
<el-option
v-for="item in processList"
:key="item.processId"
:label="item.processName"
:value="item.processId"
></el-option>
</el-select>
</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="['mes:baseRouteProcess: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="['mes:baseRouteProcess: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="['mes:baseRouteProcess: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="['mes:baseRouteProcess:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="baseRouteProcessList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="工艺路线组成ID" align="center" prop="routeProcessId" v-if="columns[0].visible"/>
<el-table-column label="工艺路线ID" align="center" prop="routeId" v-if="columns[1].visible"/>
<el-table-column label="工序ID" align="center" prop="processId" v-if="columns[2].visible"/>
<el-table-column label="工艺路线顺序" align="center" prop="processOrder" v-if="columns[3].visible"/>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[4].visible"/>
<el-table-column label="创建人" align="center" prop="createBy" v-if="columns[5].visible"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180" v-if="columns[6].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="更新人" align="center" prop="updateBy" v-if="columns[7].visible"/>
<el-table-column label="更新时间" align="center" prop="updateTime" width="180" v-if="columns[8].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</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="['mes:baseRouteProcess:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:baseRouteProcess: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="100px">
<el-form-item label="工艺路线" prop="routeId">
<el-select v-model="form.routeId" filterable placeholder="请选择工艺路线" clearable>
<el-option
v-for="item in routeList"
:key="item.routeId"
:label="item.routeName"
:value="item.routeId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工序ID" prop="processId">
<el-select v-model="form.processId" filterable placeholder="请选择工序" clearable>
<el-option
v-for="item in processList"
:key="item.processId"
:label="item.processName"
:value="item.processId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工艺路线顺序" prop="processOrder">
<el-input v-model="form.processOrder" placeholder="请输入工艺路线顺序" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" 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 { listBaseRouteProcess, getBaseRouteProcess, delBaseRouteProcess, addBaseRouteProcess, updateBaseRouteProcess } from "@/api/mes/baseRouteProcess";
import {findProcessList} from "@//api/mes/processInfo";
import {findRouteList} from "@//api/mes/baseRoute";
export default {
name: "BaseRouteProcess",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 线
baseRouteProcessList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
routeId: null,
processId: null,
processOrder: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
},
//
form: {},
//
rules: {
routeId: [
{ required: true, message: "工艺路线ID不能为空", trigger: "blur" }
],
processId: [
{ required: true, message: "工序ID不能为空", trigger: "blur" }
],
},
columns: [
{ key: 0, label: `工艺路线组成ID`, visible: false },
{ key: 1, label: `工艺路线ID`, visible: true },
{ key: 2, label: `工序ID`, visible: true },
{ key: 3, label: `工艺路线顺序`, visible: true },
{ key: 4, label: `备注`, visible: true },
{ key: 5, label: `创建人`, visible: false },
{ key: 6, label: `创建时间`, visible: true },
{ key: 7, label: `更新人`, visible: false },
{ key: 8, label: `更新时间`, visible: true },
],
//
processList: [],
//线
routeList: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询工艺路线组成信息列表 */
getList() {
this.loading = true;
findProcessList(null).then(response => {
this.processList = response.data
})
findRouteList(null).then(response => {
this.routeList = response.data
})
listBaseRouteProcess(this.queryParams).then(response => {
this.baseRouteProcessList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
routeProcessId: null,
routeId: null,
processId: null,
processOrder: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: 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.routeProcessId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加工艺路线组成信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const routeProcessId = row.routeProcessId || this.ids
getBaseRouteProcess(routeProcessId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改工艺路线组成信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.routeProcessId != null) {
updateBaseRouteProcess(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBaseRouteProcess(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const routeProcessIds = row.routeProcessId || this.ids;
this.$modal.confirm('是否确认删除工艺路线组成信息编号为"' + routeProcessIds + '"的数据项?').then(function() {
return delBaseRouteProcess(routeProcessIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/baseRouteProcess/export', {
...this.queryParams
}, `baseRouteProcess_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save