Browse Source

[feat]工程管理:修该BOM信息列表物料显示异常,工程员默认显示为本人,用量设置为必填项,损耗率默认显示%,BOM下的一阶BOM物料需限制一个物料只能添加一次,不能多次添加,不能以原料阶层做BOM物料主体。

dev
zhangsiqi 9 months ago
parent
commit
563ea85abd
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java
  2. 36
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java
  3. 11
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  5. 199
      ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml
  6. 90
      ruoyi-admin/src/main/resources/templates/erp/bom/add.html
  7. 45
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
  8. 33
      ruoyi-admin/src/main/resources/templates/erp/bom/detail.html
  9. 45
      ruoyi-admin/src/main/resources/templates/erp/bom/edit.html
  10. 249
      ruoyi-admin/src/main/resources/templates/erp/bom/taskGcjlVerify.html
  11. 10
      ruoyi-admin/src/main/resources/templates/erp/bom/taskGczgVerify.html
  12. 28
      ruoyi-admin/src/main/resources/templates/erp/bom/taskModifyApply.html
  13. 16
      ruoyi-admin/src/main/resources/templates/erp/bom/taskYfzjVerify.html

4
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java

@ -78,7 +78,7 @@ public class ErpBomController extends BaseController
@RequiresPermissions("erp:bom:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ErpBomVo erpBomVo)
public TableDataInfo list(ErpBomVo erpBomVo,HttpServletRequest request)
{
SysUser curUser = ShiroUtils.getSysUser();
Long userId = curUser.getUserId();
@ -87,6 +87,8 @@ public class ErpBomController extends BaseController
startPage();
List<ErpBomVo> list = erpBomService.selectErpBomList(erpBomVo);
return getDataTable(list);
}
/**

36
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java

@ -56,14 +56,12 @@ public class ErpBom extends BaseEntity
@Excel(name = "描述",sort = 4)
private String describe;
private String warehouseDept;
/** 用量 */
@Excel(name = "用量",sort = 8)
private Long useNum;
/** 损耗率 */
private BigDecimal lossRate;
private String lossRate;
/** 父级id */
private Long parentId;
@ -75,6 +73,9 @@ public class ErpBom extends BaseEntity
/** 排序 */
private Long sortNo;
@Excel(name = "工程员",sort = 9)
private String engineer;
/** 审核状态 */
private String auditStatus;
@ -114,6 +115,9 @@ public class ErpBom extends BaseEntity
/** bom信息 */
private List<ErpBom> erpBomList;
public void setId(Long id)
{
this.id = id;
@ -196,14 +200,6 @@ public class ErpBom extends BaseEntity
return unit;
}
public String getWarehouseDept() {
return warehouseDept;
}
public void setWarehouseDept(String warehouseDept) {
this.warehouseDept = warehouseDept;
}
public void setBrand(String brand)
{
this.brand = brand;
@ -227,21 +223,30 @@ public class ErpBom extends BaseEntity
this.useNum = useNum;
}
public Long getUseNum()
public String getEngineer() {
return engineer;
}
public void setEngineer(String engineer) {
this.engineer = engineer;
}
public Long getUseNum()
{
return useNum;
}
public void setLossRate(BigDecimal lossRate)
public void setLossRate(String lossRate)
{
this.lossRate = lossRate;
}
public BigDecimal getLossRate()
public String getLossRate()
{
return lossRate;
}
public void setParentId(Long parentId)
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
@ -398,6 +403,7 @@ public class ErpBom extends BaseEntity
", unit='" + unit + '\'' +
", brand='" + brand + '\'' +
", describe='" + describe + '\'' +
", engineer='" + engineer + '\'' +
", useNum=" + useNum +
", lossRate=" + lossRate +
", parentId=" + parentId +

11
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java

@ -31,8 +31,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.*;
import java.util.regex.Pattern;
/**
* bomService业务层处理
@ -190,6 +192,9 @@ private ISysAttachService attachService;
if(CollectionUtils.isNotEmpty(subLevelList)){
for (ErpBom sub: subLevelList) {
Long level1 = level+1;
if(level1 >= 8){
break;
}
sub.setLevel(level1);
resultList.add(sub);
String materialNo1 = sub.getMaterialNo();
@ -406,7 +411,7 @@ private ISysAttachService attachService;
ErpBomImportVo bomImportVo = bomImportVos.get(i);
String materialNo = bomImportVo.getMaterialNo();
Long useNum = bomImportVo.getUseNum();
BigDecimal lossRate = bomImportVo.getLossRate();
Double lossRate = bomImportVo.getLossRate();
String remark = bomImportVo.getRemark();
ErpMaterialVo erpMaterialVo = materialMapper.selectErpMaterialByMaterialNo(materialNo);
try
@ -467,7 +472,7 @@ private ISysAttachService attachService;
subBom.setBrand(erpMaterialVo.getBrand());
subBom.setDescribe(erpMaterialVo.getDescribe());
subBom.setUseNum(useNum);
subBom.setLossRate(lossRate);
subBom.setLossRate(String.valueOf(lossRate));
subBom.setParentId(parentId);
subBom.setLevel(1L);
subBom.setSortNo(i+0L);
@ -644,7 +649,7 @@ private ISysAttachService attachService;
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("yfzjRole")){
if(roleKeys.contains("yfzjRole") || roleKeys.contains("admin")){
variables.put("authority",4);
}else if(roleKeys.contains("gczgRole")){
variables.put("authority",3);

2
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -396,7 +396,7 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("yfzjRole")){
if(roleKeys.contains("yfzjRole") || roleKeys.contains("admin")){
variables.put("authority",4);
}else if(roleKeys.contains("gczgRole")){
variables.put("authority",3);

199
ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml

@ -4,37 +4,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.erp.mapper.ErpBomMapper">
<resultMap type="ErpBomVo" id="ErpBomResult">
<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="bomNo" column="bom_no" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="materialType" column="material_type" />
<result property="processMethod" column="process_method" />
<result property="unit" column="unit" />
<result property="brand" column="brand" />
<result property="describe" column="describe" />
<result property="useNum" column="use_num" />
<result property="lossRate" column="loss_rate" />
<result property="parentId" column="parent_id" />
<result property="level" column="level" />
<result property="sortNo" column="sort_no" />
<result property="auditStatus" column="audit_status" />
<result property="useStatus" column="use_status" />
<result property="instanceId" column="instance_id" />
<result property="instanceType" column="instance_type" />
<result property="instanceTypeName" column="instance_type_name" />
<result property="submitInstanceId" column="submit_instance_id" />
<result property="cancelInstanceId" column="cancel_instance_id" />
<result property="restoreInstanceId" column="restore_instance_id" />
<result property="applyTitle" column="apply_title" />
<result property="applyUser" column="apply_user" />
<result property="applyTime" column="apply_time" />
<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="bomNo" column="bom_no" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="materialType" column="material_type" />
<result property="processMethod" column="process_method" />
<result property="engineer" column="engineer" />
<result property="unit" column="unit" />
<result property="brand" column="brand" />
<result property="describe" column="describe" />
<result property="useNum" column="use_num" />
<result property="lossRate" column="loss_rate" />
<result property="parentId" column="parent_id" />
<result property="level" column="level" />
<result property="sortNo" column="sort_no" />
<result property="auditStatus" column="audit_status" />
<result property="useStatus" column="use_status" />
<result property="instanceId" column="instance_id" />
<result property="instanceType" column="instance_type" />
<result property="instanceTypeName" column="instance_type_name" />
<result property="submitInstanceId" column="submit_instance_id" />
<result property="cancelInstanceId" column="cancel_instance_id" />
<result property="restoreInstanceId" column="restore_instance_id" />
<result property="applyTitle" column="apply_title" />
<result property="applyUser" column="apply_user" />
<result property="applyTime" column="apply_time" />
</resultMap>
<resultMap id="ErpBomErpBomSubResult" type="ErpBom" extends="ErpBomResult">
@ -42,47 +43,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<resultMap type="ErpBom" id="ErpBomSubResult">
<result property="id" column="sub_id" />
<result property="delFlag" column="sub_del_flag" />
<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" />
<result property="remark" column="sub_remark" />
<result property="bomNo" column="sub_bom_no" />
<result property="materialNo" column="sub_material_no" />
<result property="materialName" column="sub_material_name" />
<result property="materialType" column="sub_material_type" />
<result property="id" column="sub_id" />
<result property="delFlag" column="sub_del_flag" />
<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" />
<result property="remark" column="sub_remark" />
<result property="bomNo" column="sub_bom_no" />
<result property="materialNo" column="sub_material_no" />
<result property="materialName" column="sub_material_name" />
<result property="materialType" column="sub_material_type" />
<result property="processMethod" column="sub_process_method" />
<result property="unit" column="sub_unit" />
<result property="brand" column="sub_brand" />
<result property="describe" column="sub_describe" />
<result property="useNum" column="sub_use_num" />
<result property="lossRate" column="sub_loss_rate" />
<result property="parentId" column="sub_parent_id" />
<result property="level" column="sub_level" />
<result property="sortNo" column="sub_sort_no" />
<result property="auditStatus" column="sub_audit_status" />
<result property="useStatus" column="sub_use_status" />
<result property="engineer" column="engineer" />
<result property="unit" column="sub_unit" />
<result property="brand" column="sub_brand" />
<result property="describe" column="sub_describe" />
<result property="useNum" column="sub_use_num" />
<result property="lossRate" column="sub_loss_rate" />
<result property="parentId" column="sub_parent_id" />
<result property="level" column="sub_level" />
<result property="sortNo" column="sub_sort_no" />
<result property="auditStatus" column="sub_audit_status" />
<result property="useStatus" column="sub_use_status" />
</resultMap>
<sql id="selectErpBomVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark, bom_no,
material_no, material_name, material_type, process_method, unit, brand, `describe`,
use_num, loss_rate, parent_id, `level`, sort_no, audit_status, use_status,instance_id,
instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,apply_title,
apply_user,apply_time from erp_bom
engineer,use_num, loss_rate, parent_id, `level`, sort_no, audit_status, use_status,
instance_id,instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,
apply_title,apply_user,apply_time from erp_bom
</sql>
<select id="selectErpBomList" parameterType="ErpBomVo" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time
, erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status
, erp.material_type, erp.process_method,erp.unit, erp.brand, erp.`describe`,erp.use_num
, erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id,erp.instance_type
, processDict.dict_label as instance_type_name, erp.submit_instance_id,erp.cancel_instance_id
, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time
, file.url as photo_url,cate.name as material_type_name
from erp_bom as erp
, erp.material_type, erp.process_method,erp.unit, erp.brand, erp.`describe`,erp.engineer,
erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id,
erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id,
erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time
, file.url as photo_url,cate.name as material_type_name from erp_bom as erp
left join (
select id,material_no,material_name from erp_material
) erp_material
@ -121,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null and unit != ''"> and erp.unit = #{unit}</if>
<if test="brand != null and brand != ''"> and erp.brand = #{brand}</if>
<if test="describe != null and describe != ''"> and erp.`describe` = #{describe}</if>
<if test="engineer != null and engineer != ''"> and erp.engineer = #{engineer}</if>
<if test="useNum != null "> and erp.use_num = #{useNum}</if>
<if test="lossRate != null "> and erp.loss_rate = #{lossRate}</if>
<if test="parentId != null "> and erp.parent_id = #{parentId}</if>
@ -142,16 +144,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectErpBomList1" resultMap="ErpBomResult">
select bom_no, id, create_by, create_time, update_by, update_time, remark,
material_no, material_name, material_type, process_method, unit,
brand, `describe`, use_num, loss_rate, parent_id, `level`,
brand, `describe`,engineer,use_num, loss_rate, parent_id, `level`,
sort_no, audit_status, use_status from erp_bom
where bom_no != "" ORDER BY id DESC;
</select>
<select id="selectErpBomById" parameterType="Long" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, erp.remark,erp.bom_no, erp.material_no
, erp.material_name, erp.audit_status, erp.use_status, erp.material_type
, erp.process_method, erp.unit, erp.brand, erp.describe, erp.use_num, erp.loss_rate, erp.parent_id, erp.level, erp.sort_no
,erp.instance_id,erp.instance_type,erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time
,att.id as photo_attach_id
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time,
erp.remark,erp.bom_no, erp.material_no , erp.material_name, erp.audit_status, erp.use_status,
erp.material_type, erp.process_method, erp.unit, erp.brand, erp.describe, erp.use_num, erp.engineer,
erp.loss_rate, erp.parent_id, erp.level, erp.sort_no,erp.instance_id,erp.instance_type,
erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,
erp.apply_user,erp.apply_time,
att.id as photo_attach_id
from erp_bom erp
left join (
select id,material_no,material_name from erp_material
@ -180,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="brand != null and brand != ''"> and brand = #{brand}</if>
<if test="describe != null and describe != ''"> and `describe` = #{describe}</if>
<if test="engineer != null and engineer != ''"> and engineer = #{engineer}</if>
<if test="useNum != null "> and use_num = #{useNum}</if>
<if test="lossRate != null "> and loss_rate = #{lossRate}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
@ -195,7 +200,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into erp_bom
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="bomNo != null and bomNo != '' ">bom_no,</if>
<if test="materialNo != null and materialNo != '' ">material_no,</if>
@ -205,6 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null and unit != '' ">unit,</if>
<if test="brand != null and brand != '' ">brand,</if>
<if test="describe != null and describe != '' ">`describe`,</if>
<if test="engineer != null and engineer != '' ">engineer,</if>
<if test="useNum != null">use_num,</if>
<if test="lossRate != null">loss_rate,</if>
<if test="parentId != null">parent_id,</if>
@ -220,13 +225,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null and applyTitle != '' ">apply_title,</if>
<if test="applyUser != null">apply_user,</if>
<if test="applyTime != null">apply_time,</if>
del_flag,
create_time,
update_time,
<if test="delFlag != null">del_flag,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="remark != null and remark != '' ">#{remark},</if>
<if test="bomNo != null and bomNo != '' ">#{bomNo},</if>
<if test="materialNo != null and materialNo != '' ">#{materialNo},</if>
@ -251,9 +254,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null and applyTitle != '' ">#{applyTitle},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="applyTime != null">#{applyTime},</if>
0,
now(),
now(),
<if test="delFlag != null">#{delFlag},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
@ -261,9 +263,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update erp_bom
<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="remark != null and remark != '' ">remark = #{remark},</if>
<if test="bomNo != null and bomNo != '' ">bom_no = #{bomNo},</if>
<if test="materialNo != null and materialNo != '' ">material_no = #{materialNo},</if>
@ -288,7 +287,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null and applyTitle != '' ">apply_title = #{applyTitle},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
update_time = now()
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
@ -360,15 +360,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and material_no = #{materialNo}
</select>
<select id="selectErpBomByMaterialNo" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, erp.remark,erp.bomNo, erp.material_no
,erp.material_name, erp.audit_status, erp.use_status, erp.material_type
,erp.process_method, erp.unit, erp.brand, erp.describe, erp.use_num, erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.audit_status, erp.use_status
,erp.instance_id,erp.instance_type,erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time
,att.id as photo_attach_id
from erp_material erp
left join sys_attach att
on erp.id = att.rel_id and att.source_type = 'erpMaterial' and att.source_sub_type = 'photo'
<select id="selectErpBomByMaterialNo" parameterType="String" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time,
erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status,
erp.material_type, erp.process_method,erp.unit, erp.brand, erp.`describe`,erp.engineer,
erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id,
erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id,
erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time,
file.url as photo_url,cate.name as material_type_name from erp_bom as erp
left join (
select id,material_no,material_name from erp_material
) erp_material
on erp.material_no = erp_material.material_no
left join(
select dict_value,dict_label from sys_dict_data
where dict_type = 'processType'
) processDict
on erp.instance_type = processDict.dict_value
left join (
select code,name from sys_category
where parent_id in(
select id from sys_category
where parent_id = (select id from sys_category where code = 'materialType') )
) cate
on erp.material_type = cate.code
left join (
select att.rel_id,file.url,min(file.create_time) as create_time from sys_attach as att
left join sys_attach_file as file
on att.id = file.attach_id
where att.source_type = 'erpMaterial' and att.source_sub_type = 'photo'
group by att.rel_id
) file
on erp_material.id = file.rel_id
where erp.material_no = #{materialNo}
</select>
</mapper>

90
ruoyi-admin/src/main/resources/templates/erp/bom/add.html

@ -72,7 +72,7 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<input name="businessMembers" class="form-control " required disabled/>
<input name="engineer" class="form-control " required disabled/>
</div>
</div>
</form>
@ -100,7 +100,7 @@
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
$("#form-bom-add").validate({
onkeyup: false,
rules:{
@ -119,12 +119,26 @@
return $.validate.unique(data);
}
}
},
materialType:function (){
//物料类型不能是原料
var materialType = $("#selectMaterialType").text();
if(materialType.contains('yl') || materialType.contains('fl') ){
return false;
}else{
return true;
}
}
},
messages: {
"materialNo": {
remote: "料号已经存在",
},
"materialType": {
remote: "Bom物料类型不能是原料",
}
},
focusCleanup: true
});
@ -266,6 +280,7 @@
title: '用量',
editable : {
type : 'text',
//默认text
title : '用量',
mode:'inline',
validate : function(value) {
@ -279,29 +294,46 @@
return "输入数值不能小于0";
}
}
}
},
},
{
field: 'lossRate',
align: 'center',
title: '损耗率(%)',
editable : {
type : 'text',
title : '损耗率(%)',
mode:'inline',
validate : function(value) {
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 '损耗率不能为空';
}
if (isNaN(value)) {
return '损耗率必须为数字';
}else if(value >100){
} else if (value > 100) {
return "输入数值不能大100"
}else if(value < 0){
} else if (value < 0) {
return "输入数值不能小于0";
}
}
}
},
formatter: function (value,row,index){
if(value == null){
return "%";
}
return value + "%";
},
},
{
field: 'processMethod',
@ -328,27 +360,29 @@
}]
};
$.table.init(options);
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
$("form-bom-add input[name='businessMembers']").val(userName);
// $.ajax({
// url: ctx + 'erp/material/getEngineerList',
// type: 'get',
// success: function (res) {
// if (res.rows.length > 0) {
// var usertData = res.rows;
// for (let i in usertData) {
// $("#form-bom-add select[name='engineer']").append(
// "<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
// }
// } else {
// $.modal.msgError(res.msg);
// }
// }
// });
$("form-bom-add input[name='engineer']").val(loginName);
$("form-bom-add input[name='engineer']").text(userName);
});
function materilalSelect(data) {
var materialType1 = data.materialType.indexOf('yl');
if(materialType1 != -1){
$.modal.msgError("原料不能作为BOM主体");
var materialType2 = data.materialType.indexOf('fl');
if(materialType1 != -1 && materialType2 != -1){
$.modal.msgError("原料、辅料不能作为BOM主体");
$("#materialNo").val('');
$("input[materialName]").val('');
return;

45
ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

@ -50,7 +50,7 @@
<li>
<label>工程员:</label>
<select id="businessMembers" name="businessMembers" >
<select id="engineer" name="engineer" >
<option value="">所有</option>
</select>
</li>
@ -106,7 +106,7 @@
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var currentUser = [[${currentUser}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];;
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var prefix = ctx + "erp/bom";
$(function() {
$.ajax({
@ -116,8 +116,8 @@
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
$("select[name='engineer']").append(
"<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
@ -154,7 +154,7 @@
initOneLevelTable(index,row,$detail);
// 多阶
initAllLevelTable(index,row,$detail);
$.table.bootstrapTable('resetView');
// $.table.bootstrapTable('resetView');
},
columns: [{
checkbox: true
@ -217,7 +217,7 @@
return $.table.selectDictLabel(useStatusDatas, value);
}
},
{title: '工程员',field: 'businessMembers', sortable: true,},
{title: '工程员',field: 'engineer', sortable: true,},
{title: 'bom号',field: 'bomNo', sortable: true,},
{title: '关联料号',field: 'materialNo', sortable: true,},
{
@ -303,7 +303,7 @@
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){
if(todoUserIdList.includes(loginName) || todoUserIdList.includes("admin")){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+row.instanceTypeName+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
@ -348,7 +348,7 @@
if (value == null || value == ''){
return '/';
}else{
return value
return value;
}
}
},
@ -366,7 +366,7 @@
if (value == null || value == ''){
return '/';
}else{
return value
return value;
}
}
},
@ -377,7 +377,7 @@
if (value == null || value == ''){
return '/';
}else{
return value
return value;
}
}
},
@ -395,7 +395,7 @@
if (value == null || value == ''){
return '/';
}else{
return value
return value;
}
}
},
@ -407,7 +407,7 @@
if (value == null || value == ''){
return '/';
}else{
return value
return value;
}
}
},
@ -418,7 +418,7 @@
if (value == null || value == ''){
return '/';
}else{
return value
return value;
}
}
},
@ -429,7 +429,7 @@
if (value == null || value == ''){
return '/';
}else{
return value
return value;
}
}
},
@ -438,10 +438,9 @@
title: '损耗率',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
return "%";
}
return value + "%";
}
},
{
@ -580,10 +579,9 @@
title: '损耗率',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value + "%";
return "/";
}
return value + "%";
}
},
{
@ -736,12 +734,7 @@
field: 'lossRate',
title: '损耗率(%)',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value;
}
return value + '%';
}
},
{

33
ruoyi-admin/src/main/resources/templates/erp/bom/detail.html

@ -7,7 +7,7 @@
</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}">
<form class="form-horizontal m" id="form-bom-detail" th:object="${erpBom}">
<input id="id" name="id" th:field="*{id}" type="text" hidden>
<input name="bomNo" th:field="*{bomNo}" type="text" hidden>
<div class="form-group">
@ -67,7 +67,7 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" disabled required/>
<input name="engineer" th:field="*{engineer}" class="form-control" disabled required/>
</div>
</div>
</form>
@ -90,16 +90,16 @@
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "erp/bom";
var materilaType1 = [[${erpBom.materialType}]];
var materilaType1 = [[${erpBom.materialType}]] + ;
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$("#form-bom-edit").validate({focusCleanup: true});
$("#form-bom-detail").validate({focusCleanup: true});
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
function submitHandler() {
if ($.validate.form()) {
var formData = $("#form-bom-edit").serializeArray();
var formData = $("#form-bom-detail").serializeArray();
console.log("formData",formData);
var tableData = $("#bootstrap-sub-table-1").bootstrapTable('getData');
console.log("tableData",JSON.stringify(tableData))
@ -124,9 +124,10 @@
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
$("#from-bom-detail select[name='engineer']").append(
"<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
}
$("select[name='engineer']").val(loginName).trigger("change");
} else {
$.modal.msgError(res.msg);
}
@ -226,18 +227,12 @@
field: 'lossRate',
align: 'center',
title: '损耗率(%)',
editable : {
type : 'text',
title : '损耗率(%)',
validate : function(value) {
if (!value) {
return '损耗率不能为空';
}
if (isNaN(value)) {
return '损耗率必须为数字';
}
formatter: function (value,row,index){
if(value == null || value == ''){
return "%";
}
}
return value + "%";
},
},
{
field: 'processMethod',

45
ruoyi-admin/src/main/resources/templates/erp/bom/edit.html

@ -68,7 +68,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control">
<select name="engineer" class="form-control">
</select>
</div>
</div>
@ -149,10 +149,10 @@
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-bom-edit select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
$("#form-bom-edit select[name='engineer']").append(
"<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
}
$("#form-bom-edit select[name='businessMembers']").val(erpBom.createBy);
$("#form-bom-edit select[name='engineer']").val(erpBom.engineer);
} else {
$.modal.msgError(res.msg);
}
@ -254,21 +254,41 @@
align: 'center',
title: '损耗率(%)',
editable : {
type : 'text',
title : '损耗率(%)',
mode:'inline',
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 '损耗率不能为空';
}
if (isNaN(value)) {
return '损耗率必须为数字';
}
if (value < 0 || value > 100) {
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 "%";
}
}
return value + "%";
},
},
{
field: 'processMethod',
@ -377,7 +397,6 @@
values: ids
})
}
</script>
</body>
</html>

249
ruoyi-admin/src/main/resources/templates/erp/bom/taskGcjlVerify.html

@ -90,11 +90,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control">
<option value="">请选择</option>
</select>
<input name="engineer" th:field="*{engineer}" class="form-control" disabled required/>
</div>
</div>
<div class="form-group">
@ -128,16 +126,22 @@
</select>
</div>
</div>
<div class="form-group">
<div class="row">
<label class="col-sm-3 control-label">批注:</label>
<div class="col-sm-8">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<div class="row">
<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" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
@ -246,242 +250,9 @@
},
}
});
var erpBom = [[${formData}]];
$(function() {
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
})
var prefix = ctx + "erp/bom";
$("#form-edit").validate({
focusCleanup: true
});
$(function() {
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("select[name='businessMembers']").val(erpBom.businessMembers);
} else {
$.modal.msgError(res.msg);
}
}
});
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
detailUrl: prefix + "/detail/{id}",
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
importUrl: prefix + "/importData",
importTemplateUrl: prefix + "/importTemplate",
pageList: [5, 10, 25, 50],
pageSize: 10,
sortable: true, // 是否启用排序
sortStable: true, // 设置为 true 将获得稳定的排序
modalName: "bom",
detailView: true,
fixedColumns: true, // 启用冻结列
rightFixedColumns:1,
fixedRightNumber: 1, // 冻结右列个数
height: $(window).height() - 100,
//指定父id列
onExpandRow : function(index, row, $detail) {
$detail.html('<h4>一阶</h4><table class="table-container" id="one_level_table_'+row.id+'"></table>' +
'<h4>多阶</h4><table class="table-container" id="all_level_table_'+row.id+'"></table>'
).find('table');
// 一阶
initOneLevelTable(index,row,$detail);
// 多阶
initAllLevelTable(index,row,$detail);
$.table.bootstrapTable('resetView');
},
columns: [{
checkbox: true
},
{title: '主键ID',field: 'id'},
{ title: '流程实例ID',field: 'instanceId',visible: false},
{ title: '流程提交实例ID',field: 'submitInstanceId',visible: false},
{title: '流程作废实例ID', field: 'cancelInstanceId',visible: false},
{ title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false},
{ title: '流程实例类型',field: 'instanceTypeName', visible: false},
{
field: 'applyUser',
title: '申请人ID',
visible: false
},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
formatter: function(value, row, index) {
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{
field: 'applyTime',
title: '申请时间',
sortable: true,
},
{
field: 'taskId',
title: '当前任务ID',
visible: false,
$("#form-edit").validate({focusCleanup: true});
},
{
field: 'todoUserId',
title: '待办用户ID',
visible: false,
},
{
field: 'taskName',
title: '当前任务名称',
align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{
field: 'auditStatus',
title: '审核状态',
sortable: true,
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
},
{
field: 'useStatus',
title: '使用状态',
sortable: true,
formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}
},
{title: '工程员',field: 'businessMembers', sortable: true,},
{title: 'bom号',field: 'bomNo', sortable: true,},
{title: '关联料号',field: 'materialNo', sortable: true,},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{ title: '物料名称',field: 'materialName', sortable: true,},
{
field: 'materialType',
title: '物料类型',
sortable: true,
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'processMethod',
title: '半成品类型',
sortable: true,
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'unit',
title: '单位',
sortable: true,
},
{ title: '品牌',field: 'brand', sortable: true,},
{title: '描述',field: 'describe', sortable: true,},
{title: '用量',field: 'useNum', sortable: true,},
{title: '损耗率',field: 'lossRate', sortable: true,
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value + "%";
}
}
},
{
field: 'parentId',
title: '父级id',
visible:false
},
{
field: 'level',
title: '层级',
visible:false,
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'sortNo',
title: '排序',
visible: false
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
// 审核状态-审核通过 使用状态-是 未发起作废流程
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId){
// 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
}else{
actions.push('<a class="btn btn-default btn-xs" disabled href="javascript:void(0)"><i class="fa fa-edit"></i> 编辑</a> ');
}
// 已作废
if(row.useStatus=="2" && !row.restoreInstanceId){
// 恢复
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
}
// 有流程实例id
if (row.instanceId) {
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+row.instanceTypeName+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
// 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-eye"></i> 详情</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
function submitHandler() {
if ($.validate.form()) {
var materialType = $('#selectMaterialType').select2('val');

10
ruoyi-admin/src/main/resources/templates/erp/bom/taskGczgVerify.html

@ -100,7 +100,7 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" disabled required/>
<input name="engineer" th:field="*{engineer}" class="form-control" disabled required/>
</div>
</div>
<div class="form-group">
@ -134,16 +134,22 @@
</select>
</div>
</div>
<div class="form-group">
<div class="row">
<label class="col-sm-3 control-label">批注:</label>
<div class="col-sm-8">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<div class="row">
<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" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>

28
ruoyi-admin/src/main/resources/templates/erp/bom/taskModifyApply.html

@ -93,7 +93,7 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" disabled required/>
<input name="engineer" th:field="*{engineer}" class="form-control" disabled required/>
</div>
</div>
<div class="form-group">
@ -116,7 +116,7 @@
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden >
</div>
<hr />
<div class="form-group">
<div class="row">
<label class="col-sm-3 control-label" for="reApply">是否继续申请:</label>
<div class="col-sm-8">
<select id="reApply" name="p_B_reApply" class="form-control m-b">
@ -125,6 +125,11 @@
</select>
</div>
</div>
<div class="row">
<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" />
@ -237,7 +242,6 @@
},
}
})
var erpBom = [[${formData.erpBom}]];
var prefix = ctx + "erp/bom";
$("#form-edit").validate({
onkeyup: false,
@ -257,24 +261,6 @@
},
focusCleanup: true
});
$(function() {
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("select[name='businessMembers']").val(erpBom.businessMembers);
} else {
$.modal.msgError(res.msg);
}
}
});
})
function submitHandler() {
if ($.validate.form()) {
var materialType = $('#selectMaterialType').select2('val');

16
ruoyi-admin/src/main/resources/templates/erp/bom/taskYfzjVerify.html

@ -89,7 +89,7 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" disabled/>
<input name="engineer" th:field="*{engineer}" class="form-control" disabled/>
</div>
</div>
<div class="form-group">
@ -123,12 +123,18 @@
</select>
</div>
</div>
<div class="form-group">
<div class="row">
<label class="col-sm-3 control-label">批注:</label>
<div class="col-sm-8">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<br/>
<div class="row">
<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" />
@ -136,9 +142,7 @@
<script th:src="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script type="text/javascript">
var formData = [[${formData}]];
console.log(formData);
<script type="text/javascript">;
new Vue({
el: '#app',
data: function() {
@ -248,7 +252,7 @@
function submitHandler() {
if ($.validate.form()) {
var materialType = $('#selectMaterialType').select2('val');
$('#materialType').val(materialType);
$('#materialType').val(formData.materialType);
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}

Loading…
Cancel
Save