王晓迪
1 week ago
8 changed files with 1350 additions and 0 deletions
@ -0,0 +1,201 @@ |
|||||
|
package com.ruoyi.system.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.ruoyi.common.annotation.Excel; |
||||
|
import com.ruoyi.common.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* 设备履历-问题清单列对象 process_issue_record |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-11-05 |
||||
|
*/ |
||||
|
public class ProcessIssueRecord extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 主键 */ |
||||
|
private Long id; |
||||
|
|
||||
|
//生产订单号
|
||||
|
private String makeNo; |
||||
|
|
||||
|
//料号
|
||||
|
private String materialNo; |
||||
|
|
||||
|
/** 出货设备id */ |
||||
|
private String shippingDeviceId; |
||||
|
|
||||
|
/** 追踪码 */ |
||||
|
private String serialNo; |
||||
|
|
||||
|
/** 工序 */ |
||||
|
@Excel(name = "工序",sort = 1) |
||||
|
private String process; |
||||
|
|
||||
|
/** 异常时间 */ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||
|
@Excel(name = "异常时间", dateFormat = "yyyy-MM-dd",sort = 2) |
||||
|
private Date abnormalTime; |
||||
|
|
||||
|
/** 问题描述 */ |
||||
|
@Excel(name = "问题描述",sort = 3) |
||||
|
private String questionDescribe; |
||||
|
|
||||
|
/** 解决办法 */ |
||||
|
@Excel(name = "解决办法",sort = 4) |
||||
|
private String solution; |
||||
|
|
||||
|
/** 解决时间 */ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||
|
@Excel(name = "解决时间", dateFormat = "yyyy-MM-dd",sort = 5) |
||||
|
private Date resolveTime; |
||||
|
|
||||
|
@Excel(name = "记录人",sort = 6) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 审核人 */ |
||||
|
@Excel(name = "审核人",sort = 7) |
||||
|
private String approveBy; |
||||
|
|
||||
|
@Excel(name = "备注",sort = 8) |
||||
|
private String remark; |
||||
|
|
||||
|
public void setId(Long id) |
||||
|
{ |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getId() |
||||
|
{ |
||||
|
return id; |
||||
|
} |
||||
|
public void setShippingDeviceId(String shippingDeviceId) |
||||
|
{ |
||||
|
this.shippingDeviceId = shippingDeviceId; |
||||
|
} |
||||
|
|
||||
|
public String getShippingDeviceId() |
||||
|
{ |
||||
|
return shippingDeviceId; |
||||
|
} |
||||
|
public void setSerialNo(String serialNo) |
||||
|
{ |
||||
|
this.serialNo = serialNo; |
||||
|
} |
||||
|
|
||||
|
public String getSerialNo() |
||||
|
{ |
||||
|
return serialNo; |
||||
|
} |
||||
|
public void setProcess(String process) |
||||
|
{ |
||||
|
this.process = process; |
||||
|
} |
||||
|
|
||||
|
public String getProcess() |
||||
|
{ |
||||
|
return process; |
||||
|
} |
||||
|
public void setAbnormalTime(Date abnormalTime) |
||||
|
{ |
||||
|
this.abnormalTime = abnormalTime; |
||||
|
} |
||||
|
|
||||
|
public Date getAbnormalTime() |
||||
|
{ |
||||
|
return abnormalTime; |
||||
|
} |
||||
|
public void setQuestionDescribe(String questionDescribe) |
||||
|
{ |
||||
|
this.questionDescribe = questionDescribe; |
||||
|
} |
||||
|
|
||||
|
public String getQuestionDescribe() |
||||
|
{ |
||||
|
return questionDescribe; |
||||
|
} |
||||
|
public void setSolution(String solution) |
||||
|
{ |
||||
|
this.solution = solution; |
||||
|
} |
||||
|
|
||||
|
public String getSolution() |
||||
|
{ |
||||
|
return solution; |
||||
|
} |
||||
|
public void setResolveTime(Date resolveTime) |
||||
|
{ |
||||
|
this.resolveTime = resolveTime; |
||||
|
} |
||||
|
|
||||
|
public Date getResolveTime() |
||||
|
{ |
||||
|
return resolveTime; |
||||
|
} |
||||
|
public void setApproveBy(String approveBy) |
||||
|
{ |
||||
|
this.approveBy = approveBy; |
||||
|
} |
||||
|
|
||||
|
public String getApproveBy() |
||||
|
{ |
||||
|
return approveBy; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getCreateBy() { |
||||
|
return createBy; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void setCreateBy(String createBy) { |
||||
|
this.createBy = createBy; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getRemark() { |
||||
|
return remark; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void setRemark(String remark) { |
||||
|
this.remark = remark; |
||||
|
} |
||||
|
|
||||
|
public String getMakeNo() { |
||||
|
return makeNo; |
||||
|
} |
||||
|
|
||||
|
public void setMakeNo(String makeNo) { |
||||
|
this.makeNo = makeNo; |
||||
|
} |
||||
|
|
||||
|
public String getMaterialNo() { |
||||
|
return materialNo; |
||||
|
} |
||||
|
|
||||
|
public void setMaterialNo(String materialNo) { |
||||
|
this.materialNo = materialNo; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("id", getId()) |
||||
|
.append("shippingDeviceId", getShippingDeviceId()) |
||||
|
.append("serialNo", getSerialNo()) |
||||
|
.append("process", getProcess()) |
||||
|
.append("abnormalTime", getAbnormalTime()) |
||||
|
.append("questionDescribe", getQuestionDescribe()) |
||||
|
.append("solution", getSolution()) |
||||
|
.append("resolveTime", getResolveTime()) |
||||
|
.append("createBy", getCreateBy()) |
||||
|
.append("approveBy", getApproveBy()) |
||||
|
.append("remark", getRemark()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,79 @@ |
|||||
|
package com.ruoyi.system.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.system.domain.ProcessIssueRecord; |
||||
|
|
||||
|
/** |
||||
|
* 设备履历-问题清单列Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-11-05 |
||||
|
*/ |
||||
|
public interface ProcessIssueRecordMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询设备履历-问题清单列 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 设备履历-问题清单列 |
||||
|
*/ |
||||
|
public ProcessIssueRecord selectProcessIssueRecordById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询设备履历-问题清单列列表 |
||||
|
* |
||||
|
* @param processIssueRecord 设备履历-问题清单列 |
||||
|
* @return 设备履历-问题清单列集合 |
||||
|
*/ |
||||
|
public List<ProcessIssueRecord> selectProcessIssueRecordList(ProcessIssueRecord processIssueRecord); |
||||
|
|
||||
|
/** |
||||
|
* 新增设备履历-问题清单列 |
||||
|
* |
||||
|
* @param processIssueRecord 设备履历-问题清单列 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertProcessIssueRecord(ProcessIssueRecord processIssueRecord); |
||||
|
|
||||
|
/** |
||||
|
* 修改设备履历-问题清单列 |
||||
|
* |
||||
|
* @param processIssueRecord 设备履历-问题清单列 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateProcessIssueRecord(ProcessIssueRecord processIssueRecord); |
||||
|
|
||||
|
/** |
||||
|
* 删除设备履历-问题清单列 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteProcessIssueRecordById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除设备履历-问题清单列 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteProcessIssueRecordByIds(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 作废设备履历-问题清单列 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int cancelProcessIssueRecordById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 恢复设备履历-问题清单列 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int restoreProcessIssueRecordById(Long id); |
||||
|
|
||||
|
public int removeProcessIssueRecord(ProcessIssueRecord processIssueRecord); |
||||
|
} |
@ -0,0 +1,80 @@ |
|||||
|
package com.ruoyi.system.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.system.domain.ProcessIssueRecord; |
||||
|
|
||||
|
/** |
||||
|
* 设备履历-问题清单列Service接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-11-05 |
||||
|
*/ |
||||
|
public interface IProcessIssueRecordService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询设备履历-问题清单列 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 设备履历-问题清单列 |
||||
|
*/ |
||||
|
public ProcessIssueRecord selectProcessIssueRecordById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询设备履历-问题清单列列表 |
||||
|
* |
||||
|
* @param processIssueRecord 设备履历-问题清单列 |
||||
|
* @return 设备履历-问题清单列集合 |
||||
|
*/ |
||||
|
public List<ProcessIssueRecord> selectProcessIssueRecordList(ProcessIssueRecord processIssueRecord); |
||||
|
|
||||
|
/** |
||||
|
* 新增设备履历-问题清单列 |
||||
|
* |
||||
|
* @param processIssueRecord 设备履历-问题清单列 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertProcessIssueRecord(ProcessIssueRecord processIssueRecord); |
||||
|
|
||||
|
/** |
||||
|
* 修改设备履历-问题清单列 |
||||
|
* |
||||
|
* @param processIssueRecord 设备履历-问题清单列 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateProcessIssueRecord(ProcessIssueRecord processIssueRecord); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除设备履历-问题清单列 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteProcessIssueRecordByIds(String ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除设备履历-问题清单列信息 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteProcessIssueRecordById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 作废设备履历-问题清单列 |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int cancelProcessIssueRecordById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 恢复设备履历-问题清单列 |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int restoreProcessIssueRecordById(Long id); |
||||
|
|
||||
|
public String importProcessIssueRecord(String serialNo,String materialNo,String makeNo,List<ProcessIssueRecord> processIssueRecords); |
||||
|
|
||||
|
public int removeProcessIssueRecord(ProcessIssueRecord processIssueRecord); |
||||
|
|
||||
|
} |
@ -0,0 +1,154 @@ |
|||||
|
package com.ruoyi.system.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice; |
||||
|
import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper; |
||||
|
import com.ruoyi.common.exception.BusinessException; |
||||
|
import com.ruoyi.common.utils.DateUtils; |
||||
|
import com.ruoyi.common.utils.ShiroUtils; |
||||
|
import com.ruoyi.common.utils.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.ruoyi.system.mapper.ProcessIssueRecordMapper; |
||||
|
import com.ruoyi.system.domain.ProcessIssueRecord; |
||||
|
import com.ruoyi.system.service.IProcessIssueRecordService; |
||||
|
import com.ruoyi.common.core.text.Convert; |
||||
|
|
||||
|
/** |
||||
|
* 设备履历-问题清单列Service业务层处理 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-11-05 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ProcessIssueRecordServiceImpl implements IProcessIssueRecordService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private ProcessIssueRecordMapper processIssueRecordMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
private AfterSalesShippingDeviceMapper shippingDeviceMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询设备履历-问题清单列 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 设备履历-问题清单列 |
||||
|
*/ |
||||
|
@Override |
||||
|
public ProcessIssueRecord selectProcessIssueRecordById(Long id) |
||||
|
{ |
||||
|
return processIssueRecordMapper.selectProcessIssueRecordById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询设备履历-问题清单列列表 |
||||
|
* |
||||
|
* @param processIssueRecord 设备履历-问题清单列 |
||||
|
* @return 设备履历-问题清单列 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<ProcessIssueRecord> selectProcessIssueRecordList(ProcessIssueRecord processIssueRecord) |
||||
|
{ |
||||
|
return processIssueRecordMapper.selectProcessIssueRecordList(processIssueRecord); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增设备履历-问题清单列 |
||||
|
* |
||||
|
* @param processIssueRecord 设备履历-问题清单列 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertProcessIssueRecord(ProcessIssueRecord processIssueRecord) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
processIssueRecord.setCreateBy(loginName); |
||||
|
return processIssueRecordMapper.insertProcessIssueRecord(processIssueRecord); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改设备履历-问题清单列 |
||||
|
* |
||||
|
* @param processIssueRecord 设备履历-问题清单列 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateProcessIssueRecord(ProcessIssueRecord processIssueRecord) |
||||
|
{ |
||||
|
return processIssueRecordMapper.updateProcessIssueRecord(processIssueRecord); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除设备履历-问题清单列对象 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteProcessIssueRecordByIds(String ids) |
||||
|
{ |
||||
|
return processIssueRecordMapper.deleteProcessIssueRecordByIds(Convert.toStrArray(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除设备履历-问题清单列信息 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteProcessIssueRecordById(Long id) |
||||
|
{ |
||||
|
return processIssueRecordMapper.deleteProcessIssueRecordById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废设备履历-问题清单列 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int cancelProcessIssueRecordById(Long id) |
||||
|
{ |
||||
|
return processIssueRecordMapper.cancelProcessIssueRecordById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复设备履历-问题清单列信息 |
||||
|
* |
||||
|
* @param id 设备履历-问题清单列ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int restoreProcessIssueRecordById(Long id) |
||||
|
{ |
||||
|
return processIssueRecordMapper.restoreProcessIssueRecordById(id); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String importProcessIssueRecord(String serialNo,String materialNo,String makeNo,List<ProcessIssueRecord> processIssueRecords) { |
||||
|
if(StringUtils.isEmpty(processIssueRecords)){ |
||||
|
throw new BusinessException("工序问题记录为空!"); |
||||
|
} |
||||
|
for (int i=0;i<processIssueRecords.size();i++) { |
||||
|
ProcessIssueRecord processRecord = processIssueRecords.get(i); |
||||
|
processRecord.setSerialNo(serialNo); |
||||
|
processRecord.setMaterialNo(materialNo); |
||||
|
processRecord.setMakeNo(makeNo); |
||||
|
processRecord.setCreateTime(DateUtils.getNowDate()); |
||||
|
int result = processIssueRecordMapper.insertProcessIssueRecord(processRecord); |
||||
|
if(result<=0){ |
||||
|
throw new BusinessException("工序问题导入失败!第"+(i+1)+"条导入时出现错误"); |
||||
|
} |
||||
|
} |
||||
|
return "导入成功!"; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int removeProcessIssueRecord(ProcessIssueRecord processIssueRecord){ |
||||
|
return processIssueRecordMapper.removeProcessIssueRecord(processIssueRecord); |
||||
|
} |
||||
|
} |
@ -0,0 +1,131 @@ |
|||||
|
<?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.system.mapper.ProcessIssueRecordMapper"> |
||||
|
|
||||
|
<resultMap type="ProcessIssueRecord" id="ProcessIssueRecordResult"> |
||||
|
<result property="id" column="id" /> |
||||
|
<result property="shippingDeviceId" column="shipping_device_id" /> |
||||
|
<result property="serialNo" column="serial_no" /> |
||||
|
<result property="process" column="process" /> |
||||
|
<result property="abnormalTime" column="abnormal_time" /> |
||||
|
<result property="questionDescribe" column="question_describe" /> |
||||
|
<result property="solution" column="solution" /> |
||||
|
<result property="resolveTime" column="resolve_time" /> |
||||
|
<result property="createBy" column="create_by" /> |
||||
|
<result property="createTime" column="create_time" /> |
||||
|
<result property="approveBy" column="approve_by" /> |
||||
|
<result property="remark" column="remark" /> |
||||
|
<result property="materialNo" column="material_no" /> |
||||
|
<result property="makeNo" column="make_no" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectProcessIssueRecordVo"> |
||||
|
select id, shipping_device_id, serial_no, process, abnormal_time, question_describe, solution, resolve_time, create_by, approve_by, remark, material_no, make_no from process_issue_record |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectProcessIssueRecordList" parameterType="ProcessIssueRecord" resultMap="ProcessIssueRecordResult"> |
||||
|
<include refid="selectProcessIssueRecordVo"/> |
||||
|
<where> |
||||
|
<if test="shippingDeviceId != null and shippingDeviceId != ''"> and shipping_device_id = #{shippingDeviceId}</if> |
||||
|
<if test="serialNo != null and serialNo != ''"> and serial_no = #{serialNo}</if> |
||||
|
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if> |
||||
|
<if test="makeNo != null and makeNo != ''"> and make_no = #{makeNo}</if> |
||||
|
<if test="process != null and process != ''"> and process = #{process}</if> |
||||
|
<if test="abnormalTime != null "> and abnormal_time = #{abnormalTime}</if> |
||||
|
<if test="questionDescribe != null and questionDescribe != ''"> and question_describe = #{questionDescribe}</if> |
||||
|
<if test="solution != null and solution != ''"> and solution = #{solution}</if> |
||||
|
<if test="resolveTime != null "> and resolve_time = #{resolveTime}</if> |
||||
|
<if test="approveBy != null and approveBy != ''"> and approve_by = #{approveBy}</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectProcessIssueRecordById" parameterType="Long" resultMap="ProcessIssueRecordResult"> |
||||
|
<include refid="selectProcessIssueRecordVo"/> |
||||
|
where id = #{id} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertProcessIssueRecord" parameterType="ProcessIssueRecord" useGeneratedKeys="true" keyProperty="id"> |
||||
|
insert into process_issue_record |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="shippingDeviceId != null">shipping_device_id,</if> |
||||
|
<if test="serialNo != null and serialNo != ''">serial_no,</if> |
||||
|
<if test="process != null">process,</if> |
||||
|
<if test="abnormalTime != null">abnormal_time,</if> |
||||
|
<if test="questionDescribe != null">question_describe,</if> |
||||
|
<if test="solution != null">solution,</if> |
||||
|
<if test="resolveTime != null">resolve_time,</if> |
||||
|
<if test="createBy != null">create_by,</if> |
||||
|
<if test="createTime != null">create_time,</if> |
||||
|
<if test="approveBy != null">approve_by,</if> |
||||
|
<if test="remark != null">remark,</if> |
||||
|
<if test="materialNo != null">material_no,</if> |
||||
|
<if test="makeNo != null">make_no,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="shippingDeviceId != null">#{shippingDeviceId},</if> |
||||
|
<if test="serialNo != null and serialNo != ''">#{serialNo},</if> |
||||
|
<if test="process != null">#{process},</if> |
||||
|
<if test="abnormalTime != null">#{abnormalTime},</if> |
||||
|
<if test="questionDescribe != null">#{questionDescribe},</if> |
||||
|
<if test="solution != null">#{solution},</if> |
||||
|
<if test="resolveTime != null">#{resolveTime},</if> |
||||
|
<if test="createBy != null">#{createBy},</if> |
||||
|
<if test="createTime != null">#{createTime},</if> |
||||
|
<if test="approveBy != null">#{approveBy},</if> |
||||
|
<if test="remark != null">#{remark},</if> |
||||
|
<if test="materialNo != null">#{materialNo},</if> |
||||
|
<if test="makeNo != null">#{makeNo},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateProcessIssueRecord" parameterType="ProcessIssueRecord"> |
||||
|
update process_issue_record |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="shippingDeviceId != null">shipping_device_id = #{shippingDeviceId},</if> |
||||
|
<if test="serialNo != null and serialNo != ''">serial_no = #{serialNo},</if> |
||||
|
<if test="process != null">process = #{process},</if> |
||||
|
<if test="abnormalTime != null">abnormal_time = #{abnormalTime},</if> |
||||
|
<if test="questionDescribe != null">question_describe = #{questionDescribe},</if> |
||||
|
<if test="solution != null">solution = #{solution},</if> |
||||
|
<if test="resolveTime != null">resolve_time = #{resolveTime},</if> |
||||
|
<if test="createBy != null">create_by = #{createBy},</if> |
||||
|
<if test="createTime != null">create_time = #{createTime},</if> |
||||
|
<if test="approveBy != null">approve_by = #{approveBy},</if> |
||||
|
<if test="remark != null">remark = #{remark},</if> |
||||
|
<if test="materialNo != null">material_no = #{materialNo},</if> |
||||
|
<if test="makeNo != null">make_no = #{makeNo},</if> |
||||
|
</trim> |
||||
|
where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteProcessIssueRecordById" parameterType="Long"> |
||||
|
delete from process_issue_record where id = #{id} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteProcessIssueRecordByIds" parameterType="String"> |
||||
|
delete from process_issue_record where id in |
||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
<update id="cancelProcessIssueRecordById" parameterType="Long"> |
||||
|
update process_issue_record set del_flag = '1' where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<update id="restoreProcessIssueRecordById" parameterType="Long"> |
||||
|
update process_issue_record set del_flag = '0' where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="removeProcessIssueRecord" parameterType="ProcessIssueRecord"> |
||||
|
delete from process_issue_record |
||||
|
<where> |
||||
|
<if test="serialNo != null and serialNo != ''"> and serial_no = #{serialNo}</if> |
||||
|
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if> |
||||
|
<if test="makeNo != null and makeNo != ''"> and make_no = #{makeNo}</if> |
||||
|
</where> |
||||
|
</delete> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,217 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('采购审核')" /> |
||||
|
<th:block th:include="include :: datetimepicker-css" /> |
||||
|
<th:block th:include="include :: bootstrap-editable-css" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-makeorder-edit" th:object="${sysMakeOrder}"> |
||||
|
<input name="id" th:field="*{id}" type="hidden"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">生产订单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly id="makeNo" name="makeNo" th:field="*{makeNo}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">关联销售订单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly id="saleNo" name="saleNo" th:field="*{saleNo}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">业务员:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="Salesman" th:field="*{Salesman}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label is-required">订单类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select disabled name="orderType" class="form-control" type="text" th:with="dictList=${@dict.getType('sys_order_type')}" required th:field="*{orderType}"> |
||||
|
<option value="">请选择</option> |
||||
|
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-xs-11" style="margin-left: 50px;"> |
||||
|
<div class="form-group-sm"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-sub-table-1"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: datetimepicker-js" /> |
||||
|
<th:block th:include="include :: bootstrap-table-editable-js" /> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "system/makeorder"; |
||||
|
|
||||
|
// 字典 |
||||
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
||||
|
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
||||
|
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
||||
|
var levelDatas = [[${@dict.getType('bomLevel')}]]; |
||||
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
||||
|
var makeNo = [[${sysMakeOrder.makeNo}]]; |
||||
|
|
||||
|
$(function(){ |
||||
|
var options = { |
||||
|
url: ctx + "system/makeorderbom/cgLimitedList", |
||||
|
id: 'bootstrap-sub-table-1', |
||||
|
showSearch: false, |
||||
|
showRefresh: false, |
||||
|
showToggle: false, |
||||
|
showColumns: false, |
||||
|
uniqueId: "id", |
||||
|
pagination: false, // 设置不分页 |
||||
|
sidePagination: "client", |
||||
|
queryParams: queryParams, |
||||
|
columns: [ |
||||
|
{ |
||||
|
field: 'id', |
||||
|
title: '主键id', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'salesOrderCode', |
||||
|
title: '关联销售订单编号', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'makeNo', |
||||
|
title: '生产订单号', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'level', |
||||
|
title: '阶层', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(levelDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialNo', |
||||
|
align: 'center', |
||||
|
title: '料号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialName', |
||||
|
align: 'center', |
||||
|
title: '物料名称', |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialType', |
||||
|
align: 'center', |
||||
|
title: '物料类型', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectCategoryLabel(materialTypeDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'unit', |
||||
|
align: 'center', |
||||
|
title: '单位', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(sysUnitClassDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'brand', |
||||
|
align: 'center', |
||||
|
title: '品牌' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialModel', |
||||
|
align: 'center', |
||||
|
title: '型号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'describe', |
||||
|
align: 'center', |
||||
|
title: '描述' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'processMethod', |
||||
|
align: 'center', |
||||
|
title: '半成品类型', |
||||
|
formatter:function (value, row, index) { |
||||
|
return processMethodFormatter(value,row,index); |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'orderNum', |
||||
|
align: 'center', |
||||
|
title: '订单数量' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'useStatus', |
||||
|
align: 'center', |
||||
|
title: '使用状态', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'auditStatus', |
||||
|
align: 'center', |
||||
|
title: '审核状态', |
||||
|
visible: false |
||||
|
}, |
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}) |
||||
|
|
||||
|
// 定义 formatter 函数 |
||||
|
function processMethodFormatter(value, row, index) { |
||||
|
var filteredProcessMethodDatas = processMethodDatas.filter(function(item) { |
||||
|
return ['0', '4'].includes(item.dictValue); |
||||
|
}); |
||||
|
var options = ''; |
||||
|
for (var i = 0; i < filteredProcessMethodDatas.length; i++) { |
||||
|
var selected = value === filteredProcessMethodDatas[i].dictValue ? 'selected' : ''; |
||||
|
options += '<option value="' + filteredProcessMethodDatas[i].dictValue + '" ' + selected + '>' + filteredProcessMethodDatas[i].dictLabel + '</option>'; |
||||
|
} |
||||
|
return '<select class="form-control process-method-select">' + options + '</select>'; |
||||
|
} |
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
|
||||
|
}; |
||||
|
// 额外传参 |
||||
|
curParams.makeNo = $("#makeNo").val(); |
||||
|
curParams.processMethod = '4'; |
||||
|
return curParams; |
||||
|
} |
||||
|
|
||||
|
$("#form-makeorder-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
|
||||
|
var data = $('#bootstrap-sub-table-1').bootstrapTable('getData'); |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
var row = data[i]; |
||||
|
var selectedValue = $('.process-method-select').eq(i).val(); |
||||
|
row.processMethod = selectedValue; |
||||
|
} |
||||
|
var sysMakeOrder = { |
||||
|
id: $("input[name='id']").val(), |
||||
|
makeNo: $("#makeNo").val(), |
||||
|
saleNo: $("#saleNo").val(), |
||||
|
sysMakeorderBomList: data, |
||||
|
} |
||||
|
$.operate.saveJson(prefix + "/cgReview", JSON.stringify(sysMakeOrder)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,421 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('修改生产bom')" /> |
||||
|
<th:block th:include="include :: bootstrap-editable-css" /> |
||||
|
<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 m" id="form-bom-edit" th:object="${erpBom}"> |
||||
|
<input id="id" name="id" th:field="*{id}" type="text" hidden> |
||||
|
<input id="curIndex" name="curIndex" th:value="${curIndex}" type="text" hidden> |
||||
|
<input id="makeNo" name="makeNo" th:value="${makeNo}" type="text" hidden> |
||||
|
<input name="bomNo" th:field="*{bomNo}" type="text" hidden> |
||||
|
<div class="form-group"> |
||||
|
|
||||
|
<label class="col-sm-3 control-label is-required">料号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input type="text" class="form-control" id="materialNo" name="materialNo" th:field="*{materialNo}" readonly required/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label is-required">物料名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly required /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label is-required">物料类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="selectMaterialType" name="materialType" |
||||
|
class="form-control m-b select2-multiple" |
||||
|
th:with="childList=${@category.getChildByCode('materialType')}" required disabled> |
||||
|
<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)}" th:field="*{materialType}"></option> |
||||
|
</optgroup> |
||||
|
</select> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label is-required">半成品类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required disabled> |
||||
|
<option value=""></option> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label is-required">单位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled required> |
||||
|
<option value=""></option> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}" ></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">型号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="materialModel" th:field="*{materialModel}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">品牌:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="brand" th:field="*{brand}" class="form-control" type="text" readonly /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label is-required">描述:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="describe" class="form-control" readonly required>[[*{describe}]]</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
<div class="btn-group-sm" id="toolbar" role="group"> |
||||
|
<a class="btn btn-success" onclick="insertRow()"> |
||||
|
<i class="fa fa-plus"></i> 添加物料 |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="col-xs-11" style="margin-left: 50px;"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-sub-table-1"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: bootstrap-table-editable-js" /> |
||||
|
<th:block th:include="include :: select2-js" /> |
||||
|
<script th:src="@{/js/activiti.js}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "system/makeorderbom"; |
||||
|
var erpBom = [[${erpBom}]]; |
||||
|
var materialType1 = [[${erpBom.materialType}]]; |
||||
|
var materialNo = erpBom.materialNo; |
||||
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
||||
|
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
||||
|
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
||||
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
||||
|
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; |
||||
|
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]]; |
||||
|
$("#form-bom-edit").validate({ focusCleanup: true}); |
||||
|
function selMaterialTb(){ |
||||
|
var options = { |
||||
|
title: '物料选择', |
||||
|
url: ctx + "/erp/material/select", |
||||
|
callBack: doSubmit |
||||
|
}; |
||||
|
$.modal.openOptions(options); |
||||
|
} |
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
$("#selectEngineer").removeAttr("disabled"); |
||||
|
$("#selectMaterialType").removeAttr("disabled"); |
||||
|
$("#selectProcessMethod").removeAttr("disabled"); |
||||
|
$("#selectUnit").removeAttr("disabled"); |
||||
|
var formData = $("#form-bom-edit").serializeArray(); |
||||
|
var tableData = $("#bootstrap-sub-table-1").bootstrapTable('getData'); |
||||
|
var rows = tableData.length; |
||||
|
if(rows==0){ |
||||
|
$.modal.alertWarning("子表数据不能为空!"); |
||||
|
}else{ |
||||
|
for(var i=0;i<tableData.length;i++){ |
||||
|
if(tableData[i].useNum == null || tableData[i].useNum == ''){ |
||||
|
$.modal.alertWarning("子表数据用量不能为空!"); |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
formData.push({"name": "erpBomList", "value": tableData}); |
||||
|
var jsonData = $.common.formDataToJson(formData); |
||||
|
$.operate.saveJson(prefix + "/edit", jsonData); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
$(function() { |
||||
|
$("#selectMaterialType").val(materialType1); |
||||
|
var curIndex = $("#curIndex").val(); |
||||
|
var options = { |
||||
|
url: prefix + "/list", |
||||
|
id: 'bootstrap-sub-table-1', |
||||
|
showSearch: false, |
||||
|
showRefresh: false, |
||||
|
showToggle: false, |
||||
|
showColumns: false, |
||||
|
uniqueId: "id", |
||||
|
pagination: false, // 设置不分页 |
||||
|
sidePagination: "client", |
||||
|
queryParams: queryParams, |
||||
|
columns: [{ |
||||
|
checkbox: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'bomId', |
||||
|
title: 'bom主键id', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'parentId', |
||||
|
title: '父级id', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialNo', |
||||
|
align: 'center', |
||||
|
title: '料号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialName', |
||||
|
align: 'center', |
||||
|
title: '物料名称', |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialType', |
||||
|
align: 'center', |
||||
|
title: '物料类型', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectCategoryLabel(materialTypeDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'describe', |
||||
|
align: 'center', |
||||
|
title: '描述' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialModel', |
||||
|
align: 'center', |
||||
|
title: '型号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'brand', |
||||
|
align: 'center', |
||||
|
title: '品牌' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'unit', |
||||
|
align: 'center', |
||||
|
title: '单位', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(sysUnitClassDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'useNum', |
||||
|
align: 'center', |
||||
|
title: '用量', |
||||
|
editable : { |
||||
|
type : 'text', |
||||
|
title : '用量', |
||||
|
mode:'inline', |
||||
|
validate : function(value) { |
||||
|
if (!value) { |
||||
|
return '用量不能为空'; |
||||
|
} |
||||
|
if (isNaN(value)) { |
||||
|
return '用量必须为数字'; |
||||
|
} |
||||
|
if(value < 0){ |
||||
|
return "输入数值不能小于0"; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'lossRate', |
||||
|
align: 'center', |
||||
|
title: '损耗率(%)', |
||||
|
editable : { |
||||
|
editor: { |
||||
|
defaultValue: '%', |
||||
|
title : '损耗率(%)', |
||||
|
mode:'inline', |
||||
|
type: 'text', |
||||
|
// 编辑时同样附带百分比符号 |
||||
|
formatter: function(value) { |
||||
|
return value + '%'; |
||||
|
}, |
||||
|
// 编辑后去除百分比符号 |
||||
|
custom_getter: function(value) { |
||||
|
return value.replace('%', ''); |
||||
|
} |
||||
|
}, |
||||
|
validate : function(value) { |
||||
|
if (!value) { |
||||
|
return '损耗率不能为空'; |
||||
|
} |
||||
|
const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配 |
||||
|
const match = value.match(regex); // 使用match方法查找所有匹配 |
||||
|
if (!match) { |
||||
|
return '损耗率必须以百分比结尾'; |
||||
|
} |
||||
|
var num = value.replace('%', ''); |
||||
|
if (num < 0 || num > 100) { |
||||
|
return '损耗率必须大于等于0小于等于100'; |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
formatter: function (value,row,index){ |
||||
|
if (value == null || value == ''){ |
||||
|
return "%"; |
||||
|
} |
||||
|
const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配 |
||||
|
const match = value.match(regex); // 使用match方法查找所有匹配 |
||||
|
if (match) { |
||||
|
return value; |
||||
|
}else{ |
||||
|
return value + "%"; |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
field: 'processMethod', |
||||
|
align: 'center', |
||||
|
title: '加工方式', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(processMethodDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'warehouseDept', |
||||
|
align: 'center', |
||||
|
title: '入库部门',visible:false, |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectCategoryLabel(warehouseDeptDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'remark', |
||||
|
align: 'center', |
||||
|
title: '备注', |
||||
|
editable : { |
||||
|
type : 'text', |
||||
|
title : '备注', |
||||
|
mode:'inline', |
||||
|
validate : function(value) { |
||||
|
if (!value) { |
||||
|
return '备注'; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
formatter: function (value, row) { |
||||
|
// 检查 row 是否存在 |
||||
|
if (!row) { |
||||
|
return ""; |
||||
|
} |
||||
|
|
||||
|
// 检查 storageLocation 是否存在 |
||||
|
if (row.storageLocation === undefined || row.storageLocation === null) { |
||||
|
return ""; |
||||
|
} |
||||
|
|
||||
|
// 根据 storageLocation 的值决定返回值 |
||||
|
if (row.storageLocation) { |
||||
|
return row.storageLocation; |
||||
|
} else { |
||||
|
return value; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{title: '操作', align: 'center', |
||||
|
formatter: function (value, row, index) { |
||||
|
var actions = []; |
||||
|
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> '); |
||||
|
return actions.join(''); |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
// 当所有数据被加载时触发 |
||||
|
onLoadSuccess: function(data) { |
||||
|
var key = "one_level_child_table_"+curIndex; |
||||
|
var rowData = sessionStorage.getItem(key); |
||||
|
if(rowData){ |
||||
|
var tableData = JSON.parse(rowData); |
||||
|
$("#bootstrap-sub-table-1").bootstrapTable('load',tableData); |
||||
|
} |
||||
|
}, |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
function optFormatter(value, row, index) { |
||||
|
var actions = []; |
||||
|
actions.push('<a class="btn btn-search btn-xs optRow" href="javascript:void(0)"><i class="fa fa-search"></i>选择</a> '); |
||||
|
return actions.join(''); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
// pageSize: params.limit, |
||||
|
// pageNum: params.offset / params.limit + 1, |
||||
|
// searchValue: params.search, |
||||
|
// orderByColumn: params.sort, |
||||
|
// isAsc: params.order |
||||
|
}; |
||||
|
// 额外传参 |
||||
|
curParams.salesOrderMaterialNo = $("#materialNo").val(); |
||||
|
curParams.makeNo = $("#makeNo").val(); |
||||
|
curParams.level = 1; |
||||
|
return curParams; |
||||
|
} |
||||
|
function doSubmit(index, layero,uniqueId){ |
||||
|
var iframeWin = window[layero.find('iframe')[0]['name']]; |
||||
|
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; |
||||
|
var rows = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; |
||||
|
if($("#materialNo").val()==rowData.materialNo){ |
||||
|
$.modal.alertError("不能选择与主体bom相同的料号"); |
||||
|
return; |
||||
|
} |
||||
|
for(var i=0;i<rows;i++){ |
||||
|
var data = $("#bootstrap-sub-table-1").bootstrapTable('getData')[i]; |
||||
|
if(data.materialNo==rowData.materialNo){ |
||||
|
$.modal.alertError("不能选择已添加过的相同料号"); |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
var timestamp = new Date().getTime(); |
||||
|
var totalNum = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; |
||||
|
$("#bootstrap-sub-table-1").bootstrapTable('insertRow', { |
||||
|
index:totalNum, |
||||
|
replace:true, |
||||
|
row: { |
||||
|
bomId:rowData.subId, |
||||
|
materialNo: rowData.materialNo, |
||||
|
bomNo: rowData.bomNo, |
||||
|
level: "1", |
||||
|
materialName: rowData.materialName, |
||||
|
materialType: rowData.materialType, |
||||
|
describe: rowData.describe, |
||||
|
materialModel:rowData.materialModel, |
||||
|
brand: rowData.brand, |
||||
|
unit: rowData.unit, |
||||
|
processMethod: rowData.processMethod, |
||||
|
warehouseDept: rowData.warehouseDept, |
||||
|
} |
||||
|
}) |
||||
|
layer.close(index); |
||||
|
} |
||||
|
/* 新增表格行 */ |
||||
|
function insertRow(){ |
||||
|
// var uuidStr = uuid(); |
||||
|
var url = ctx + "erp/material/select"; |
||||
|
var options = { |
||||
|
title: '选择料号', |
||||
|
url: url, |
||||
|
callBack: doSubmit |
||||
|
}; |
||||
|
$.modal.openOptions(options); |
||||
|
} |
||||
|
|
||||
|
/* 删除指定表格行 */ |
||||
|
function removeRow(id){ |
||||
|
$("#bootstrap-sub-table-1").bootstrapTable('remove', { |
||||
|
field: 'id', |
||||
|
values: id |
||||
|
}) |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,67 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('工序问题记录列表')" /> |
||||
|
</head> |
||||
|
<body class="gray-bg"> |
||||
|
<div class="container-div"> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-select-table"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<script th:inline="javascript"> |
||||
|
$(function() { |
||||
|
var options = { |
||||
|
id: "bootstrap-select-table", |
||||
|
modalName: "工序问题记录", |
||||
|
pagination: false, |
||||
|
showSearch: false, |
||||
|
showRefresh: false, |
||||
|
showToggle: false, |
||||
|
showColumns: false, |
||||
|
data: [[${processIssueRecordList}]], |
||||
|
columns: [ |
||||
|
{ |
||||
|
field: 'process', |
||||
|
title: '工序', |
||||
|
}, |
||||
|
{ |
||||
|
field: 'abnormalTime', |
||||
|
title: '异常时间' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'questionDescribe', |
||||
|
title: '问题描述' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'solution', |
||||
|
title: '解决办法' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'resolveTime', |
||||
|
title: '解决时间' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'createBy', |
||||
|
title: '记录人' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'approveBy', |
||||
|
title: '审核人' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'remark', |
||||
|
title: '备注' |
||||
|
}, |
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}); |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue