youjianchi
7 months ago
12 changed files with 1027 additions and 1 deletions
@ -0,0 +1,153 @@ |
|||
package com.ruoyi.erp.domain; |
|||
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 设备履历对象 erp_equipment_resume |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-04-27 |
|||
*/ |
|||
public class ErpEquipmentResume extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 主键ID */ |
|||
private Long id; |
|||
|
|||
/** 删除标志(0代表存在 1代表删除) */ |
|||
private String delFlag; |
|||
|
|||
/** 生产订单号 */ |
|||
@Excel(name = "生产订单号") |
|||
private String makeNo; |
|||
|
|||
/** 关联销售订单号 */ |
|||
@Excel(name = "关联销售订单号") |
|||
private String saleNo; |
|||
|
|||
/** 料号 */ |
|||
@Excel(name = "料号") |
|||
private String materialNo; |
|||
|
|||
/** 入库单号 */ |
|||
@Excel(name = "入库单号") |
|||
private String inboundOrderNo; |
|||
|
|||
/** 出货设备id */ |
|||
@Excel(name = "出货设备id") |
|||
private String equipmentId; |
|||
|
|||
/** 设备型号 */ |
|||
@Excel(name = "设备型号") |
|||
private String equipmentModel; |
|||
|
|||
/** 流水号 */ |
|||
@Excel(name = "流水号") |
|||
private String serialNo; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setDelFlag(String delFlag) |
|||
{ |
|||
this.delFlag = delFlag; |
|||
} |
|||
|
|||
public String getDelFlag() |
|||
{ |
|||
return delFlag; |
|||
} |
|||
public void setMakeNo(String makeNo) |
|||
{ |
|||
this.makeNo = makeNo; |
|||
} |
|||
|
|||
public String getMakeNo() |
|||
{ |
|||
return makeNo; |
|||
} |
|||
public void setSaleNo(String saleNo) |
|||
{ |
|||
this.saleNo = saleNo; |
|||
} |
|||
|
|||
public String getSaleNo() |
|||
{ |
|||
return saleNo; |
|||
} |
|||
public void setMaterialNo(String materialNo) |
|||
{ |
|||
this.materialNo = materialNo; |
|||
} |
|||
|
|||
public String getMaterialNo() |
|||
{ |
|||
return materialNo; |
|||
} |
|||
public void setInboundOrderNo(String inboundOrderNo) |
|||
{ |
|||
this.inboundOrderNo = inboundOrderNo; |
|||
} |
|||
|
|||
public String getInboundOrderNo() |
|||
{ |
|||
return inboundOrderNo; |
|||
} |
|||
public void setEquipmentId(String equipmentId) |
|||
{ |
|||
this.equipmentId = equipmentId; |
|||
} |
|||
|
|||
public String getEquipmentId() |
|||
{ |
|||
return equipmentId; |
|||
} |
|||
public void setEquipmentModel(String equipmentModel) |
|||
{ |
|||
this.equipmentModel = equipmentModel; |
|||
} |
|||
|
|||
public String getEquipmentModel() |
|||
{ |
|||
return equipmentModel; |
|||
} |
|||
public void setSerialNo(String serialNo) |
|||
{ |
|||
this.serialNo = serialNo; |
|||
} |
|||
|
|||
public String getSerialNo() |
|||
{ |
|||
return serialNo; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("delFlag", getDelFlag()) |
|||
.append("createBy", getCreateBy()) |
|||
.append("createTime", getCreateTime()) |
|||
.append("updateBy", getUpdateBy()) |
|||
.append("updateTime", getUpdateTime()) |
|||
.append("remark", getRemark()) |
|||
.append("makeNo", getMakeNo()) |
|||
.append("saleNo", getSaleNo()) |
|||
.append("materialNo", getMaterialNo()) |
|||
.append("inboundOrderNo", getInboundOrderNo()) |
|||
.append("equipmentId", getEquipmentId()) |
|||
.append("equipmentModel", getEquipmentModel()) |
|||
.append("serialNo", getSerialNo()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,77 @@ |
|||
package com.ruoyi.erp.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.erp.domain.ErpEquipmentResume; |
|||
|
|||
/** |
|||
* 设备履历Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-04-27 |
|||
*/ |
|||
public interface ErpEquipmentResumeMapper |
|||
{ |
|||
/** |
|||
* 查询设备履历 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 设备履历 |
|||
*/ |
|||
public ErpEquipmentResume selectErpEquipmentResumeById(Long id); |
|||
|
|||
/** |
|||
* 查询设备履历列表 |
|||
* |
|||
* @param erpEquipmentResume 设备履历 |
|||
* @return 设备履历集合 |
|||
*/ |
|||
public List<ErpEquipmentResume> selectErpEquipmentResumeList(ErpEquipmentResume erpEquipmentResume); |
|||
|
|||
/** |
|||
* 新增设备履历 |
|||
* |
|||
* @param erpEquipmentResume 设备履历 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertErpEquipmentResume(ErpEquipmentResume erpEquipmentResume); |
|||
|
|||
/** |
|||
* 修改设备履历 |
|||
* |
|||
* @param erpEquipmentResume 设备履历 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateErpEquipmentResume(ErpEquipmentResume erpEquipmentResume); |
|||
|
|||
/** |
|||
* 删除设备履历 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteErpEquipmentResumeById(Long id); |
|||
|
|||
/** |
|||
* 批量删除设备履历 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteErpEquipmentResumeByIds(String[] ids); |
|||
|
|||
/** |
|||
* 作废设备履历 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 结果 |
|||
*/ |
|||
public int cancelErpEquipmentResumeById(Long id); |
|||
|
|||
/** |
|||
* 恢复设备履历 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 结果 |
|||
*/ |
|||
public int restoreErpEquipmentResumeById(Long id); |
|||
} |
@ -0,0 +1,75 @@ |
|||
package com.ruoyi.erp.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.erp.domain.ErpEquipmentResume; |
|||
|
|||
/** |
|||
* 设备履历Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-04-27 |
|||
*/ |
|||
public interface IErpEquipmentResumeService |
|||
{ |
|||
/** |
|||
* 查询设备履历 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 设备履历 |
|||
*/ |
|||
public ErpEquipmentResume selectErpEquipmentResumeById(Long id); |
|||
|
|||
/** |
|||
* 查询设备履历列表 |
|||
* |
|||
* @param erpEquipmentResume 设备履历 |
|||
* @return 设备履历集合 |
|||
*/ |
|||
public List<ErpEquipmentResume> selectErpEquipmentResumeList(ErpEquipmentResume erpEquipmentResume); |
|||
|
|||
/** |
|||
* 新增设备履历 |
|||
* |
|||
* @param erpEquipmentResume 设备履历 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertErpEquipmentResume(ErpEquipmentResume erpEquipmentResume); |
|||
|
|||
/** |
|||
* 修改设备履历 |
|||
* |
|||
* @param erpEquipmentResume 设备履历 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateErpEquipmentResume(ErpEquipmentResume erpEquipmentResume); |
|||
|
|||
/** |
|||
* 批量删除设备履历 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteErpEquipmentResumeByIds(String ids); |
|||
|
|||
/** |
|||
* 删除设备履历信息 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteErpEquipmentResumeById(Long id); |
|||
|
|||
/** |
|||
* 作废设备履历 |
|||
* @param id 设备履历ID |
|||
* @return |
|||
*/ |
|||
int cancelErpEquipmentResumeById(Long id); |
|||
|
|||
/** |
|||
* 恢复设备履历 |
|||
* @param id 设备履历ID |
|||
* @return |
|||
*/ |
|||
int restoreErpEquipmentResumeById(Long id); |
|||
} |
@ -0,0 +1,134 @@ |
|||
package com.ruoyi.erp.service.impl; |
|||
|
|||
import java.util.List; |
|||
|
|||
import com.ruoyi.common.core.redis.RedisCache; |
|||
import com.ruoyi.common.utils.DateUtils; |
|||
import com.ruoyi.common.utils.ShiroUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.erp.mapper.ErpEquipmentResumeMapper; |
|||
import com.ruoyi.erp.domain.ErpEquipmentResume; |
|||
import com.ruoyi.erp.service.IErpEquipmentResumeService; |
|||
import com.ruoyi.common.core.text.Convert; |
|||
|
|||
/** |
|||
* 设备履历Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-04-27 |
|||
*/ |
|||
@Service |
|||
public class ErpEquipmentResumeServiceImpl implements IErpEquipmentResumeService |
|||
{ |
|||
@Autowired |
|||
private ErpEquipmentResumeMapper erpEquipmentResumeMapper; |
|||
|
|||
@Autowired |
|||
private RedisCache redisCache; |
|||
|
|||
/** |
|||
* 查询设备履历 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 设备履历 |
|||
*/ |
|||
@Override |
|||
public ErpEquipmentResume selectErpEquipmentResumeById(Long id) |
|||
{ |
|||
return erpEquipmentResumeMapper.selectErpEquipmentResumeById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询设备履历列表 |
|||
* |
|||
* @param erpEquipmentResume 设备履历 |
|||
* @return 设备履历 |
|||
*/ |
|||
@Override |
|||
public List<ErpEquipmentResume> selectErpEquipmentResumeList(ErpEquipmentResume erpEquipmentResume) |
|||
{ |
|||
return erpEquipmentResumeMapper.selectErpEquipmentResumeList(erpEquipmentResume); |
|||
} |
|||
|
|||
/** |
|||
* 新增设备履历 |
|||
* |
|||
* @param erpEquipmentResume 设备履历 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertErpEquipmentResume(ErpEquipmentResume erpEquipmentResume) |
|||
{ |
|||
String loginName = ShiroUtils.getLoginName(); |
|||
erpEquipmentResume.setCreateBy(loginName); |
|||
erpEquipmentResume.setCreateTime(DateUtils.getNowDate()); |
|||
// 生成编号,年月日规则
|
|||
String billNo = redisCache.generateBillNo("SB"); |
|||
erpEquipmentResume.setEquipmentId(billNo); |
|||
return erpEquipmentResumeMapper.insertErpEquipmentResume(erpEquipmentResume); |
|||
} |
|||
|
|||
/** |
|||
* 修改设备履历 |
|||
* |
|||
* @param erpEquipmentResume 设备履历 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateErpEquipmentResume(ErpEquipmentResume erpEquipmentResume) |
|||
{ |
|||
String loginName = ShiroUtils.getLoginName(); |
|||
erpEquipmentResume.setUpdateBy(loginName); |
|||
erpEquipmentResume.setUpdateTime(DateUtils.getNowDate()); |
|||
return erpEquipmentResumeMapper.updateErpEquipmentResume(erpEquipmentResume); |
|||
} |
|||
|
|||
/** |
|||
* 删除设备履历对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteErpEquipmentResumeByIds(String ids) |
|||
{ |
|||
return erpEquipmentResumeMapper.deleteErpEquipmentResumeByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除设备履历信息 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteErpEquipmentResumeById(Long id) |
|||
{ |
|||
return erpEquipmentResumeMapper.deleteErpEquipmentResumeById(id); |
|||
} |
|||
|
|||
/** |
|||
* 作废设备履历 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int cancelErpEquipmentResumeById(Long id) |
|||
{ |
|||
return erpEquipmentResumeMapper.cancelErpEquipmentResumeById(id); |
|||
} |
|||
|
|||
/** |
|||
* 恢复设备履历信息 |
|||
* |
|||
* @param id 设备履历ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int restoreErpEquipmentResumeById(Long id) |
|||
{ |
|||
return erpEquipmentResumeMapper.restoreErpEquipmentResumeById(id); |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.ruoyi.system.dto; |
|||
|
|||
import com.ruoyi.erp.domain.ErpEquipmentResume; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author xiguniang |
|||
* @description 设备履历料号 |
|||
* @date 2024/4/28 19:12 |
|||
*/ |
|||
@Data |
|||
public class SysEquipMaterialDto implements Serializable { |
|||
private static final long serialVersionUID = -3491668293466029506L; |
|||
private String quoteId; |
|||
private String materialCode; |
|||
private String materialName; |
|||
private String materialType; |
|||
private String processMethod; |
|||
private String brand; |
|||
private String photoUrl; |
|||
private String unit; |
|||
private String describe; |
|||
private String makeNo; |
|||
private Integer curIndex; |
|||
} |
@ -0,0 +1,119 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.ruoyi.erp.mapper.ErpEquipmentResumeMapper"> |
|||
|
|||
<resultMap type="ErpEquipmentResume" id="ErpEquipmentResumeResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="delFlag" column="del_flag" /> |
|||
<result property="createBy" column="create_by" /> |
|||
<result property="createTime" column="create_time" /> |
|||
<result property="updateBy" column="update_by" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
<result property="remark" column="remark" /> |
|||
<result property="makeNo" column="make_no" /> |
|||
<result property="saleNo" column="sale_no" /> |
|||
<result property="materialNo" column="material_no" /> |
|||
<result property="inboundOrderNo" column="inbound_order_no" /> |
|||
<result property="equipmentId" column="equipment_id" /> |
|||
<result property="equipmentModel" column="equipment_model" /> |
|||
<result property="serialNo" column="serial_no" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectErpEquipmentResumeVo"> |
|||
select a.id, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.make_no, a.sale_no, a.material_no, a.inbound_order_no, a.equipment_id, a.equipment_model, a.serial_no from erp_equipment_resume a |
|||
</sql> |
|||
|
|||
<select id="selectErpEquipmentResumeList" parameterType="ErpEquipmentResume" resultMap="ErpEquipmentResumeResult"> |
|||
<include refid="selectErpEquipmentResumeVo"/> |
|||
<where> |
|||
<if test="makeNo != null and makeNo != ''"> and a.make_no = #{makeNo}</if> |
|||
<if test="saleNo != null and saleNo != ''"> and a.sale_no = #{saleNo}</if> |
|||
<if test="materialNo != null and materialNo != ''"> and a.material_no = #{materialNo}</if> |
|||
<if test="inboundOrderNo != null and inboundOrderNo != ''"> and a.inbound_order_no = #{inboundOrderNo}</if> |
|||
<if test="equipmentId != null and equipmentId != ''"> and a.equipment_id = #{equipmentId}</if> |
|||
<if test="equipmentModel != null and equipmentModel != ''"> and a.equipment_model = #{equipmentModel}</if> |
|||
<if test="serialNo != null and serialNo != ''"> and a.serial_no = #{serialNo}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectErpEquipmentResumeById" parameterType="Long" resultMap="ErpEquipmentResumeResult"> |
|||
<include refid="selectErpEquipmentResumeVo"/> |
|||
where a.id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertErpEquipmentResume" parameterType="ErpEquipmentResume" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into erp_equipment_resume |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="delFlag != null">del_flag,</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> |
|||
<if test="remark != null">remark,</if> |
|||
<if test="makeNo != null">make_no,</if> |
|||
<if test="saleNo != null">sale_no,</if> |
|||
<if test="materialNo != null">material_no,</if> |
|||
<if test="inboundOrderNo != null">inbound_order_no,</if> |
|||
<if test="equipmentId != null">equipment_id,</if> |
|||
<if test="equipmentModel != null">equipment_model,</if> |
|||
<if test="serialNo != null">serial_no,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="delFlag != null">#{delFlag},</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> |
|||
<if test="remark != null">#{remark},</if> |
|||
<if test="makeNo != null">#{makeNo},</if> |
|||
<if test="saleNo != null">#{saleNo},</if> |
|||
<if test="materialNo != null">#{materialNo},</if> |
|||
<if test="inboundOrderNo != null">#{inboundOrderNo},</if> |
|||
<if test="equipmentId != null">#{equipmentId},</if> |
|||
<if test="equipmentModel != null">#{equipmentModel},</if> |
|||
<if test="serialNo != null">#{serialNo},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateErpEquipmentResume" parameterType="ErpEquipmentResume"> |
|||
update erp_equipment_resume |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="delFlag != null">del_flag = #{delFlag},</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> |
|||
<if test="remark != null">remark = #{remark},</if> |
|||
<if test="makeNo != null">make_no = #{makeNo},</if> |
|||
<if test="saleNo != null">sale_no = #{saleNo},</if> |
|||
<if test="materialNo != null">material_no = #{materialNo},</if> |
|||
<if test="inboundOrderNo != null">inbound_order_no = #{inboundOrderNo},</if> |
|||
<if test="equipmentId != null">equipment_id = #{equipmentId},</if> |
|||
<if test="equipmentModel != null">equipment_model = #{equipmentModel},</if> |
|||
<if test="serialNo != null">serial_no = #{serialNo},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteErpEquipmentResumeById" parameterType="Long"> |
|||
delete from erp_equipment_resume where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteErpEquipmentResumeByIds" parameterType="String"> |
|||
delete from erp_equipment_resume where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<update id="cancelErpEquipmentResumeById" parameterType="Long"> |
|||
update erp_equipment_resume set del_flag = '1' where id = #{id} |
|||
</update> |
|||
|
|||
<update id="restoreErpEquipmentResumeById" parameterType="Long"> |
|||
update erp_equipment_resume set del_flag = '0' where id = #{id} |
|||
</update> |
|||
|
|||
</mapper> |
@ -0,0 +1,215 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('添加设备履历')" /> |
|||
<th:block th:include="include :: select2-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal" id="form-equipMaterial-add" th:object="${equipMaterial}"> |
|||
<input name="curIndex" th:field="*{curIndex}" type="hidden"> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">生产订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="makeNo" th:field="*{makeNo}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">关联销售订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="saleNo" th:field="*{quoteId}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">料号:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialNo" th:field="*{materialCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">物料名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="materialNo" th:field="*{materialName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">物料类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select disabled id="selectMaterialType" class="form-control m-b select2-multiple" th:field="*{materialType}" th:with="childList=${@category.getChildByCode('materialType')}"> |
|||
<optgroup> |
|||
<option value="">请选择</option> |
|||
</optgroup> |
|||
<optgroup th:each="child: ${childList}" th:label="${child.name}"> |
|||
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option> |
|||
</optgroup> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label is-required">加工方式:</label> |
|||
<div class="col-sm-8"> |
|||
<select disabled name="processMethod" class="form-control m-b" th:field="*{processMethod}" th:with="type=${@dict.getType('processMethod')}" required> |
|||
<option value=""></option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">单位:</label> |
|||
<div class="col-sm-8"> |
|||
<select disabled name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">品牌:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly name="brand" th:field="*{brand}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">描述:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea readonly name="describe" class="form-control">[[*{describe}]]</textarea> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button> |
|||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-sub-table-1"></table> |
|||
</div> |
|||
</div> |
|||
|
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: select2-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "erp/equipmentResume"; |
|||
|
|||
$(function(){ |
|||
|
|||
var options = { |
|||
id: 'bootstrap-sub-table-1', |
|||
pagination: false, |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
showColumns: false, |
|||
sidePagination: "client", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'index', |
|||
align: 'center', |
|||
title: "序号", |
|||
formatter: function (value, row, index) { |
|||
var columnIndex = $.common.sprintf("<input type='hidden' name='equipResumes[%s].index' value='%s'>", index,$.table.serialNumber(index)); |
|||
var columnId = $.common.sprintf("<input type='hidden' name='equipResumes[%s].id' value='%s'>", index, row.id); |
|||
return columnIndex + $.table.serialNumber(index) + columnId; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'equipmentId', |
|||
align: 'center', |
|||
title: '出货设备id', |
|||
formatter: function(value, row, index) { |
|||
return '添加后系统自动生成'; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'equipmentModel', |
|||
align: 'center', |
|||
title: '设备型号', |
|||
formatter: function(value, row, index) { |
|||
var html = $.common.sprintf("<input class='form-control equipmentModel' type='text' name='equipResumes[%s].equipmentModel' value='%s'>", index, value); |
|||
return html; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'serialNo', |
|||
align: 'center', |
|||
title: '流水号', |
|||
formatter: function(value, row, index) { |
|||
var html = $.common.sprintf("<input class='form-control' type='text' name='equipResumes[%s].serialNo' value='%s'>", index, value); |
|||
return html; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'producePic', |
|||
align: 'center', |
|||
title: '生产图片', |
|||
formatter: function(value, row, index) { |
|||
|
|||
} |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index); |
|||
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>'; |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
|
|||
|
|||
}) |
|||
|
|||
function addRow() { |
|||
var count = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; |
|||
var row = { |
|||
index: $.table.serialNumber(count), |
|||
equipmentId: "", |
|||
equipmentModel: "", |
|||
serialNo: "", |
|||
producePic: "", |
|||
} |
|||
sub.addRow(row); |
|||
} |
|||
|
|||
|
|||
$("#form-equipMaterial-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
/*function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-equipMaterial-add').serialize()); |
|||
} |
|||
}*/ |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue