Browse Source

[update]:生产管理-成品SOP

dev
youjianchi 7 months ago
parent
commit
18ac6352ca
  1. 80
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSop.java
  2. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSopMapper.java
  3. 21
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSopServiceImpl.java
  4. 65
      ruoyi-admin/src/main/resources/mapper/system/SysSopMapper.xml
  5. 24
      ruoyi-admin/src/main/resources/templates/system/sop/add.html
  6. 32
      ruoyi-admin/src/main/resources/templates/system/sop/edit.html
  7. 372
      ruoyi-admin/src/main/resources/templates/system/sop/sop.html

80
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSop.java

@ -15,8 +15,23 @@ public class SysSop extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 删除标志(0代表存在 1代表删除) */
private String delFlag;
/** sopid */ /** sopid */
private Long sopId; private String sopId;
/** sop编号 */
private String sopNum;
/** 品名 */
private String productName;
/** 设备型号 */
private String equipModel;
/** 描述 */
private String describe;
/** 成品代码 */ /** 成品代码 */
@Excel(name = "成品代码") @Excel(name = "成品代码")
@ -101,16 +116,65 @@ public class SysSop extends BaseEntity
@Excel(name = "修改时间") @Excel(name = "修改时间")
private String updateInfoTime; private String updateInfoTime;
public void setSopId(Long sopId) public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public void setSopId(String sopId)
{ {
this.sopId = sopId; this.sopId = sopId;
} }
public Long getSopId() public String getSopId()
{ {
return sopId; return sopId;
} }
public void setSopCode(String sopCode)
public String getSopNum() {
return sopNum;
}
public void setSopNum(String sopNum) {
this.sopNum = sopNum;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getEquipModel() {
return equipModel;
}
public void setEquipModel(String equipModel) {
this.equipModel = equipModel;
}
public String getDescribe() {
return describe;
}
public void setDescribe(String describe) {
this.describe = describe;
}
public void setSopCode(String sopCode)
{ {
this.sopCode = sopCode; this.sopCode = sopCode;
} }
@ -301,7 +365,13 @@ public class SysSop extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("delFlag", getDelFlag())
.append("sopId", getSopId()) .append("sopId", getSopId())
.append("sopNum", getSopNum())
.append("productName", getProductName())
.append("equipModel", getEquipModel())
.append("describe", getDescribe())
.append("sopCode", getSopCode()) .append("sopCode", getSopCode())
.append("sopName", getSopName()) .append("sopName", getSopName())
.append("sopModel", getSopModel()) .append("sopModel", getSopModel())
@ -321,8 +391,6 @@ public class SysSop extends BaseEntity
.append("sopRegistrant", getSopRegistrant()) .append("sopRegistrant", getSopRegistrant())
.append("sopRemark", getSopRemark()) .append("sopRemark", getSopRemark())
.append("currentVersion", getCurrentVersion()) .append("currentVersion", getCurrentVersion())
.append("firstAddTime", getFirstAddTime())
.append("updateInfoTime", getUpdateInfoTime())
.toString(); .toString();
} }
} }

12
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSopMapper.java

@ -15,10 +15,10 @@ public interface SysSopMapper
/** /**
* 查询SOP * 查询SOP
* *
* @param sopId SOPID * @param id 主键id
* @return SOP * @return SOP
*/ */
public SysSop selectSysSopById(Long sopId); public SysSop selectSysSopById(Long id);
/** /**
* 查询SOP列表 * 查询SOP列表
@ -47,16 +47,16 @@ public interface SysSopMapper
/** /**
* 删除SOP * 删除SOP
* *
* @param sopId SOPID * @param id 主键id
* @return 结果 * @return 结果
*/ */
public int deleteSysSopById(Long sopId); public int deleteSysSopById(Long id);
/** /**
* 批量删除SOP * 批量删除SOP
* *
* @param sopIds 需要删除的数据ID * @param ids 需要删除的数据ID
* @return 结果 * @return 结果
*/ */
public int deleteSysSopByIds(String[] sopIds); public int deleteSysSopByIds(String[] ids);
} }

21
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSopServiceImpl.java

@ -1,6 +1,9 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.SysSop; import com.ruoyi.system.domain.SysSop;
import com.ruoyi.system.mapper.SysSopMapper; import com.ruoyi.system.mapper.SysSopMapper;
import com.ruoyi.system.service.ISysSopService; import com.ruoyi.system.service.ISysSopService;
@ -21,6 +24,9 @@ public class SysSopServiceImpl implements ISysSopService
@Autowired @Autowired
private SysSopMapper sysSopMapper; private SysSopMapper sysSopMapper;
@Autowired
private RedisCache redisCache;
/** /**
* 查询SOP * 查询SOP
* *
@ -54,6 +60,12 @@ public class SysSopServiceImpl implements ISysSopService
@Override @Override
public int insertSysSop(SysSop sysSop) public int insertSysSop(SysSop sysSop)
{ {
String loginName = ShiroUtils.getLoginName();
sysSop.setCreateBy(loginName);
sysSop.setCreateTime(DateUtils.getNowDate());
// 生成编号
String billNo = redisCache.generateNo("SOP");
sysSop.setSopId(billNo);
return sysSopMapper.insertSysSop(sysSop); return sysSopMapper.insertSysSop(sysSop);
} }
@ -66,6 +78,9 @@ public class SysSopServiceImpl implements ISysSopService
@Override @Override
public int updateSysSop(SysSop sysSop) public int updateSysSop(SysSop sysSop)
{ {
String loginName = ShiroUtils.getLoginName();
sysSop.setUpdateBy(loginName);
sysSop.setUpdateTime(DateUtils.getNowDate());
return sysSopMapper.updateSysSop(sysSop); return sysSopMapper.updateSysSop(sysSop);
} }
@ -84,12 +99,12 @@ public class SysSopServiceImpl implements ISysSopService
/** /**
* 删除SOP信息 * 删除SOP信息
* *
* @param sopId SOPID * @param id 主键id
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteSysSopById(Long sopId) public int deleteSysSopById(Long id)
{ {
return sysSopMapper.deleteSysSopById(sopId); return sysSopMapper.deleteSysSopById(id);
} }
} }

65
ruoyi-admin/src/main/resources/mapper/system/SysSopMapper.xml

@ -5,7 +5,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.system.mapper.SysSopMapper"> <mapper namespace="com.ruoyi.system.mapper.SysSopMapper">
<resultMap type="SysSop" id="SysSopResult"> <resultMap type="SysSop" id="SysSopResult">
<result property="id" column="id" />
<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="delFlag" column="del_flag" />
<result property="sopId" column="sop_id" /> <result property="sopId" column="sop_id" />
<result property="sopNum" column="sop_num" />
<result property="productName" column="product_name" />
<result property="equipModel" column="equip_model" />
<result property="describe" column="describe" />
<result property="sopCode" column="sop_code" /> <result property="sopCode" column="sop_code" />
<result property="sopName" column="sop_name" /> <result property="sopName" column="sop_name" />
<result property="sopModel" column="sop_model" /> <result property="sopModel" column="sop_model" />
@ -25,17 +36,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="sopRegistrant" column="sop_registrant" /> <result property="sopRegistrant" column="sop_registrant" />
<result property="sopRemark" column="sop_remark" /> <result property="sopRemark" column="sop_remark" />
<result property="currentVersion" column="current_version" /> <result property="currentVersion" column="current_version" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
</resultMap> </resultMap>
<sql id="selectSysSopVo"> <sql id="selectSysSopVo">
select sop_id, sop_code, sop_name, sop_model, type_of_machine, sop_unit, drawing_file, workhour_file, sop_file, sip_file, spp_file, bom_file, customer_file, other_file, customer_code, customer_name, date_of_registration, sop_registrant, sop_remark, current_version, first_add_time, update_info_time from sys_sop select id,del_flag,create_by,create_time,update_by,update_time,remark,sop_id,sop_num,product_name,equip_model,`describe`,sop_code, sop_name, sop_model, type_of_machine, sop_unit, drawing_file, workhour_file, sop_file, sip_file, spp_file, bom_file, customer_file, other_file, customer_code, customer_name, date_of_registration, sop_registrant, sop_remark, current_version from sys_sop
</sql> </sql>
<select id="selectSysSopList" parameterType="SysSop" resultMap="SysSopResult"> <select id="selectSysSopList" parameterType="SysSop" resultMap="SysSopResult">
<include refid="selectSysSopVo"/> <include refid="selectSysSopVo"/>
<where> <where>
<if test="sopId != null and sopId != ''"> and sop_id = #{sopId}</if>
<if test="sopCode != null and sopCode != ''"> and sop_code like concat('%', #{sopCode}, '%')</if> <if test="sopCode != null and sopCode != ''"> and sop_code like concat('%', #{sopCode}, '%')</if>
<if test="sopName != null and sopName != ''"> and sop_name like concat('%', #{sopName}, '%')</if> <if test="sopName != null and sopName != ''"> and sop_name like concat('%', #{sopName}, '%')</if>
<if test="customerCode != null and customerCode != ''"> and customer_code like concat('%', #{customerCode}, '%')</if> <if test="customerCode != null and customerCode != ''"> and customer_code like concat('%', #{customerCode}, '%')</if>
@ -46,12 +56,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSysSopById" parameterType="Long" resultMap="SysSopResult"> <select id="selectSysSopById" parameterType="Long" resultMap="SysSopResult">
<include refid="selectSysSopVo"/> <include refid="selectSysSopVo"/>
where sop_id = #{sopId} where id = #{id}
</select> </select>
<insert id="insertSysSop" parameterType="SysSop" useGeneratedKeys="true" keyProperty="sopId"> <insert id="insertSysSop" parameterType="SysSop" useGeneratedKeys="true" keyProperty="sopId">
insert into sys_sop insert into sys_sop
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sopId != null and sopId != ''">sop_id,</if>
<if test="sopNum != null and sopNum != ''">sop_num,</if>
<if test="productName != null and productName != ''">product_name,</if>
<if test="equipModel != null and equipModel != ''">equip_model,</if>
<if test="describe != null and describe != ''">`describe`,</if>
<if test="sopCode != null and sopCode != ''">sop_code,</if> <if test="sopCode != null and sopCode != ''">sop_code,</if>
<if test="sopName != null and sopName != ''">sop_name,</if> <if test="sopName != null and sopName != ''">sop_name,</if>
<if test="sopModel != null and sopModel != ''">sop_model,</if> <if test="sopModel != null and sopModel != ''">sop_model,</if>
@ -71,9 +86,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sopRegistrant != null and sopRegistrant != ''">sop_registrant,</if> <if test="sopRegistrant != null and sopRegistrant != ''">sop_registrant,</if>
<if test="sopRemark != null and sopRemark != ''">sop_remark,</if> <if test="sopRemark != null and sopRemark != ''">sop_remark,</if>
<if test="currentVersion != null and currentVersion != ''">current_version,</if> <if test="currentVersion != null and currentVersion != ''">current_version,</if>
first_add_time, <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="delFlag != null">del_flag,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sopId != null and sopId != ''">#{sopId},</if>
<if test="sopNum != null and sopNum != ''">#{sopNum},</if>
<if test="productName != null and productName != ''">#{productName},</if>
<if test="equipModel != null and equipModel != ''">#{equipModel},</if>
<if test="describe != null and describe != ''">#{describe},</if>
<if test="sopCode != null and sopCode != ''">#{sopCode},</if> <if test="sopCode != null and sopCode != ''">#{sopCode},</if>
<if test="sopName != null and sopName != ''">#{sopName},</if> <if test="sopName != null and sopName != ''">#{sopName},</if>
<if test="sopModel != null and sopModel != ''">#{sopModel},</if> <if test="sopModel != null and sopModel != ''">#{sopModel},</if>
@ -93,13 +118,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sopRegistrant != null and sopRegistrant != ''">#{sopRegistrant},</if> <if test="sopRegistrant != null and sopRegistrant != ''">#{sopRegistrant},</if>
<if test="sopRemark != null and sopRemark != ''">#{sopRemark},</if> <if test="sopRemark != null and sopRemark != ''">#{sopRemark},</if>
<if test="currentVersion != null and currentVersion != ''">#{currentVersion},</if> <if test="currentVersion != null and currentVersion != ''">#{currentVersion},</if>
now(), <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="delFlag != null">#{delFlag},</if>
</trim> </trim>
</insert> </insert>
<update id="updateSysSop" parameterType="SysSop"> <update id="updateSysSop" parameterType="SysSop">
update sys_sop update sys_sop
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="sopNum != null and sopNum != ''">sop_num = #{sopNum},</if>
<if test="productName != null and productName != ''">product_name = #{productName},</if>
<if test="equipModel != null and equipModel != ''">equip_model = #{equipModel},</if>
<if test="describe != null and describe != ''">`describe` = #{describe},</if>
<if test="sopCode != null and sopCode != ''">sop_code = #{sopCode},</if> <if test="sopCode != null and sopCode != ''">sop_code = #{sopCode},</if>
<if test="sopName != null and sopName != ''">sop_name = #{sopName},</if> <if test="sopName != null and sopName != ''">sop_name = #{sopName},</if>
<if test="sopModel != null and sopModel != ''">sop_model = #{sopModel},</if> <if test="sopModel != null and sopModel != ''">sop_model = #{sopModel},</if>
@ -119,19 +153,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sopRegistrant != null and sopRegistrant != ''">sop_registrant = #{sopRegistrant},</if> <if test="sopRegistrant != null and sopRegistrant != ''">sop_registrant = #{sopRegistrant},</if>
<if test="sopRemark != null and sopRemark != ''">sop_remark = #{sopRemark},</if> <if test="sopRemark != null and sopRemark != ''">sop_remark = #{sopRemark},</if>
<if test="currentVersion != null and currentVersion != ''">current_version = #{currentVersion},</if> <if test="currentVersion != null and currentVersion != ''">current_version = #{currentVersion},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time), <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="delFlag != null">del_flag = #{delFlag},</if>
</trim> </trim>
where sop_id = #{sopId} where id = #{sopId}
</update> </update>
<delete id="deleteSysSopById" parameterType="Long"> <delete id="deleteSysSopById" parameterType="Long">
delete from sys_sop where sop_id = #{sopId} delete from sys_sop where id = #{id}
</delete> </delete>
<delete id="deleteSysSopByIds" parameterType="String"> <delete id="deleteSysSopByIds" parameterType="String">
delete from sys_sop where sop_id in delete from sys_sop where id in
<foreach item="sopId" collection="array" open="(" separator="," close=")"> <foreach item="item" collection="array" open="(" separator="," close=")">
#{sopId} #{item}
</foreach> </foreach>
</delete> </delete>

24
ruoyi-admin/src/main/resources/templates/system/sop/add.html

@ -16,6 +16,30 @@
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-sop-add"> <form class="form-horizontal m" id="form-sop-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">设备型号:</label>
<div class="col-sm-8">
<input name="equipModel" id="equipModel" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">SOP编号:</label>
<div class="col-sm-8">
<input name="sopNum" id="sopNum" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">品名:</label>
<div class="col-sm-8">
<input name="productName" id="productName" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述:</label>
<div class="col-sm-8">
<input name="describe" id="describe" class="form-control" type="text">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">成品代码:</label> <label class="col-sm-3 control-label is-required">成品代码:</label>
<div class="col-sm-8"> <div class="col-sm-8">

32
ruoyi-admin/src/main/resources/templates/system/sop/edit.html

@ -10,7 +10,37 @@
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-sop-edit" th:object="${sysSop}"> <form class="form-horizontal m" id="form-sop-edit" th:object="${sysSop}">
<input name="sopId" th:field="*{sopId}" type="hidden"> <input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">sopId:</label>
<div class="col-sm-8">
<input readonly name="sopId" th:field="*{sopId}" 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">
<input name="equipModel" th:field="*{equipModel}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">SOP编号:</label>
<div class="col-sm-8">
<input name="sopNum" th:field="*{sopNum}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">品名:</label>
<div class="col-sm-8">
<input name="productName" th:field="*{productName}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述:</label>
<div class="col-sm-8">
<input name="describe" th:field="*{describe}" class="form-control" type="text">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">成品代码:</label> <label class="col-sm-3 control-label is-required">成品代码:</label>
<div class="col-sm-8"> <div class="col-sm-8">

372
ruoyi-admin/src/main/resources/templates/system/sop/sop.html

@ -39,6 +39,10 @@
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</li> </li>
<li>
<label>sopId:</label>
<input type="text" name="sopId"/>
</li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -87,192 +91,212 @@
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
{ {
field: 'sopId', title: '主键ID',
title: 'sopid', field: 'id',
visible: false visible: false
}, },
{ {
field: 'sopCode', field: 'sopId',
title: '成品代码' title: 'SOPID'
}, },
{ {
field: 'sopName', field: 'sopNum',
title: '成品名称' title: 'SOP编号'
}, },
{ {
field: 'sopModel', field: 'productName',
title: '规格型号' title: '品名'
}, },
{ {
field: 'typeOfMachine', field: 'equipModel',
title: '机种' title: '设备型号'
}, },
{ {
field: 'sopUnit', field: 'describe',
title: '单位', title: '描述'
formatter: function(value, row, index) { },
return $.table.selectDictLabel(sopUnitDatas, value); {
} field: 'sopCode',
}, title: '成品代码'
{ },
field: 'drawingFile', {
title: '图纸文件', field: 'sopName',
formatter: function(value, row, index) { title: '成品名称'
var actions = []; },
if (value !== null) { {
var filepath = value.substring(value.lastIndexOf("/")+1) field: 'sopModel',
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> '); title: '规格型号'
} },
return actions.join(''); {
} field: 'typeOfMachine',
}, title: '机种'
{ },
field: 'workhourFile', {
title: '工时文件', field: 'sopUnit',
formatter: function(value, row, index) { title: '单位',
var actions = []; formatter: function(value, row, index) {
if (value !== null) { return $.table.selectDictLabel(sopUnitDatas, value);
var filepath = value.substring(value.lastIndexOf("/")+1) }
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> '); },
} {
return actions.join(''); field: 'drawingFile',
title: '图纸文件',
formatter: function(value, row, index) {
var actions = [];
if (value !== null) {
var filepath = value.substring(value.lastIndexOf("/")+1)
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
} }
}, return actions.join('');
{ }
field: 'sopFile', },
title: 'SOP文件', {
formatter: function(value, row, index) { field: 'workhourFile',
var actions = []; title: '工时文件',
if (value !== null) { formatter: function(value, row, index) {
var filepath = value.substring(value.lastIndexOf("/")+1) var actions = [];
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> '); if (value !== null) {
} var filepath = value.substring(value.lastIndexOf("/")+1)
return actions.join(''); actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
} }
}, return actions.join('');
{ }
field: 'sipFile', },
title: 'SIP文件', {
formatter: function(value, row, index) { field: 'sopFile',
var actions = []; title: 'SOP文件',
if (value !== null) { formatter: function(value, row, index) {
var filepath = value.substring(value.lastIndexOf("/")+1) var actions = [];
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> '); if (value !== null) {
} var filepath = value.substring(value.lastIndexOf("/")+1)
return actions.join(''); actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
} }
}, return actions.join('');
{ }
field: 'sppFile', },
title: 'SPP文件', {
formatter: function(value, row, index) { field: 'sipFile',
var actions = []; title: 'SIP文件',
if (value !== null) { formatter: function(value, row, index) {
var filepath = value.substring(value.lastIndexOf("/")+1) var actions = [];
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> '); if (value !== null) {
} var filepath = value.substring(value.lastIndexOf("/")+1)
return actions.join(''); actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
} }
}, return actions.join('');
{ }
field: 'bomFile', },
title: 'BOM文件', {
formatter: function(value, row, index) { field: 'sppFile',
var actions = []; title: 'SPP文件',
if (value !== null) { formatter: function(value, row, index) {
var filepath = value.substring(value.lastIndexOf("/")+1) var actions = [];
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> '); if (value !== null) {
} var filepath = value.substring(value.lastIndexOf("/")+1)
return actions.join(''); actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
} }
}, return actions.join('');
{ }
field: 'customerFile', },
title: '客户文件', {
formatter: function(value, row, index) { field: 'bomFile',
var actions = []; title: 'BOM文件',
if (value !== null) { formatter: function(value, row, index) {
var filepath = value.substring(value.lastIndexOf("/")+1) var actions = [];
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> '); if (value !== null) {
} var filepath = value.substring(value.lastIndexOf("/")+1)
return actions.join(''); actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
} }
}, return actions.join('');
{ }
field: 'otherFile', },
title: '其他文件', {
formatter: function(value, row, index) { field: 'customerFile',
var actions = []; title: '客户文件',
if (value !== null) { formatter: function(value, row, index) {
var filepath = value.substring(value.lastIndexOf("/")+1) var actions = [];
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> '); if (value !== null) {
} var filepath = value.substring(value.lastIndexOf("/")+1)
return actions.join(''); actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
} }
}, return actions.join('');
{ }
field: 'customerCode', },
title: '客户编号' {
}, field: 'otherFile',
{ title: '其他文件',
field: 'customerName', formatter: function(value, row, index) {
title: '客户名称' var actions = [];
}, if (value !== null) {
{ var filepath = value.substring(value.lastIndexOf("/")+1)
field: 'dateOfRegistration', actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
title: '登记日期'
},
{
field: 'sopRegistrant',
title: '登记人'
},
{
field: 'sopRemark',
title: '备注说明'
},
{
field: 'currentVersion',
title: '是否当前版本',
formatter: function (value, row, index) {
return $.table.selectDictLabel(currentVersionDatas, value);
} }
}, return actions.join('');
{ }
field: 'firstAddTime', },
title: '录入时间', {
formatter: function (value, row, index) { field: 'customerCode',
if (value == null) { title: '客户编号'
return " "; },
} else { {
return value; field: 'customerName',
} title: '客户名称'
},
{
field: 'dateOfRegistration',
title: '登记日期'
},
{
field: 'sopRegistrant',
title: '登记人'
},
{
field: 'sopRemark',
title: '备注说明'
},
{
field: 'currentVersion',
title: '是否当前版本',
formatter: function (value, row, index) {
return $.table.selectDictLabel(currentVersionDatas, value);
}
},
{
field: 'createTime',
title: '录入时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
return value;
} }
}, }
{ },
field: 'updateInfoTime', {
title: '上次修改时间', field: 'updateTime',
formatter: function (value, row, index) { title: '上次修改时间',
if (value == null) { formatter: function (value, row, index) {
return " "; if (value == null) {
} else { return " ";
var vArr = value.split(',') } else {
return vArr[0]; var vArr = value.split(',')
} return vArr[0];
} }
} }
}
// { // {
// title: '操作', // title: '操作',
// align: 'center', // align: 'center',
// formatter: function(value, row, index) { // formatter: function(value, row, index) {
// var actions = []; // var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.sopId + '\')"><i class="fa fa-edit"></i>编辑</a> '); // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.sopId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.sopId + '\')"><i class="fa fa-remove"></i>删除</a>'); // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.sopId + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join(''); // return actions.join('');
// } // }
// } // }
] ]
}; };
$.table.init(options); $.table.init(options);
}); });

Loading…
Cancel
Save