提交代码
parent
e31a2e2c91
commit
082acc5ce8
|
@ -8,7 +8,7 @@ import com.yanzhu.common.core.annotation.Excel;
|
|||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 安全隐患整改对象 smz_ssp_problemmodify
|
||||
* 隐患问题对象 smz_ssp_problemmodify
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -17,7 +17,7 @@ public class SmzSspProblemmodify extends BaseEntity
|
|||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
/** 编号 */
|
||||
private Long id;
|
||||
|
||||
/** 租户ID */
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.yanzhu.manage.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
@ -8,7 +10,7 @@ import com.yanzhu.common.core.annotation.Excel;
|
|||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 安全问题草稿对象 smz_ssp_problemmodify_draft
|
||||
* 隐患草稿对象 smz_ssp_problemmodify_draft
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -17,7 +19,7 @@ public class SmzSspProblemmodifyDraft extends BaseEntity
|
|||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
/** 编号 */
|
||||
private Long id;
|
||||
|
||||
/** 租户ID */
|
||||
|
@ -141,6 +143,8 @@ public class SmzSspProblemmodifyDraft extends BaseEntity
|
|||
@Excel(name = "问题类型", readConverterExp = "1=常规问题,2专项问题")
|
||||
private String problemType;
|
||||
|
||||
private List<List<String>> smarkUrls;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
@ -421,6 +425,14 @@ public class SmzSspProblemmodifyDraft extends BaseEntity
|
|||
return problemType;
|
||||
}
|
||||
|
||||
public List<List<String>> getSmarkUrls() {
|
||||
return smarkUrls;
|
||||
}
|
||||
|
||||
public void setSmarkUrls(List<List<String>> smarkUrls) {
|
||||
this.smarkUrls = smarkUrls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
import com.yanzhu.manage.domain.SmzSspProblemmodifyDraft;
|
||||
|
||||
/**
|
||||
* 安全问题草稿Mapper接口
|
||||
* 隐患草稿Mapper接口
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -12,47 +12,47 @@ import com.yanzhu.manage.domain.SmzSspProblemmodifyDraft;
|
|||
public interface SmzSspProblemmodifyDraftMapper
|
||||
{
|
||||
/**
|
||||
* 查询安全问题草稿
|
||||
* 查询隐患草稿
|
||||
*
|
||||
* @param id 安全问题草稿主键
|
||||
* @return 安全问题草稿
|
||||
* @param id 隐患草稿主键
|
||||
* @return 隐患草稿
|
||||
*/
|
||||
public SmzSspProblemmodifyDraft selectSmzSspProblemmodifyDraftById(Long id);
|
||||
|
||||
/**
|
||||
* 查询安全问题草稿列表
|
||||
* 查询隐患草稿列表
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 安全问题草稿
|
||||
* @return 安全问题草稿集合
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 隐患草稿集合
|
||||
*/
|
||||
public List<SmzSspProblemmodifyDraft> selectSmzSspProblemmodifyDraftList(SmzSspProblemmodifyDraft smzSspProblemmodifyDraft);
|
||||
|
||||
/**
|
||||
* 新增安全问题草稿
|
||||
* 新增隐患草稿
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 安全问题草稿
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSmzSspProblemmodifyDraft(SmzSspProblemmodifyDraft smzSspProblemmodifyDraft);
|
||||
|
||||
/**
|
||||
* 修改安全问题草稿
|
||||
* 修改隐患草稿
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 安全问题草稿
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSmzSspProblemmodifyDraft(SmzSspProblemmodifyDraft smzSspProblemmodifyDraft);
|
||||
|
||||
/**
|
||||
* 删除安全问题草稿
|
||||
* 删除隐患草稿
|
||||
*
|
||||
* @param id 安全问题草稿主键
|
||||
* @param id 隐患草稿主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmzSspProblemmodifyDraftById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除安全问题草稿
|
||||
* 批量删除隐患草稿
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.Map;
|
|||
import com.yanzhu.manage.domain.SmzSspProblemmodify;
|
||||
|
||||
/**
|
||||
* 安全隐患整改Mapper接口
|
||||
* 隐患问题Mapper接口
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -14,47 +14,47 @@ import com.yanzhu.manage.domain.SmzSspProblemmodify;
|
|||
public interface SmzSspProblemmodifyMapper
|
||||
{
|
||||
/**
|
||||
* 查询安全隐患整改
|
||||
* 查询隐患问题
|
||||
*
|
||||
* @param id 安全隐患整改主键
|
||||
* @return 安全隐患整改
|
||||
* @param id 隐患问题主键
|
||||
* @return 隐患问题
|
||||
*/
|
||||
public SmzSspProblemmodify selectSmzSspProblemmodifyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询安全隐患整改列表
|
||||
* 查询隐患问题列表
|
||||
*
|
||||
* @param smzSspProblemmodify 安全隐患整改
|
||||
* @return 安全隐患整改集合
|
||||
* @param smzSspProblemmodify 隐患问题
|
||||
* @return 隐患问题集合
|
||||
*/
|
||||
public List<SmzSspProblemmodify> selectSmzSspProblemmodifyList(SmzSspProblemmodify smzSspProblemmodify);
|
||||
|
||||
/**
|
||||
* 新增安全隐患整改
|
||||
* 新增隐患问题
|
||||
*
|
||||
* @param smzSspProblemmodify 安全隐患整改
|
||||
* @param smzSspProblemmodify 隐患问题
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSmzSspProblemmodify(SmzSspProblemmodify smzSspProblemmodify);
|
||||
|
||||
/**
|
||||
* 修改安全隐患整改
|
||||
* 修改隐患问题
|
||||
*
|
||||
* @param smzSspProblemmodify 安全隐患整改
|
||||
* @param smzSspProblemmodify 隐患问题
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSmzSspProblemmodify(SmzSspProblemmodify smzSspProblemmodify);
|
||||
|
||||
/**
|
||||
* 删除安全隐患整改
|
||||
* 删除隐患问题
|
||||
*
|
||||
* @param id 安全隐患整改主键
|
||||
* @param id 隐患问题主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmzSspProblemmodifyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除安全隐患整改
|
||||
* 批量删除隐患问题
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
|
@ -66,12 +66,19 @@ public interface SmzSspProblemmodifyMapper
|
|||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<SmzSspProblemmodify> getListCount(SmzSspProblemmodify where);
|
||||
public List<SmzSspProblemmodify> getListCount(SmzSspProblemmodify where);
|
||||
|
||||
/**
|
||||
* 分组统计
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> getWxListCount(SmzSspProblemmodify where);
|
||||
|
||||
/**
|
||||
* 分组查询 全部数据、待整改、待复检、整改完成、整改超时的数量
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<SmzSspProblemmodify> selectList(SmzSspProblemmodify where);
|
||||
public List<SmzSspProblemmodify> selectList(SmzSspProblemmodify where);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="problemTypeName" column="problemTypeName" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSmzSspProblemmodifyVo">
|
||||
<select id="selectSmzSspProblemmodifyList" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult">
|
||||
select
|
||||
ssp.id,
|
||||
ssp.comId,
|
||||
|
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ssp.smark_url,
|
||||
ssp.isDel,
|
||||
ssp.createUser,
|
||||
su.nick_name as createUserName
|
||||
su.nick_name as createUserName,
|
||||
ssp.createTime,
|
||||
ssp.updateUser,
|
||||
ssp.updateTime,
|
||||
|
@ -83,6 +83,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ssp.roleType,
|
||||
ssp.problemType,
|
||||
sdd1.dict_label AS problemTypeName
|
||||
<if test="createBy != null and createBy != ''">, case when ssp.recheckSend = #{createBy} and ssp.checkState=1 then 0
|
||||
when ssp.lordSentUser = #{createBy} then 1
|
||||
else 2 end sort
|
||||
</if>
|
||||
from
|
||||
smz_ssp_problemmodify ssp
|
||||
left join sys_dict_data sdd1 on sdd1.dict_type = 'ssp_proble_type'
|
||||
|
@ -90,10 +94,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_dict_data sdd2 on sdd2.dict_type = 'ssp_proble_sub_type'
|
||||
and sdd2.dict_value = ssp.danger_type
|
||||
left join sys_user su on su.user_id = ssp.createUser
|
||||
</sql>
|
||||
|
||||
<select id="selectSmzSspProblemmodifyList" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult">
|
||||
<include refid="selectSmzSspProblemmodifyVo"/>
|
||||
<where>
|
||||
<if test="comId != null "> and ssp.comId = #{comId}</if>
|
||||
<if test="projectId != null "> and ssp.projectId = #{projectId}</if>
|
||||
|
@ -116,13 +116,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ssp.createUser=#{currentUserId} or ssp.lordSent=#{currentUserId} or find_in_set(#{currentUserId},ssp.copySend) or ssp.recheckSend=#{currentUserId}
|
||||
)
|
||||
</if>
|
||||
and isDel = 0
|
||||
<if test='activeTags == "dzg"'> and ssp.checkState in (0,3) </if>
|
||||
<if test='activeTags == "yzg"'> and ssp.checkState in (1,4) </if>
|
||||
<if test='activeTags == "dfj"'> and ssp.checkState = 1 </if>
|
||||
<if test='activeTags == "ywc"'> and ssp.checkState = 4 </if>
|
||||
and ssp.isDel = 0
|
||||
</where>
|
||||
order by ssp.id desc
|
||||
order by sort, ssp.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectSmzSspProblemmodifyById" parameterType="Long" resultMap="SmzSspProblemmodifyResult">
|
||||
<include refid="selectSmzSspProblemmodifyVo"/>
|
||||
select
|
||||
ssp.id,
|
||||
ssp.comId,
|
||||
ssp.projectId,
|
||||
ssp.infoType,
|
||||
ssp.marks_picture,
|
||||
ssp.marks_video,
|
||||
ssp.correction_picture,
|
||||
ssp.problemArea,
|
||||
ssp.workParts,
|
||||
ssp.changeInfo,
|
||||
ssp.lordSent,
|
||||
ssp.lordSentUser,
|
||||
ssp.copySend,
|
||||
ssp.copySendUser,
|
||||
ssp.checkState,
|
||||
ssp.nickedArea,
|
||||
ssp.nickedTime,
|
||||
ssp.projectType,
|
||||
ssp.processName,
|
||||
ssp.projectName,
|
||||
ssp.nickedInfo,
|
||||
ssp.checkUser,
|
||||
ssp.checkUserPhone,
|
||||
ssp.smark_url,
|
||||
ssp.isDel,
|
||||
ssp.createUser,
|
||||
su.nick_name as createUserName,
|
||||
ssp.createTime,
|
||||
ssp.updateUser,
|
||||
ssp.updateTime,
|
||||
ssp.danger_type,
|
||||
sdd2.dict_label AS danger_type_name,
|
||||
ssp.recheckSend,
|
||||
ssp.recheckSendUser,
|
||||
ssp.roleType,
|
||||
ssp.problemType,
|
||||
sdd1.dict_label AS problemTypeName
|
||||
from
|
||||
smz_ssp_problemmodify ssp
|
||||
left join sys_dict_data sdd1 on sdd1.dict_type = 'ssp_proble_type'
|
||||
and sdd1.dict_value = ssp.problemType
|
||||
left join sys_dict_data sdd2 on sdd2.dict_type = 'ssp_proble_sub_type'
|
||||
and sdd2.dict_value = ssp.danger_type
|
||||
left join sys_user su on su.user_id = ssp.createUser
|
||||
where ssp.id = #{id}
|
||||
</select>
|
||||
|
||||
|
@ -250,6 +298,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<sql id="countUserWhere">
|
||||
<if test="problemType != null and problemType != ''"> and a,problemType = #{problemType}</if>
|
||||
<if test="dangerType != null and dangerType != ''"> and a.danger_type = #{dangerType}</if>
|
||||
|
@ -282,6 +331,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="countUserWhere"></include>
|
||||
</select>
|
||||
|
||||
<select id="getWxListCount" parameterType="SmzSspProblemmodify" resultType="Map">
|
||||
select ssp.checkState, count(1) as total from smz_ssp_problemmodify ssp
|
||||
<where>
|
||||
<if test="comId != null "> and ssp.comId = #{comId}</if>
|
||||
<if test="projectId != null "> and ssp.projectId = #{projectId}</if>
|
||||
<if test="infoType != null "> and ssp.infoType = #{infoType}</if>
|
||||
<if test="currentUserId != null and currentUserId!=''">
|
||||
and
|
||||
(
|
||||
ssp.createUser=#{currentUserId} or ssp.lordSent=#{currentUserId} or find_in_set(#{currentUserId},ssp.copySend) or ssp.recheckSend=#{currentUserId}
|
||||
)
|
||||
</if>
|
||||
and ssp.isDel = 0
|
||||
</where>
|
||||
group by ssp.checkState
|
||||
</select>
|
||||
|
||||
<select id="selectList" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult">
|
||||
SELECT
|
||||
a.id,
|
||||
|
|
|
@ -168,11 +168,13 @@
|
|||
<scope>system</scope>
|
||||
<systemPath>${pom.basedir}/libs/aspose-tasks-24.10-jdk17.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.sf.mpxj</groupId>
|
||||
<artifactId>mpxj</artifactId>
|
||||
<version>13.5.1</version> <!-- 请检查最新版本 -->
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
@ -28,7 +29,7 @@ import com.yanzhu.common.log.enums.BusinessType;
|
|||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* 安全隐患整改Controller
|
||||
* 隐患问题Controller
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -41,13 +42,13 @@ public class SmzSspProblemmodifyController extends BaseController
|
|||
private ISmzSspProblemmodifyService smzSspProblemmodifyService;
|
||||
|
||||
/**
|
||||
* 查询安全隐患整改列表
|
||||
* 查询隐患问题列表
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodify:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SmzSspProblemmodify where)
|
||||
{
|
||||
SysUser user=SecurityUtils.getLoginUser().getSysUser();
|
||||
SysUser user = SecurityUtils.getLoginUser().getSysUser();
|
||||
where.setProjectId(user.getActiveProjectId());
|
||||
where.setComId(user.getActiveComId());
|
||||
if(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || SecurityUtils.isGSAdmin()) {
|
||||
|
@ -60,6 +61,25 @@ public class SmzSspProblemmodifyController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询隐患问题列表
|
||||
* @RequiresPermissions("trouble:problemmodify:list")
|
||||
*/
|
||||
@GetMapping("/wxList")
|
||||
public TableDataInfo wxList(SmzSspProblemmodify where)
|
||||
{
|
||||
SysUser user = SecurityUtils.getLoginUser().getSysUser();
|
||||
if(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || SecurityUtils.isGSAdmin()) {
|
||||
where.setCurrentUserId(null);
|
||||
}else{
|
||||
where.setCurrentUserId(user.getUserId());
|
||||
}
|
||||
where.setCreateBy(user.getUserId().toString());
|
||||
startPage();
|
||||
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSmzSspProblemmodifyList(where);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分组统计 用户 全部数据、待整改、待复检、整改完成、整改超时的数量
|
||||
* @return
|
||||
|
@ -78,21 +98,66 @@ public class SmzSspProblemmodifyController extends BaseController
|
|||
List<SmzSspProblemmodify> result=smzSspProblemmodifyService.getListCount(where);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出安全隐患整改列表
|
||||
* 分组统计 用户 全部数据、待整改、待复检、整改完成、整改超时的数量
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/wxListCount")
|
||||
public AjaxResult getWxListCount(SmzSspProblemmodify where){
|
||||
SysUser user = SecurityUtils.getLoginUser().getSysUser();
|
||||
if(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || SecurityUtils.isGSAdmin()) {
|
||||
where.setCurrentUserId(null);
|
||||
}else{
|
||||
where.setCurrentUserId(user.getUserId());
|
||||
}
|
||||
List<Map<String, Object>> result=smzSspProblemmodifyService.getWxListCount(where);
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
int dzg=0,yzg=0,dfj=0,ywc=0;
|
||||
if(result.size()>0){
|
||||
for (Map<String, Object> map:result){
|
||||
// 待整改
|
||||
if(StringUtils.eqObj(map.get("checkState"),"0")){
|
||||
dzg += Convert.toInt(map.get("total"),0);
|
||||
}
|
||||
// 待复检
|
||||
if(StringUtils.eqObj(map.get("checkState"),"1")){
|
||||
dfj += Convert.toInt(map.get("total"),0);
|
||||
yzg += Convert.toInt(map.get("total"),0);
|
||||
}
|
||||
// 复检驳回
|
||||
if(StringUtils.eqObj(map.get("checkState"),"3")){
|
||||
dzg += Convert.toInt(map.get("total"),0);
|
||||
}
|
||||
// 整改完成
|
||||
if(StringUtils.eqObj(map.get("checkState"),"4")){
|
||||
ywc += Convert.toInt(map.get("total"),0);
|
||||
yzg += Convert.toInt(map.get("total"),0);
|
||||
}
|
||||
}
|
||||
}
|
||||
data.put("dzg",dzg);
|
||||
data.put("yzg",yzg);
|
||||
data.put("dfj",dfj);
|
||||
data.put("ywc",ywc);
|
||||
return AjaxResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出隐患问题列表
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodify:export")
|
||||
@Log(title = "安全隐患整改", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "隐患问题", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SmzSspProblemmodify smzSspProblemmodify)
|
||||
{
|
||||
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSmzSspProblemmodifyList(smzSspProblemmodify);
|
||||
ExcelUtil<SmzSspProblemmodify> util = new ExcelUtil<SmzSspProblemmodify>(SmzSspProblemmodify.class);
|
||||
util.exportExcel(response, list, "安全隐患整改数据");
|
||||
util.exportExcel(response, list, "隐患问题数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取安全隐患整改详细信息
|
||||
* 获取隐患问题详细信息
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodify:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
|
@ -102,10 +167,10 @@ public class SmzSspProblemmodifyController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增安全隐患整改
|
||||
* 新增隐患问题
|
||||
* @RequiresPermissions("trouble:problemmodify:add")
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodify:add")
|
||||
@Log(title = "安全隐患整改", businessType = BusinessType.INSERT)
|
||||
@Log(title = "隐患问题", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SmzSspProblemmodify smzSspProblemmodify)
|
||||
{
|
||||
|
@ -113,10 +178,10 @@ public class SmzSspProblemmodifyController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增安全隐患整改
|
||||
* 新增隐患问题
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodify:add")
|
||||
@Log(title = "安全隐患整改", businessType = BusinessType.INSERT)
|
||||
@Log(title = "隐患问题", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/batchAdd")
|
||||
public AjaxResult batchAdd(@RequestBody List<SmzSspProblemmodify> list)
|
||||
{
|
||||
|
@ -125,10 +190,10 @@ public class SmzSspProblemmodifyController extends BaseController
|
|||
|
||||
|
||||
/**
|
||||
* 修改安全隐患整改
|
||||
* 修改隐患问题
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodify:edit")
|
||||
@Log(title = "安全隐患整改", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "隐患问题", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SmzSspProblemmodify smzSspProblemmodify)
|
||||
{
|
||||
|
@ -136,10 +201,10 @@ public class SmzSspProblemmodifyController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除安全隐患整改
|
||||
* 删除隐患问题
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodify:remove")
|
||||
@Log(title = "安全隐患整改", businessType = BusinessType.DELETE)
|
||||
@Log(title = "隐患问题", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ import com.yanzhu.common.log.enums.BusinessType;
|
|||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* 安全问题草稿Controller
|
||||
* 隐患草稿Controller
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -36,7 +36,7 @@ public class SmzSspProblemmodifyDraftController extends BaseController
|
|||
private ISmzSspProblemmodifyDraftService smzSspProblemmodifyDraftService;
|
||||
|
||||
/**
|
||||
* 查询安全问题草稿列表
|
||||
* 查询隐患草稿列表
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodifyDraft:list")
|
||||
@GetMapping("/list")
|
||||
|
@ -48,20 +48,20 @@ public class SmzSspProblemmodifyDraftController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 导出安全问题草稿列表
|
||||
* 导出隐患草稿列表
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodifyDraft:export")
|
||||
@Log(title = "安全问题草稿", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "隐患草稿", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SmzSspProblemmodifyDraft smzSspProblemmodifyDraft)
|
||||
{
|
||||
List<SmzSspProblemmodifyDraft> list = smzSspProblemmodifyDraftService.selectSmzSspProblemmodifyDraftList(smzSspProblemmodifyDraft);
|
||||
ExcelUtil<SmzSspProblemmodifyDraft> util = new ExcelUtil<SmzSspProblemmodifyDraft>(SmzSspProblemmodifyDraft.class);
|
||||
util.exportExcel(response, list, "安全问题草稿数据");
|
||||
util.exportExcel(response, list, "隐患草稿数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取安全问题草稿详细信息
|
||||
* 获取隐患草稿详细信息
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodifyDraft:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
|
@ -71,10 +71,10 @@ public class SmzSspProblemmodifyDraftController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增安全问题草稿
|
||||
* 新增隐患草稿
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodifyDraft:add")
|
||||
@Log(title = "安全问题草稿", businessType = BusinessType.INSERT)
|
||||
@Log(title = "隐患草稿", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SmzSspProblemmodifyDraft smzSspProblemmodifyDraft)
|
||||
{
|
||||
|
@ -82,10 +82,21 @@ public class SmzSspProblemmodifyDraftController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改安全问题草稿
|
||||
* 新增隐患草稿
|
||||
* @RequiresPermissions("trouble:problemmodifyDraft:add")
|
||||
*/
|
||||
@Log(title = "隐患草稿", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addDraft")
|
||||
public AjaxResult addDraft(@RequestBody SmzSspProblemmodifyDraft smzSspProblemmodifyDraft)
|
||||
{
|
||||
return toAjax(smzSspProblemmodifyDraftService.insertSmzSspProblemmodifyDraftWx(smzSspProblemmodifyDraft));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改隐患草稿
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodifyDraft:edit")
|
||||
@Log(title = "安全问题草稿", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "隐患草稿", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SmzSspProblemmodifyDraft smzSspProblemmodifyDraft)
|
||||
{
|
||||
|
@ -93,10 +104,10 @@ public class SmzSspProblemmodifyDraftController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除安全问题草稿
|
||||
* 删除隐患草稿
|
||||
*/
|
||||
@RequiresPermissions("trouble:problemmodifyDraft:remove")
|
||||
@Log(title = "安全问题草稿", businessType = BusinessType.DELETE)
|
||||
@Log(title = "隐患草稿", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
|
|
|
@ -4,6 +4,9 @@ import com.yanzhu.common.core.utils.StringUtils;
|
|||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 业务模板类型
|
||||
*/
|
||||
public enum BasTemTypes {
|
||||
|
||||
DLR("1", "委托代理人"),
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.yanzhu.manage.enums;
|
||||
|
||||
/**
|
||||
* 隐患状态枚举
|
||||
*/
|
||||
public enum CheckStateEnums {
|
||||
|
||||
DZG(0L, "待整改"),
|
||||
DFJ(1L, "待复检"),
|
||||
ZGBH(3L, "整改驳回"),
|
||||
ZGWC(4L, "整改完成");
|
||||
|
||||
private final Long code;
|
||||
private final String info;
|
||||
|
||||
CheckStateEnums(Long code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Long getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
import com.yanzhu.manage.domain.SmzSspProblemmodifyDraft;
|
||||
|
||||
/**
|
||||
* 安全问题草稿Service接口
|
||||
* 隐患草稿Service接口
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -12,49 +12,57 @@ import com.yanzhu.manage.domain.SmzSspProblemmodifyDraft;
|
|||
public interface ISmzSspProblemmodifyDraftService
|
||||
{
|
||||
/**
|
||||
* 查询安全问题草稿
|
||||
* 查询隐患草稿
|
||||
*
|
||||
* @param id 安全问题草稿主键
|
||||
* @return 安全问题草稿
|
||||
* @param id 隐患草稿主键
|
||||
* @return 隐患草稿
|
||||
*/
|
||||
public SmzSspProblemmodifyDraft selectSmzSspProblemmodifyDraftById(Long id);
|
||||
|
||||
/**
|
||||
* 查询安全问题草稿列表
|
||||
* 查询隐患草稿列表
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 安全问题草稿
|
||||
* @return 安全问题草稿集合
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 隐患草稿集合
|
||||
*/
|
||||
public List<SmzSspProblemmodifyDraft> selectSmzSspProblemmodifyDraftList(SmzSspProblemmodifyDraft smzSspProblemmodifyDraft);
|
||||
|
||||
/**
|
||||
* 新增安全问题草稿
|
||||
* 新增隐患草稿
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 安全问题草稿
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSmzSspProblemmodifyDraft(SmzSspProblemmodifyDraft smzSspProblemmodifyDraft);
|
||||
|
||||
/**
|
||||
* 修改安全问题草稿
|
||||
* 新增隐患草稿
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 安全问题草稿
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSmzSspProblemmodifyDraftWx(SmzSspProblemmodifyDraft smzSspProblemmodifyDraft);
|
||||
|
||||
/**
|
||||
* 修改隐患草稿
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSmzSspProblemmodifyDraft(SmzSspProblemmodifyDraft smzSspProblemmodifyDraft);
|
||||
|
||||
/**
|
||||
* 批量删除安全问题草稿
|
||||
* 批量删除隐患草稿
|
||||
*
|
||||
* @param ids 需要删除的安全问题草稿主键集合
|
||||
* @param ids 需要删除的隐患草稿主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmzSspProblemmodifyDraftByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除安全问题草稿信息
|
||||
* 删除隐患草稿信息
|
||||
*
|
||||
* @param id 安全问题草稿主键
|
||||
* @param id 隐患草稿主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmzSspProblemmodifyDraftById(Long id);
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.Map;
|
|||
import com.yanzhu.manage.domain.SmzSspProblemmodify;
|
||||
|
||||
/**
|
||||
* 安全隐患整改Service接口
|
||||
* 隐患问题Service接口
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -14,49 +14,49 @@ import com.yanzhu.manage.domain.SmzSspProblemmodify;
|
|||
public interface ISmzSspProblemmodifyService
|
||||
{
|
||||
/**
|
||||
* 查询安全隐患整改
|
||||
* 查询隐患问题
|
||||
*
|
||||
* @param id 安全隐患整改主键
|
||||
* @return 安全隐患整改
|
||||
* @param id 隐患问题主键
|
||||
* @return 隐患问题
|
||||
*/
|
||||
public SmzSspProblemmodify selectSmzSspProblemmodifyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询安全隐患整改列表
|
||||
* 查询隐患问题列表
|
||||
*
|
||||
* @param smzSspProblemmodify 安全隐患整改
|
||||
* @return 安全隐患整改集合
|
||||
* @param smzSspProblemmodify 隐患问题
|
||||
* @return 隐患问题集合
|
||||
*/
|
||||
public List<SmzSspProblemmodify> selectSmzSspProblemmodifyList(SmzSspProblemmodify smzSspProblemmodify);
|
||||
|
||||
/**
|
||||
* 新增安全隐患整改
|
||||
* 新增隐患问题
|
||||
*
|
||||
* @param smzSspProblemmodify 安全隐患整改
|
||||
* @param smzSspProblemmodify 隐患问题
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSmzSspProblemmodify(SmzSspProblemmodify smzSspProblemmodify);
|
||||
|
||||
/**
|
||||
* 修改安全隐患整改
|
||||
* 修改隐患问题
|
||||
*
|
||||
* @param smzSspProblemmodify 安全隐患整改
|
||||
* @param smzSspProblemmodify 隐患问题
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSmzSspProblemmodify(SmzSspProblemmodify smzSspProblemmodify);
|
||||
|
||||
/**
|
||||
* 批量删除安全隐患整改
|
||||
* 批量删除隐患问题
|
||||
*
|
||||
* @param ids 需要删除的安全隐患整改主键集合
|
||||
* @param ids 需要删除的隐患问题主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmzSspProblemmodifyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除安全隐患整改信息
|
||||
* 删除隐患问题信息
|
||||
*
|
||||
* @param id 安全隐患整改主键
|
||||
* @param id 隐患问题主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSmzSspProblemmodifyById(Long id);
|
||||
|
@ -68,12 +68,19 @@ public interface ISmzSspProblemmodifyService
|
|||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<SmzSspProblemmodify> getListCount(SmzSspProblemmodify where);
|
||||
public List<SmzSspProblemmodify> getListCount(SmzSspProblemmodify where);
|
||||
|
||||
/**
|
||||
* 分组统计
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> getWxListCount(SmzSspProblemmodify where);
|
||||
|
||||
/**
|
||||
* 分组查询 全部数据、待整改、待复检、整改完成、整改超时的数量
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<SmzSspProblemmodify> selectList(SmzSspProblemmodify where);
|
||||
public List<SmzSspProblemmodify> selectList(SmzSspProblemmodify where);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.yanzhu.common.core.enums.IsDelEnums;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.manage.enums.CheckStateEnums;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.manage.mapper.SmzSspProblemmodifyDraftMapper;
|
||||
|
@ -10,7 +15,7 @@ import com.yanzhu.manage.domain.SmzSspProblemmodifyDraft;
|
|||
import com.yanzhu.manage.service.ISmzSspProblemmodifyDraftService;
|
||||
|
||||
/**
|
||||
* 安全问题草稿Service业务层处理
|
||||
* 隐患草稿Service业务层处理
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -22,10 +27,10 @@ public class SmzSspProblemmodifyDraftServiceImpl implements ISmzSspProblemmodify
|
|||
private SmzSspProblemmodifyDraftMapper smzSspProblemmodifyDraftMapper;
|
||||
|
||||
/**
|
||||
* 查询安全问题草稿
|
||||
* 查询隐患草稿
|
||||
*
|
||||
* @param id 安全问题草稿主键
|
||||
* @return 安全问题草稿
|
||||
* @param id 隐患草稿主键
|
||||
* @return 隐患草稿
|
||||
*/
|
||||
@Override
|
||||
public SmzSspProblemmodifyDraft selectSmzSspProblemmodifyDraftById(Long id)
|
||||
|
@ -34,10 +39,10 @@ public class SmzSspProblemmodifyDraftServiceImpl implements ISmzSspProblemmodify
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询安全问题草稿列表
|
||||
* 查询隐患草稿列表
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 安全问题草稿
|
||||
* @return 安全问题草稿
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 隐患草稿
|
||||
*/
|
||||
@Override
|
||||
public List<SmzSspProblemmodifyDraft> selectSmzSspProblemmodifyDraftList(SmzSspProblemmodifyDraft smzSspProblemmodifyDraft)
|
||||
|
@ -46,9 +51,9 @@ public class SmzSspProblemmodifyDraftServiceImpl implements ISmzSspProblemmodify
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增安全问题草稿
|
||||
* 新增隐患草稿
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 安全问题草稿
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -59,9 +64,36 @@ public class SmzSspProblemmodifyDraftServiceImpl implements ISmzSspProblemmodify
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改安全问题草稿
|
||||
* 新增隐患草稿
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 安全问题草稿
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSmzSspProblemmodifyDraftWx(SmzSspProblemmodifyDraft smzSspProblemmodifyDraft){
|
||||
AtomicInteger count = new AtomicInteger();
|
||||
for(List<String> urls:smzSspProblemmodifyDraft.getSmarkUrls()){
|
||||
SmzSspProblemmodifyDraft entity = new SmzSspProblemmodifyDraft();
|
||||
entity.setComId(smzSspProblemmodifyDraft.getComId());
|
||||
entity.setProjectId(smzSspProblemmodifyDraft.getProjectId());
|
||||
entity.setInfoType(smzSspProblemmodifyDraft.getInfoType());
|
||||
entity.setProblemType(smzSspProblemmodifyDraft.getProblemType());
|
||||
entity.setLordSent(smzSspProblemmodifyDraft.getLordSent());
|
||||
entity.setLordSentUser(smzSspProblemmodifyDraft.getLordSentUser());
|
||||
entity.setSmarkUrl(String.join(",", urls));
|
||||
entity.setIsDel(IsDelEnums.NO.getCode());
|
||||
entity.setCheckState(CheckStateEnums.DZG.getCode());
|
||||
entity.setCreateUser(SecurityUtils.getUserId().toString());
|
||||
entity.setCreateTime(new Date());
|
||||
int res = smzSspProblemmodifyDraftMapper.insertSmzSspProblemmodifyDraft(entity);
|
||||
count.addAndGet(res);
|
||||
}
|
||||
return count.intValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改隐患草稿
|
||||
*
|
||||
* @param smzSspProblemmodifyDraft 隐患草稿
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -72,9 +104,9 @@ public class SmzSspProblemmodifyDraftServiceImpl implements ISmzSspProblemmodify
|
|||
}
|
||||
|
||||
/**
|
||||
* 批量删除安全问题草稿
|
||||
* 批量删除隐患草稿
|
||||
*
|
||||
* @param ids 需要删除的安全问题草稿主键
|
||||
* @param ids 需要删除的隐患草稿主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -84,9 +116,9 @@ public class SmzSspProblemmodifyDraftServiceImpl implements ISmzSspProblemmodify
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除安全问题草稿信息
|
||||
* 删除隐患草稿信息
|
||||
*
|
||||
* @param id 安全问题草稿主键
|
||||
* @param id 隐患草稿主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.manage.domain.SmzSspProblemmodify;
|
||||
import com.yanzhu.manage.enums.CheckStateEnums;
|
||||
import com.yanzhu.manage.mapper.SmzSspProblemmodifyMapper;
|
||||
import com.yanzhu.manage.service.ISmzSspProblemmodifyService;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import com.yanzhu.system.api.model.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import com.yanzhu.system.api.model.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.manage.mapper.SmzSspProblemmodifyMapper;
|
||||
import com.yanzhu.manage.domain.SmzSspProblemmodify;
|
||||
import com.yanzhu.manage.service.ISmzSspProblemmodifyService;
|
||||
|
||||
/**
|
||||
* 安全隐患整改Service业务层处理
|
||||
* 隐患问题Service业务层处理
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-02-15
|
||||
|
@ -28,10 +28,10 @@ public class SmzSspProblemmodifyServiceImpl implements ISmzSspProblemmodifyServi
|
|||
private SmzSspProblemmodifyMapper smzSspProblemmodifyMapper;
|
||||
|
||||
/**
|
||||
* 查询安全隐患整改
|
||||
* 查询隐患问题
|
||||
*
|
||||
* @param id 安全隐患整改主键
|
||||
* @return 安全隐患整改
|
||||
* @param id 隐患问题主键
|
||||
* @return 隐患问题
|
||||
*/
|
||||
@Override
|
||||
public SmzSspProblemmodify selectSmzSspProblemmodifyById(Long id)
|
||||
|
@ -40,10 +40,10 @@ public class SmzSspProblemmodifyServiceImpl implements ISmzSspProblemmodifyServi
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询安全隐患整改列表
|
||||
* 查询隐患问题列表
|
||||
*
|
||||
* @param smzSspProblemmodify 安全隐患整改
|
||||
* @return 安全隐患整改
|
||||
* @param smzSspProblemmodify 隐患问题
|
||||
* @return 隐患问题
|
||||
*/
|
||||
@Override
|
||||
public List<SmzSspProblemmodify> selectSmzSspProblemmodifyList(SmzSspProblemmodify smzSspProblemmodify)
|
||||
|
@ -52,37 +52,38 @@ public class SmzSspProblemmodifyServiceImpl implements ISmzSspProblemmodifyServi
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增安全隐患整改
|
||||
* 新增隐患问题
|
||||
*
|
||||
* @param smzSspProblemmodify 安全隐患整改
|
||||
* @param smzSspProblemmodify 隐患问题
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSmzSspProblemmodify(SmzSspProblemmodify smzSspProblemmodify)
|
||||
{
|
||||
smzSspProblemmodify.setCheckState(CheckStateEnums.DZG.getCode());
|
||||
smzSspProblemmodify.setCreateUser(SecurityUtils.getUserId().toString());
|
||||
smzSspProblemmodify.setCreateTime(DateUtils.getNowDate());
|
||||
smzSspProblemmodify.setCreateBy(SecurityContextHolder.getUserName());
|
||||
return smzSspProblemmodifyMapper.insertSmzSspProblemmodify(smzSspProblemmodify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改安全隐患整改
|
||||
* 修改隐患问题
|
||||
*
|
||||
* @param smzSspProblemmodify 安全隐患整改
|
||||
* @param smzSspProblemmodify 隐患问题
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSmzSspProblemmodify(SmzSspProblemmodify smzSspProblemmodify)
|
||||
{
|
||||
smzSspProblemmodify.setUpdateUser(SecurityUtils.getUserId().toString());
|
||||
smzSspProblemmodify.setUpdateTime(DateUtils.getNowDate());
|
||||
smzSspProblemmodify.setUpdateBy(SecurityContextHolder.getUserName());
|
||||
return smzSspProblemmodifyMapper.updateSmzSspProblemmodify(smzSspProblemmodify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除安全隐患整改
|
||||
* 批量删除隐患问题
|
||||
*
|
||||
* @param ids 需要删除的安全隐患整改主键
|
||||
* @param ids 需要删除的隐患问题主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -92,9 +93,9 @@ public class SmzSspProblemmodifyServiceImpl implements ISmzSspProblemmodifyServi
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除安全隐患整改信息
|
||||
* 删除隐患问题信息
|
||||
*
|
||||
* @param id 安全隐患整改主键
|
||||
* @param id 隐患问题主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
@ -130,6 +131,16 @@ public class SmzSspProblemmodifyServiceImpl implements ISmzSspProblemmodifyServi
|
|||
return smzSspProblemmodifyMapper.getListCount(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分组统计
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> getWxListCount(SmzSspProblemmodify where){
|
||||
return smzSspProblemmodifyMapper.getWxListCount(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分组查询 全部数据、待整改、待复检、整改完成、整改超时的数量
|
||||
* @param where
|
||||
|
|
|
@ -5,12 +5,39 @@ import {
|
|||
// 查询隐患列表
|
||||
export function list(query) {
|
||||
return request({
|
||||
url: '/manage/problemmodify/list',
|
||||
url: '/manage/problemmodify/wxList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 统计隐患列表
|
||||
export function listCount(query) {
|
||||
return request({
|
||||
url: '/manage/problemmodify/wxListCount',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增隐患问题
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/manage/problemmodify',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增隐患草稿
|
||||
export function addDraft(data) {
|
||||
return request({
|
||||
url: '/manage/problemmodifyDraft/addDraft',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询我上次提交的隐患信息
|
||||
export function findMyLastProblemmodify(proId,type) {
|
||||
return request({
|
||||
|
|
|
@ -1551,7 +1551,7 @@ swiper-item video {
|
|||
}
|
||||
|
||||
.module_title_padding {
|
||||
padding: 30rpx 0 30rpx 40rpx;
|
||||
padding: 15rpx 0 15rpx 40rpx;
|
||||
border-bottom: 1px solid #303c84;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ page{
|
|||
}
|
||||
.rectifier_list_name{
|
||||
padding-left: 10rpx;
|
||||
color: #6576a2;
|
||||
color: #8499d0;
|
||||
}
|
||||
.rectifier_list_name.active{
|
||||
color: #ffffff;
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
import config from '../../../config'
|
||||
import {
|
||||
getToken,
|
||||
getUserInfo
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
findDictCache
|
||||
} from '../../../api/publics'
|
||||
import {
|
||||
findProjectDeptUsers
|
||||
} from '../../../api/project'
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
findDictCache
|
||||
} from '../../../api/publics'
|
||||
import {
|
||||
findProjectDeptUsers
|
||||
} from '../../../api/project'
|
||||
import {
|
||||
add,
|
||||
findMyLastProblemmodify
|
||||
} from '../../../api/problemmodify'
|
||||
const app = getApp()
|
||||
|
@ -19,21 +21,40 @@ Page({
|
|||
*/
|
||||
data: {
|
||||
maxDate: new Date(2088, 1, 1).getTime(),
|
||||
type:"",
|
||||
typeName:"",
|
||||
projectId:"",
|
||||
projectName:"",
|
||||
minDate: new Date().getTime()+(3600*48*1000),
|
||||
type: "",
|
||||
typeName: "",
|
||||
problemTypeList: [],
|
||||
problemSubTypeList: [],
|
||||
imageInfoData: [],
|
||||
form:{
|
||||
infoType:"",
|
||||
problemType:"1",
|
||||
dangerType:null,
|
||||
nickedTime:"",
|
||||
form: {
|
||||
projectId: "",
|
||||
projectName: "",
|
||||
infoType: "",
|
||||
problemType: "1",
|
||||
dangerType: "1",
|
||||
workParts: "",
|
||||
changeInfo: "",
|
||||
nickedTime: "",
|
||||
lordSent: "",
|
||||
lordSentUser: "",
|
||||
recheckSend: "",
|
||||
recheckSendUser: "",
|
||||
copySend: "",
|
||||
copySendUser: ""
|
||||
},
|
||||
active: 0,
|
||||
flowNodes:[{text:'开始'},{text:'提交隐患'},{text:'隐患整改'},{text:'隐患复检'},{text:'结束'}],
|
||||
flowNodes: [{
|
||||
text: '开始'
|
||||
}, {
|
||||
text: '提交隐患'
|
||||
}, {
|
||||
text: '隐患整改'
|
||||
}, {
|
||||
text: '隐患复检'
|
||||
}, {
|
||||
text: '结束'
|
||||
}],
|
||||
lordSentList: [],
|
||||
copySendList: [],
|
||||
checkUserList: [],
|
||||
|
@ -45,20 +66,21 @@ Page({
|
|||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if(!getToken()){
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: '../../login/login',
|
||||
})
|
||||
}
|
||||
const proUserInfo = getUserInfo();
|
||||
this.setData({
|
||||
type:options.type,
|
||||
typeName:options.type==1?"质量":"安全",
|
||||
projectId:app.globalData.useProjectId,
|
||||
projectName:app.globalData.useProjectName,
|
||||
"form.infoType":options.type,
|
||||
"form.recheckSend": proUserInfo.nickName,
|
||||
"form.recheckSendUser": proUserInfo.userId
|
||||
type: options.type,
|
||||
typeName: options.type == 1 ? "质量" : "安全",
|
||||
"form.comId": proUserInfo.projectUserInfo.comId,
|
||||
"form.projectId": app.globalData.useProjectId,
|
||||
"form.projectName": app.globalData.useProjectName,
|
||||
"form.infoType": options.type,
|
||||
"form.recheckSend": proUserInfo.userId,
|
||||
"form.recheckSendUser": proUserInfo.nickName
|
||||
});
|
||||
this.getDictCache();
|
||||
this.getHisInfo(options.type);
|
||||
|
@ -68,7 +90,7 @@ Page({
|
|||
/**
|
||||
* 获取字典缓存数据
|
||||
*/
|
||||
getDictCache(signId) {
|
||||
getDictCache() {
|
||||
// 初始化检查类型
|
||||
findDictCache("ssp_proble_type").then(res => {
|
||||
if (res.code == 200) {
|
||||
|
@ -107,8 +129,8 @@ Page({
|
|||
* 获取项目所有人员,在页面组装数据...
|
||||
*/
|
||||
getProjectUsers() {
|
||||
findProjectDeptUsers(app.globalData.useProjectId).then(res =>{
|
||||
if(res.code==200){
|
||||
findProjectDeptUsers(app.globalData.useProjectId).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
lordSentList: res.data.lordSentList,
|
||||
copySendList: res.data.copySendList,
|
||||
|
@ -116,7 +138,6 @@ Page({
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -125,8 +146,8 @@ Page({
|
|||
* @param {*} type
|
||||
*/
|
||||
getHisInfo(type) {
|
||||
findMyLastProblemmodify(app.globalData.useProjectId,type).then(res => {
|
||||
if(res.code==200 && res.data && res.data.length>0){
|
||||
findMyLastProblemmodify(app.globalData.useProjectId, type).then(res => {
|
||||
if (res.code == 200 && res.data && res.data.length > 0) {
|
||||
this.setData({
|
||||
showHis: true,
|
||||
"form.lordSent": res.data[0].lordSent,
|
||||
|
@ -143,21 +164,21 @@ Page({
|
|||
//隐患描述
|
||||
onInputWorkParts(e) {
|
||||
this.setData({
|
||||
"form.workParts":e.detail.value
|
||||
"form.workParts": e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
//整改要求
|
||||
onInputChangeInfoValue(e) {
|
||||
this.setData({
|
||||
"form.changeInfo":e.detail.value
|
||||
"form.changeInfo": e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
//验收时间
|
||||
onInputTime(e) {
|
||||
this.setData({
|
||||
"form.nickedTime":e.detail
|
||||
"form.nickedTime": e.detail
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -172,8 +193,8 @@ Page({
|
|||
onAddLordSent(e) {
|
||||
if (e.detail.length > 0) {
|
||||
this.setData({
|
||||
lordSent: e.detail[0].userName,
|
||||
lordSentUser: e.detail[0].phoneNumber
|
||||
"form.lordSent": e.detail[0].userId,
|
||||
"form.lordSentUser": e.detail[0].userName
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -181,20 +202,20 @@ Page({
|
|||
//添加抄送人
|
||||
onAddCopySend(e) {
|
||||
if (e.detail.length > 0) {
|
||||
let phoneNumbers = "";
|
||||
let userNames = "";
|
||||
let _userIds = "";
|
||||
let _userNames = "";
|
||||
e.detail.forEach(it => {
|
||||
phoneNumbers += "," + it.phoneNumber;
|
||||
userNames += "," + it.userName;
|
||||
_userIds += "," + it.userId;
|
||||
_userNames += "," + it.userName;
|
||||
});
|
||||
this.setData({
|
||||
copySend: userNames.substring(1),
|
||||
copySendUser: phoneNumbers.substring(1)
|
||||
"form.copySend": _userIds.substring(1),
|
||||
"form.copySendUser": _userNames.substring(1)
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
copySend: "",
|
||||
copySendUser: ""
|
||||
"form.copySend": "",
|
||||
"form.copySendUser": ""
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -203,8 +224,8 @@ Page({
|
|||
onAddRecheckSend(e) {
|
||||
if (e.detail.length > 0) {
|
||||
this.setData({
|
||||
recheckSend: e.detail[0].userName,
|
||||
recheckSendUser: e.detail[0].phoneNumber
|
||||
"form.recheckSend": e.detail[0].userId,
|
||||
"form.recheckSendUser": e.detail[0].userName
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -214,162 +235,82 @@ Page({
|
|||
this.returnToPage()
|
||||
},
|
||||
|
||||
//保存
|
||||
onProblemSubmitSave() {
|
||||
this.setData({
|
||||
loadShow: true
|
||||
})
|
||||
let that = this
|
||||
/**
|
||||
* 数据保存
|
||||
*/
|
||||
submitSave() {
|
||||
let _form = {
|
||||
...this.data.form
|
||||
};
|
||||
let {
|
||||
projectId,
|
||||
projectName,
|
||||
dangerType,
|
||||
lordSent,
|
||||
lordSentUser,
|
||||
copySend,
|
||||
copySendUser,
|
||||
workParts,
|
||||
changeInfo,
|
||||
nickedTime,
|
||||
recheckSend,
|
||||
recheckSendUser,
|
||||
imageInfoData,
|
||||
loginName,
|
||||
problemType,
|
||||
userName
|
||||
} = that.data;
|
||||
imageInfoData
|
||||
} = this.data
|
||||
//数据效验
|
||||
if (projectId == "" || loginName == "") {
|
||||
if (!_form.comId || !_form.projectId) {
|
||||
app.toast("数据异常,请刷新页面重试!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (imageInfoData.length == 0) {
|
||||
app.toast("请上传隐患现场图片!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (problemType == "") {
|
||||
if (!_form.problemType) {
|
||||
app.toast("请选择检查类型!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (dangerType == "") {
|
||||
if (!_form.dangerType) {
|
||||
app.toast("请选择隐患类型!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (workParts == "") {
|
||||
if (!_form.workParts) {
|
||||
app.toast("请填写隐患描述!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (changeInfo == "") {
|
||||
if (!_form.changeInfo) {
|
||||
app.toast("请填写隐患整改要求!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (nickedTime == "") {
|
||||
if (!_form.nickedTime) {
|
||||
app.toast("请选择整改截至时间!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (lordSent == "" || lordSentUser == "") {
|
||||
if (!_form.lordSent || !_form.lordSentUser) {
|
||||
app.toast("请选择整改人!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (recheckSend == "" || recheckSendUser == "") {
|
||||
if (!_form.recheckSend || !_form.recheckSendUser) {
|
||||
app.toast("请选择复检人!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (copySend == "" || copySendUser == "") {
|
||||
if (!_form.copySend || !_form.copySendUser) {
|
||||
app.toast("请选择抄送人!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
let pos = copySend.split(",");
|
||||
pos.forEach(it => {
|
||||
if (it == lordSent) {
|
||||
app.toast("抄送人中不能包含整改人!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
});
|
||||
let fileUrls = [];
|
||||
this.setData({
|
||||
loadShow: true
|
||||
});
|
||||
let that = this;
|
||||
imageInfoData.forEach(async (item) => {
|
||||
let uploadUrl = app.globalData.uploadUrl + '/common/upload'
|
||||
let name = "file"
|
||||
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
|
||||
let obj = await that.syncUploadImage(uploadUrl, item, name);
|
||||
fileUrls.push(obj.data.fileName);
|
||||
let obj = await that.syncUploadImage(item);
|
||||
fileUrls.push(obj.data.data.url);
|
||||
//验证图片上传完毕
|
||||
if (fileUrls.length == imageInfoData.length) {
|
||||
let params = {
|
||||
projectId,
|
||||
infoType: "1",
|
||||
problemArea: projectName,
|
||||
problemType,
|
||||
workParts,
|
||||
changeInfo,
|
||||
lordSent,
|
||||
lordSentUser,
|
||||
copySend,
|
||||
copySendUser,
|
||||
checkState: 0,
|
||||
nickedTime: nickedTime + " 23:59:59",
|
||||
smarkUrl: fileUrls.toString(),
|
||||
createUser: loginName,
|
||||
dangerType,
|
||||
recheckSend,
|
||||
recheckSendUser
|
||||
}
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/addQuality',
|
||||
method: "POST",
|
||||
data: params,
|
||||
header: {
|
||||
"Username": loginName,
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
success(res) {
|
||||
that.setData({
|
||||
_form.smarkUrl = fileUrls.toString();
|
||||
add(_form).then(res => {
|
||||
this.setData({
|
||||
loadShow: false
|
||||
})
|
||||
res = res.data
|
||||
});
|
||||
if (res.code == 200) {
|
||||
app.toast("添加成功!")
|
||||
app.toast("新增数据成功!")
|
||||
setTimeout(() => {
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
}, 200)
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -388,10 +329,46 @@ Page({
|
|||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 这里考虑上传图片异步问题,封装为同步
|
||||
*/
|
||||
syncUploadImage(file) {
|
||||
let _baseUrl = config.baseUrl;
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: _baseUrl + "/file/upload", // 上传的服务器接口地址
|
||||
filePath: file,
|
||||
header: {
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
},
|
||||
name: "file", //上传的所需字段,后端提供
|
||||
formData: {},
|
||||
success: (res) => {
|
||||
// 上传完成操作
|
||||
const data = JSON.parse(res.data)
|
||||
resolve({
|
||||
data: data
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
//上传失败:修改pedding为reject
|
||||
console.log("访问接口失败", err);
|
||||
wx.showToast({
|
||||
title: "网络出错,上传失败",
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
reject(err)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
url: `../list/index?type=${this.data.type}`
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<view class="header_title_row">
|
||||
<van-row>
|
||||
<van-col span="4">
|
||||
<view class="header_img" bindtap="returnToPage"><image src="/images/left.png"></image></view>
|
||||
<view class="header_img" bindtap="returnToPage">
|
||||
<image src="/images/left.png"></image>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="15">
|
||||
<view class="header_name">新增{{typeName}}隐患</view>
|
||||
|
@ -13,8 +15,8 @@
|
|||
<view class="max_content">
|
||||
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
|
||||
<view class="inspect_info">
|
||||
<view class="video_address_min_2">
|
||||
<view>{{projectName}}</view>
|
||||
<view class="module_title_2 module_title_padding">
|
||||
<view>{{form.projectName}}</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="markers inspect_info_title">隐患图片</view>
|
||||
|
@ -25,7 +27,7 @@
|
|||
<view class="inspect_info_list">
|
||||
<view class="markers inspect_info_title">检查类型</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-select columns="{{problemTypeList}}" placeholder="请选择检查类型" bindchange="onSelectProblemType"></voucher-select>
|
||||
<voucher-select columns="{{problemTypeList}}" placeholder="请选择检查类型" bindchange="onSelectProblemType" selectValue="{{form.problemType}}"></voucher-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
|
@ -34,108 +36,58 @@
|
|||
<voucher-select columns="{{problemSubTypeList}}" placeholder="请选择隐患类型" bindchange="onSelectDangerType" selectValue="{{form.dangerType}}"></voucher-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list" >
|
||||
<view class="inspect_info_list">
|
||||
<view class="markers inspect_info_title">隐患描述</view>
|
||||
<view class="inspect_info_content">
|
||||
<textarea class="add_textarea" placeholder="请填写质量隐患描述"
|
||||
placeholder-style="color:#6777aa;" bindinput="onInputWorkParts" maxlength="500"/>
|
||||
<textarea class="add_textarea" placeholder="请填写质量隐患描述(200字内)" placeholder-style="color:#6777aa;" bindinput="onInputWorkParts" maxlength="200" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list" >
|
||||
<view class="inspect_info_list">
|
||||
<view class="markers inspect_info_title">整改要求</view>
|
||||
<view class="inspect_info_content">
|
||||
<textarea class="add_textarea" placeholder="请填写隐患整改要求"
|
||||
placeholder-style="color:#6777aa;" bindinput="onInputChangeInfoValue" maxlength="500"/>
|
||||
<textarea class="add_textarea" placeholder="请填写隐患整改要求(200字内)" placeholder-style="color:#6777aa;" bindinput="onInputChangeInfoValue" maxlength="200" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="markers inspect_info_title">整改截至时间</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-date counts="5" placeholder="请选择整改截至时间" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
|
||||
<voucher-date counts="5" placeholder="请选择整改截至时间" minDate="{{minDate}}" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="markers inspect_info_title">整改人</view>
|
||||
<view class="inspect_info_content">
|
||||
<select-group-person rectifierData="{{lordSentList}}" multiple="{{fales}}" bindselected="onAddLordSent" index="1" title="请选择整改人" choose="{{lordSent}}">
|
||||
<select-group-person rectifierData="{{lordSentList}}" multiple="{{fales}}" bindselected="onAddLordSent" index="1" title="请选择整改人" choose="{{form.lordSentUser}}">
|
||||
</select-group-person>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="markers inspect_info_title">复检人</view>
|
||||
<view class="inspect_info_content">
|
||||
<select-group-person rectifierData="{{checkUserList}}" multiple="{{fales}}" bindselected="onAddRecheckSend" index="2" title="请选择复检人" choose="{{recheckSend}}">
|
||||
<select-group-person rectifierData="{{checkUserList}}" multiple="{{fales}}" bindselected="onAddRecheckSend" index="2" title="请选择复检人" choose="{{form.recheckSendUser}}">
|
||||
</select-group-person>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="markers inspect_info_title">抄送人</view>
|
||||
<view class="inspect_info_content">
|
||||
<select-group-person rectifierData="{{copySendList}}" multiple="{{true}}" bindselected="onAddCopySend" index="3" title="请选择抄送人" choose="{{copySend}}">
|
||||
<select-group-person rectifierData="{{copySendList}}" multiple="{{true}}" bindselected="onAddCopySend" index="3" title="请选择抄送人" choose="{{form.copySendUser}}">
|
||||
</select-group-person>
|
||||
</view>
|
||||
</view>
|
||||
<view class="safety_inspect_title module_title_flex" wx:if="{{showHis}}">
|
||||
<text class="color_orange">已自动填充上次隐患的整改人,复检人,抄送人。</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="problem_submit_to">
|
||||
</view>
|
||||
<view class="problem_submit_to">
|
||||
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
|
||||
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onProblemSubmitSave">提交隐患</view>
|
||||
</view>
|
||||
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSave">提交隐患</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<van-overlay show="{{loadShow}}">
|
||||
<view class="gif">
|
||||
<image src="/../images/loding2.gif"></image>
|
||||
<view>数据上传中!请稍后...</view>
|
||||
<image src="/images/loding.gif"></image>
|
||||
<view>数据处理中!请稍后...</view>
|
||||
</view>
|
||||
</van-overlay>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -16,10 +16,3 @@
|
|||
.van-steps--horizontal {
|
||||
padding: 10px 20px !important;
|
||||
}
|
||||
|
||||
.video_address_min_2 {
|
||||
background: url("http://fileimg.makalu.cc/CORE_B1C818B4CF2C44FE9D96624589329EBC.png") no-repeat left/40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
padding-left: 40rpx;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
import config from '../../../config'
|
||||
import {
|
||||
getToken,
|
||||
getUserInfo
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
findDictCache
|
||||
} from '../../../api/publics'
|
||||
import {
|
||||
findProjectDeptUsers
|
||||
} from '../../../api/project'
|
||||
import {
|
||||
addDraft,
|
||||
findMyLastProblemmodify
|
||||
} from '../../../api/problemmodify'
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
|
@ -5,20 +20,18 @@ Page({
|
|||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
maxDate: new Date(2088, 1, 1).getTime(),
|
||||
minDate: new Date().getTime() + (3600 * 48 * 1000),
|
||||
type: "",
|
||||
typeName: "",
|
||||
problemTypeList: [],
|
||||
form: {
|
||||
projectId: "",
|
||||
projectName: "",
|
||||
loginName: "",
|
||||
userName: "",
|
||||
rectifierData: [],
|
||||
loadShow: false,
|
||||
showHis: false,
|
||||
inspectInfoData: [{
|
||||
image_upload: []
|
||||
}],
|
||||
infoType: "",
|
||||
problemType: "1",
|
||||
lordSent: "",
|
||||
lordSentUser: "",
|
||||
},
|
||||
active: 0,
|
||||
flowNodes: [{
|
||||
text: '开始'
|
||||
}, {
|
||||
|
@ -30,14 +43,11 @@ Page({
|
|||
}, {
|
||||
text: '结束'
|
||||
}],
|
||||
active: 0,
|
||||
problemType: "1",
|
||||
problemTypeList: [{
|
||||
id: 1,
|
||||
text: '常规检查'
|
||||
}, {
|
||||
id: 2,
|
||||
text: '专项检查'
|
||||
lordSentList: [],
|
||||
loadShow: false,
|
||||
showHis: false,
|
||||
inspectInfoData: [{
|
||||
image_upload: []
|
||||
}]
|
||||
},
|
||||
|
||||
|
@ -45,74 +55,78 @@ Page({
|
|||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
//获取缓存数据
|
||||
wx.getStorage({
|
||||
key: 'userinfo',
|
||||
success: res => {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: '../../login/login',
|
||||
})
|
||||
}
|
||||
const proUserInfo = getUserInfo();
|
||||
this.setData({
|
||||
projectId: app.globalData.projectId,
|
||||
projectName: app.globalData.projectName,
|
||||
loginName: res.data.loginName,
|
||||
userName: res.data.nickName
|
||||
})
|
||||
this.getAllProjectUserData();
|
||||
this.getHisInfo();
|
||||
}
|
||||
})
|
||||
type: options.type,
|
||||
typeName: options.type == 1 ? "质量" : "安全",
|
||||
"form.comId": proUserInfo.projectUserInfo.comId,
|
||||
"form.projectId": app.globalData.useProjectId,
|
||||
"form.projectName": app.globalData.useProjectName,
|
||||
"form.infoType": options.type
|
||||
});
|
||||
this.getDictCache();
|
||||
this.getHisInfo(options.type);
|
||||
this.getProjectUsers();
|
||||
},
|
||||
|
||||
//查询项目人员数据
|
||||
getAllProjectUserData() {
|
||||
let that = this
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl + '/wechat/projectuserinfo/selectProjectUnitUser',
|
||||
method: "get",
|
||||
data: {
|
||||
projectId: that.data.projectId,
|
||||
loginName: that.data.loginName
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
success(res) {
|
||||
res = res.data
|
||||
/**
|
||||
* 获取字典缓存数据
|
||||
*/
|
||||
getDictCache() {
|
||||
// 初始化检查类型
|
||||
findDictCache("ssp_proble_type").then(res => {
|
||||
if (res.code == 200) {
|
||||
that.setData({
|
||||
rectifierData: res.data
|
||||
})
|
||||
let list = [];
|
||||
res.data.forEach(item => {
|
||||
list.push({
|
||||
"id": item.dictValue,
|
||||
"text": item.dictLabel
|
||||
});
|
||||
});
|
||||
this.setData({
|
||||
problemTypeList: list
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
getHisInfo() {
|
||||
//这里查询当前登录人上次提交隐患,自动填充整改人,复检人,抄送人
|
||||
let that = this
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/findDraftLastDataByParams',
|
||||
method: "get",
|
||||
data: {
|
||||
projectId: that.data.projectId,
|
||||
createUser: that.data.loginName,
|
||||
infoType: 1
|
||||
/**
|
||||
* 查询项目人员数据
|
||||
* 获取项目所有人员,在页面组装数据...
|
||||
*/
|
||||
getProjectUsers() {
|
||||
findProjectDeptUsers(app.globalData.useProjectId).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
lordSentList: res.data.lordSentList
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
success(res) {
|
||||
res = res.data
|
||||
if (res.code == 200 && res.data) {
|
||||
that.setData({
|
||||
|
||||
/**
|
||||
* 这里查询当前登录人上次提交隐患
|
||||
* 自动填充整改人,复检人,抄送人
|
||||
* @param {*} type
|
||||
*/
|
||||
getHisInfo(type) {
|
||||
findMyLastProblemmodify(app.globalData.useProjectId, type).then(res => {
|
||||
if (res.code == 200 && res.data && res.data.length > 0) {
|
||||
this.setData({
|
||||
showHis: true,
|
||||
lordSent: res.data.lordSent,
|
||||
lordSentUser: res.data.lordSentUser
|
||||
"form.lordSent": res.data[0].lordSent,
|
||||
"form.lordSentUser": res.data[0].lordSentUser
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
// list 上传图片
|
||||
// 上传图片
|
||||
onImagesArr(e) {
|
||||
var index = e.currentTarget.dataset.index
|
||||
var data = this.data.inspectInfoData
|
||||
|
@ -126,108 +140,77 @@ Page({
|
|||
onAddLordSent(e) {
|
||||
if (e.detail.length > 0) {
|
||||
this.setData({
|
||||
lordSent: e.detail[0].userName,
|
||||
lordSentUser: e.detail[0].phoneNumber
|
||||
"form.lordSent": e.detail[0].userId,
|
||||
"form.lordSentUser": e.detail[0].userName
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//取消页面
|
||||
// 取消页面
|
||||
cancelSaveView() {
|
||||
this.returnToPage()
|
||||
},
|
||||
|
||||
//保存
|
||||
onProblemSubmitSave() {
|
||||
// 保存
|
||||
submitSave() {
|
||||
let _form = {
|
||||
...this.data.form
|
||||
};
|
||||
let {
|
||||
inspectInfoData
|
||||
} = this.data
|
||||
//数据效验
|
||||
if (!_form.comId || !_form.projectId) {
|
||||
app.toast("数据异常,请刷新页面重试!");
|
||||
return false;
|
||||
}
|
||||
if (!_form.problemType) {
|
||||
app.toast("请选择检查类型!");
|
||||
return false;
|
||||
}
|
||||
if (!_form.lordSent || !_form.lordSentUser) {
|
||||
app.toast("请选择整改人!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (inspectInfoData.length>0) {
|
||||
for(let i=0;i<inspectInfoData.length;i++){
|
||||
if(inspectInfoData[i].image_upload.length==0){
|
||||
app.toast("请上传问题“"+(i+1)+"”的隐患图片或删除问题项!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
loadShow: true
|
||||
})
|
||||
let that = this
|
||||
let {
|
||||
projectId,
|
||||
projectName,
|
||||
problemType,
|
||||
lordSent,
|
||||
lordSentUser,
|
||||
loginName,
|
||||
inspectInfoData
|
||||
} = that.data;
|
||||
//数据效验
|
||||
if (projectId == "" || loginName == "") {
|
||||
app.toast("数据异常,请刷新页面重试!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (problemType == "") {
|
||||
app.toast("请选择问题类型!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (lordSent == "" || lordSentUser == "") {
|
||||
app.toast("请选择整改人!")
|
||||
that.setData({
|
||||
loadShow: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
let fileUrls = [];
|
||||
let that = this;
|
||||
inspectInfoData.forEach(async (item) => {
|
||||
let beforeCheckUrl = [];
|
||||
item.image_upload.forEach(async (it) => {
|
||||
let uploadUrl = app.globalData.uploadUrl + '/common/upload'
|
||||
let name = "file";
|
||||
item.image_upload.forEach(async (itFile) => {
|
||||
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
|
||||
let obj = await that.syncUploadImage(uploadUrl, it, name);
|
||||
beforeCheckUrl.push(obj.data.fileName);
|
||||
let obj = await that.syncUploadImage(itFile);
|
||||
beforeCheckUrl.push(obj.data.data.url);
|
||||
if (beforeCheckUrl.length >= item.image_upload.length) {
|
||||
fileUrls.push(beforeCheckUrl);
|
||||
}
|
||||
//验证图片上传完毕
|
||||
if (fileUrls.length >= inspectInfoData.length) {
|
||||
let params = {
|
||||
projectId,
|
||||
infoType: "1",
|
||||
problemArea: projectName,
|
||||
problemType,
|
||||
lordSent,
|
||||
lordSentUser,
|
||||
checkState: 0,
|
||||
fileUrls: fileUrls,
|
||||
createUser: loginName
|
||||
}
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/addQualityDraft',
|
||||
method: "POST",
|
||||
data: params,
|
||||
header: {
|
||||
"Username": loginName,
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
success(res) {
|
||||
that.setData({
|
||||
_form.smarkUrls = fileUrls;
|
||||
addDraft(_form).then(res => {
|
||||
this.setData({
|
||||
loadShow: false
|
||||
})
|
||||
res = res.data
|
||||
});
|
||||
if (res.code == 200) {
|
||||
app.toast("添加成功!")
|
||||
app.toast("新增数据成功!")
|
||||
setTimeout(() => {
|
||||
if (wx.getStorageSync('nav-menu') == "list") {
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
})
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: '../../../../pages/quality_manage/index',
|
||||
})
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
|
@ -236,18 +219,18 @@ Page({
|
|||
/**
|
||||
* 这里考虑上传图片异步问题,封装为同步
|
||||
*/
|
||||
syncUploadImage(url, uploadFile, name) {
|
||||
syncUploadImage(file) {
|
||||
let _baseUrl = config.baseUrl;
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url, // 上传的服务器接口地址
|
||||
filePath: uploadFile,
|
||||
url: _baseUrl + "/file/upload", // 上传的服务器接口地址
|
||||
filePath: file,
|
||||
header: {
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
|
||||
},
|
||||
name, //上传的所需字段,后端提供
|
||||
formData: {
|
||||
user: 'test'
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
},
|
||||
name: "file", //上传的所需字段,后端提供
|
||||
formData: {},
|
||||
success: (res) => {
|
||||
// 上传完成操作
|
||||
const data = JSON.parse(res.data)
|
||||
|
@ -275,7 +258,7 @@ Page({
|
|||
*/
|
||||
onSelectProblemType(e) {
|
||||
this.setData({
|
||||
problemType: e.detail.id,
|
||||
"form.problemType": e.detail.id,
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -283,11 +266,11 @@ Page({
|
|||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
if (wx.getStorageSync('nav-menu') == "list") {
|
||||
wx.redirectTo({
|
||||
url: '../list/index',
|
||||
url: `../list/index?type=${this.data.type}`
|
||||
})
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: '../../../../pages/quality_manage/index',
|
||||
url: `../list/index?type=${this.data.type}`
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
"van-steps": "@vant/weapp/steps/index",
|
||||
"van-overlay": "@vant/weapp/overlay/index"
|
||||
},
|
||||
"navigationStyle":"custom"
|
||||
}
|
||||
"navigationStyle": "custom"
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
<view class="header_img" bindtap="returnToPage"><image src="/images/left.png"></image></view>
|
||||
</van-col>
|
||||
<van-col span="15">
|
||||
<view class="header_name">新增质量隐患草稿</view>
|
||||
<view class="header_name">新增{{typeName}}隐患草稿</view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
|
@ -13,19 +13,19 @@
|
|||
<view class="max_content">
|
||||
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
|
||||
<view class="inspect_info ">
|
||||
<view class="module_title_2 module_title_flex">
|
||||
<view>{{projectName}}</view>
|
||||
<view class="module_title_2 module_title_padding">
|
||||
<view>{{form.projectName}}</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">问题类型</view>
|
||||
<view class="markers inspect_info_title">检查类型</view>
|
||||
<view class="inspect_info_content">
|
||||
<voucher-select columns="{{problemTypeList}}" placeholder="请选择问题类型" bindchange="onSelectProblemType" selectValue="{{problemType}}"></voucher-select>
|
||||
<voucher-select columns="{{problemTypeList}}" placeholder="请选择检查类型" bindchange="onSelectProblemType" selectValue="{{form.problemType}}"></voucher-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">整改人员</view>
|
||||
<view class="markers inspect_info_title">整改人员</view>
|
||||
<view class="inspect_info_content">
|
||||
<select-group-person rectifierData="{{rectifierData}}" multiple="{{fales}}" bindselected="onAddLordSent" index="1" title="请选择整改人员" choose="{{lordSent}}">
|
||||
<select-group-person rectifierData="{{lordSentList}}" multiple="{{fales}}" bindselected="onAddLordSent" index="1" title="请选择整改人员" choose="{{form.lordSentUser}}">
|
||||
</select-group-person>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -38,7 +38,7 @@
|
|||
<view class="module_see_info_delete" wx:if="{{index != 0}}" bindtap="onNewIssuesDelete" data-index="{{index}}"><van-icon name="delete" /> 删除</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 20rpx;">检查图片</view>
|
||||
<view class="markers inspect_info_title">隐患图片</view>
|
||||
<view class="problem_list_info_con">
|
||||
<file-uploader bindimages="onImagesArr" data-index="{{index}}" fileUrlArray="{{item.image_upload}}"></file-uploader>
|
||||
</view>
|
||||
|
@ -53,7 +53,7 @@
|
|||
</view>
|
||||
<view class="problem_submit_to">
|
||||
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
|
||||
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onProblemSubmitSave">保存草稿</view>
|
||||
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="submitSave">保存草稿</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
|
@ -4,3 +4,15 @@
|
|||
.van-image__img{
|
||||
border-radius: 10rpx !important;
|
||||
}
|
||||
|
||||
.van-steps {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.van-step--horizontal .van-step__circle-container {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.van-steps--horizontal {
|
||||
padding: 10px 20px !important;
|
||||
}
|
||||
|
|
|
@ -1,33 +1,37 @@
|
|||
import config from '../../../config'
|
||||
import {
|
||||
getToken
|
||||
} from '../../../utils/auth'
|
||||
getToken,
|
||||
getUserInfo
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
list
|
||||
list,
|
||||
listCount
|
||||
} from '../../../api/problemmodify'
|
||||
const app = getApp()
|
||||
Page({
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
type:"",
|
||||
typeName:"",
|
||||
addFlag:true,
|
||||
addDraftFlag:true,
|
||||
projectId:"",
|
||||
projectName:"",
|
||||
type: "",
|
||||
typeName: "",
|
||||
addFlag: false,
|
||||
addDraftFlag: false,
|
||||
projectId: "",
|
||||
projectName: "",
|
||||
initData: {},
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
total:0,
|
||||
listData:[],
|
||||
activeState:"dzg",
|
||||
dzgCount:0,
|
||||
dfjCount:0,
|
||||
yclCount:0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
listData: [],
|
||||
activeState: "dzg",
|
||||
dzgCount: 0,
|
||||
dfjCount: 0,
|
||||
yzgCount: 0,
|
||||
ywcCount: 0,
|
||||
imgBaseUrl: config.baseImgUrl,
|
||||
projectUserInfo: {}
|
||||
},
|
||||
|
||||
//项目切换 返回值
|
||||
|
@ -36,39 +40,47 @@ import {
|
|||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad({type:this.data.type});
|
||||
this.onLoad({
|
||||
type: this.data.type
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if(!getToken()){
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: '../../login/login',
|
||||
})
|
||||
}
|
||||
const proUserInfo = getUserInfo();
|
||||
const _activeState = proUserInfo.projectUserInfo.subDeptType == "1" ? "dfj" : "dzg";
|
||||
this.setData({
|
||||
type:options.type,
|
||||
typeName:options.type==1?"质量":"安全",
|
||||
projectId:app.globalData.useProjectId,
|
||||
projectName:app.globalData.useProjectName,
|
||||
type: options.type,
|
||||
typeName: options.type == 1 ? "质量" : "安全",
|
||||
addFlag: proUserInfo.projectUserInfo.subDeptType == "1",
|
||||
addDraftFlag: proUserInfo.projectUserInfo.subDeptType == "1",
|
||||
activeState: _activeState,
|
||||
projectUserInfo: proUserInfo.projectUserInfo,
|
||||
projectId: app.globalData.useProjectId,
|
||||
projectName: app.globalData.useProjectName,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
listData: [],
|
||||
total: 0
|
||||
});
|
||||
this.getListData();
|
||||
this.getListData(proUserInfo.projectUserInfo, _activeState, options.type);
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加隐患信息
|
||||
*/
|
||||
skipAdd(){
|
||||
skipAdd() {
|
||||
wx.redirectTo({
|
||||
url: `../add/index?type=${this.data.type}`,
|
||||
})
|
||||
|
@ -77,25 +89,30 @@ import {
|
|||
/**
|
||||
* 添加隐患草稿
|
||||
*/
|
||||
skipAddDarft(){
|
||||
skipAddDarft() {
|
||||
wx.redirectTo({
|
||||
url: `../draft/index?type=${this.data.type}`,
|
||||
})
|
||||
},
|
||||
|
||||
getInfo(e){
|
||||
let {id,checkState,lordSentUser,recheckSendUser} = e.currentTarget.dataset.set
|
||||
if((checkState==0 || checkState==3) && lordSentUser==this.data.loginName){
|
||||
getInfo(e) {
|
||||
let {
|
||||
id,
|
||||
checkState,
|
||||
lordSentUser,
|
||||
recheckSendUser
|
||||
} = e.currentTarget.dataset.set
|
||||
if ((checkState == 0 || checkState == 3) && lordSentUser == this.data.loginName) {
|
||||
//整改页面(状态时待整改&&整改人是当前登录人)
|
||||
wx.redirectTo({
|
||||
url: `../modify/index?id=${id}`,
|
||||
})
|
||||
}else if(checkState==1 && recheckSendUser==this.data.loginName){
|
||||
} else if (checkState == 1 && recheckSendUser == this.data.loginName) {
|
||||
//复检页面 (状态时待复检&&复检人是当前登录人)
|
||||
wx.redirectTo({
|
||||
url: `../check/index?id=${id}`,
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${id}`,
|
||||
})
|
||||
|
@ -105,51 +122,25 @@ import {
|
|||
/**
|
||||
* 查询项目质量隐患排查数据
|
||||
*/
|
||||
getListData() {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId" + app.globalData.useProjectId+"&infoType="+this.data.type;
|
||||
list(params).then(res =>{
|
||||
if(res.data == 200){
|
||||
getListData(userInfo, activeState, type) {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&comId=" + userInfo.comId + "&projectId=" + app.globalData.useProjectId + "&infoType=" + type + "&activeTags=" + activeState;
|
||||
list(params).then(res => {
|
||||
if (res.data == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows)
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
queryCount(param){
|
||||
let that = this;
|
||||
//查询统计数量
|
||||
wx.request({
|
||||
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/queryCount',
|
||||
data: param,
|
||||
method: "get",
|
||||
success: function (res) {
|
||||
let sum1=0;
|
||||
let sumfj=0;
|
||||
if(res.data.data.check0){
|
||||
sum1+=res.data.data.check0;
|
||||
}
|
||||
if(res.data.data.check1){
|
||||
sumfj+=res.data.data.check1;
|
||||
}
|
||||
if(res.data.data.check3){
|
||||
sum1+=res.data.data.check3;
|
||||
}
|
||||
let sum4=0;
|
||||
let sum99=0;
|
||||
if(res.data.data.check4){
|
||||
sum4+=res.data.data.check4;
|
||||
}
|
||||
if(res.data.data.check99){
|
||||
sum99+=res.data.data.check99;
|
||||
}
|
||||
that.setData({
|
||||
dzgCount:sum1,
|
||||
dfjCount:sumfj,
|
||||
yclCount:sum4,
|
||||
zgcsCount:sum99
|
||||
});
|
||||
// 统计列表
|
||||
listCount(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
dzgCount: res.data.dzg,
|
||||
dfjCount: res.data.dfj,
|
||||
yzgCount: res.data.yzg,
|
||||
ywcCount: res.data.ywc,
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -157,23 +148,28 @@ import {
|
|||
/**
|
||||
* 标签切换
|
||||
*/
|
||||
trainingTypeJump(e){
|
||||
trainingTypeJump(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let nav = "";
|
||||
if(index == 1){
|
||||
if (index == 1) {
|
||||
nav = 'dzg';
|
||||
}if(index == 2){
|
||||
}
|
||||
if (index == 2) {
|
||||
nav = 'yzg';
|
||||
} else if (index == 3) {
|
||||
nav = 'dfj';
|
||||
}else if(index == 3){
|
||||
nav = 'ycl';
|
||||
} else if (index == 4) {
|
||||
nav = 'dzg';
|
||||
} else if (index == 5) {
|
||||
nav = 'ywc';
|
||||
}
|
||||
this.setData({
|
||||
activeState:nav,
|
||||
activeState: nav,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
listData: [],
|
||||
});
|
||||
this.getListData();
|
||||
this.getListData(this.data.projectUserInfo, nav, this.data.type);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -192,16 +188,16 @@ import {
|
|||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
|
||||
if(wx.getStorageSync('nav-menu')=="gdgn"){
|
||||
if (wx.getStorageSync('nav-menu') == "gdgn") {
|
||||
wx.redirectTo({
|
||||
url: '../../project_more/index',
|
||||
})
|
||||
}else{
|
||||
if(this.data.type==1){
|
||||
} else {
|
||||
if (this.data.type == 1) {
|
||||
wx.redirectTo({
|
||||
url: '../../../../pages/quality_manage/index',
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: '../../../../pages/quality_manage/index',
|
||||
})
|
||||
|
@ -210,7 +206,7 @@ import {
|
|||
},
|
||||
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e){
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.projectId = projectId;
|
||||
|
@ -218,14 +214,14 @@ import {
|
|||
this.onLoad();
|
||||
},
|
||||
|
||||
onScrollToLower(){
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1
|
||||
});
|
||||
this.getListData();
|
||||
}else{
|
||||
this.getListData(this.data.projectUserInfo, this.data.activeState, this.data.type);
|
||||
} else {
|
||||
console.log("已经到底了,没有数据可加载!!!");
|
||||
}
|
||||
},
|
||||
|
@ -264,4 +260,4 @@ import {
|
|||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
})
|
|
@ -14,10 +14,14 @@
|
|||
</view>
|
||||
<scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower">
|
||||
<project-select init="{{initData}}" bindchange="onProjectSelect" id="projectSel"></project-select>
|
||||
<view class="modify_video_nav" style="margin-top: 5rpx;">
|
||||
<view class="{{activeState=='dzg'?'active':''}}" bindtap="trainingTypeJump" data-index="1"><text>整改({{dzgCount}})</text></view>
|
||||
<view class="{{activeState=='dfj'?'active':''}}" bindtap="trainingTypeJump" data-index="2"><text>复检({{dfjCount}})</text></view>
|
||||
<view class="{{activeState=='ycl'?'active':''}}" bindtap="trainingTypeJump" data-index="3"><text>完成({{yclCount}})</text></view>
|
||||
<view wx:if="{{projectUserInfo.subDeptType!='1'}}" class="modify_video_nav" style="margin-top: 5rpx;">
|
||||
<view class="{{activeState=='dzg'?'active':''}}" bindtap="trainingTypeJump" data-index="1"><text>待整改({{dzgCount}})</text></view>
|
||||
<view class="{{activeState=='yzg'?'active':''}}" bindtap="trainingTypeJump" data-index="2"><text>已整改({{yzgCount}})</text></view>
|
||||
</view>
|
||||
<view wx:if="{{projectUserInfo.subDeptType=='1'}}" class="modify_video_nav" style="margin-top: 5rpx;">
|
||||
<view class="{{activeState=='dfj'?'active':''}}" bindtap="trainingTypeJump" data-index="3"><text>待复检({{dfjCount}})</text></view>
|
||||
<view class="{{activeState=='dzg'?'active':''}}" bindtap="trainingTypeJump" data-index="4"><text>待整改({{dzgCount}})</text></view>
|
||||
<view class="{{activeState=='ywc'?'active':''}}" bindtap="trainingTypeJump" data-index="5"><text>已完成({{ywcCount}})</text></view>
|
||||
</view>
|
||||
<view class="inspect_max_scroll">
|
||||
<!--专项检查样式zxjc-->
|
||||
|
@ -32,8 +36,8 @@
|
|||
<view wx:if="{{item.checkState==3}}" class="code_label code_label_red">复检驳回</view>
|
||||
<view wx:if="{{item.checkState==4}}" class="code_label code_label_green">整改完成</view>
|
||||
</view>
|
||||
<text class="timeline_for_state_1" wx:if="{{item.problemType=='1'}}">常规检查</text>
|
||||
<text class="timeline_for_state_2" wx:if="{{item.problemType=='2'}}">专项检查</text>
|
||||
<text class="timeline_for_state_1" wx:if="{{item.problemType!='4'}}">{{item.problemTypeName}}</text>
|
||||
<text class="timeline_for_state_2" wx:if="{{item.problemType=='4'}}">{{item.problemTypeName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_list_info">
|
||||
|
@ -44,7 +48,8 @@
|
|||
<view class="inspect_list_info_data">
|
||||
<view class="inspect_list_info_data_prop color_blue">隐患类型:<text>{{item.dangerTypeName}}</text></view>
|
||||
<view class="inspect_list_info_data_prop">隐患描述:<text>{{item.workParts}}</text></view>
|
||||
<view class="inspect_list_info_data_prop">检查单位:<text>{{item.deptName}}</text></view>
|
||||
<view class="inspect_list_info_data_prop color_orange">整改人:<text>{{item.lordSentUser}}</text></view>
|
||||
<view class="inspect_list_info_data_prop color_blue">复检人:<text>{{item.recheckSendUser}}</text></view>
|
||||
<view class="inspect_list_info_data_prop">检查时间:<text class="color_blue">{{item.createTime}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -135,6 +135,7 @@ Page({
|
|||
}],
|
||||
illnessStatus: '',
|
||||
supIllnessStatus: '',
|
||||
loadShow:false
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1527,6 +1528,9 @@ Page({
|
|||
let subDeptInfos = {
|
||||
..._form.subDeptInfos
|
||||
};
|
||||
this.setData({
|
||||
loadShow: true
|
||||
})
|
||||
let uploadFiles = [];
|
||||
if (_form.businessLicensePath && _form.businessLicensePath.length > 0) {
|
||||
uploadFiles.push({
|
||||
|
@ -1623,13 +1627,9 @@ Page({
|
|||
if (_form.proProjectInfoSubdeptsUsers && _form.proProjectInfoSubdeptsUsers.userInfos) {
|
||||
_form.proProjectInfoSubdeptsUsers.userInfos = JSON.stringify(_form.proProjectInfoSubdeptsUsers.userInfos);
|
||||
}
|
||||
wx.showLoading({
|
||||
mask: true,
|
||||
title: '正在处理'
|
||||
});
|
||||
registerSubDepts(_form).then(res => {
|
||||
wx.hideLoading({
|
||||
success: (r) => {}
|
||||
this.setData({
|
||||
loadShow: false
|
||||
});
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
|
@ -1763,6 +1763,9 @@ Page({
|
|||
let _form = {
|
||||
...this.data.form
|
||||
};
|
||||
this.setData({
|
||||
loadShow: true
|
||||
});
|
||||
let uploadFiles = [];
|
||||
if (_form.cardImgPos && _form.cardImgPos.length > 0) {
|
||||
uploadFiles.push({
|
||||
|
@ -1831,13 +1834,9 @@ Page({
|
|||
userInfos.cardImgPos = _form.cardImgPos;
|
||||
userInfos.cardImgInv = _form.cardImgInv;
|
||||
_form.userInfos = JSON.stringify(userInfos);
|
||||
wx.showLoading({
|
||||
mask: true,
|
||||
title: '正在处理'
|
||||
});
|
||||
registerSubDeptsUsers(_form).then(res => {
|
||||
wx.hideLoading({
|
||||
success: (res) => {}
|
||||
this.setData({
|
||||
loadShow: false
|
||||
});
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
"van-checkbox": "@vant/weapp/checkbox/index",
|
||||
"van-checkbox-group": "@vant/weapp/checkbox-group/index",
|
||||
"van-steps": "@vant/weapp/steps/index",
|
||||
"van-notice-bar": "@vant/weapp/notice-bar/index"
|
||||
"van-notice-bar": "@vant/weapp/notice-bar/index",
|
||||
"van-overlay": "@vant/weapp/overlay/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
|
@ -934,8 +934,15 @@
|
|||
<view class="kaoshimianban_9">
|
||||
<jyq-result wx:if="{{form.approveStatus!='100' && form.approveStatus!='11'}}" iconPath="https://xiangguan.sxyanzhu.com/profile/icon/dd.png" title="信息审核中" description="您的信息已登记完成,相关人员正在审核您的信息,请耐心等待。" actionText="下 载 承 诺 书" bind:action="downloadSignetFiles" />
|
||||
<jyq-result wx:if="{{form.approveStatus=='100'}}" iconPath="https://xiangguan.sxyanzhu.com/profile/icon/cg.png" title="恭喜,审核通过" description="您的信息已登记完成。" actionText="下 载 承 诺 书" bind:action="downloadSignetFiles" descActionText="立 即 登 录" bind:descAction="wxSignLogin" />
|
||||
<jyq-result wx:if="{{busExamInfos.passMark>busExamInfos.userMark}}" iconPath="https://xiangguan.sxyanzhu.com/profile/icon/sb.png" title="很遗憾!审核未通过" description="您的信息已登记完成,但未审核通过。"/>
|
||||
<jyq-result wx:if="{{busExamInfos.passMark>busExamInfos.userMark}}" iconPath="https://xiangguan.sxyanzhu.com/profile/icon/sb.png" title="很遗憾!审核未通过" description="您的信息已登记完成,但未审核通过。" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<van-overlay show="{{loadShow}}">
|
||||
<view class="gif">
|
||||
<image src="/images/loding.gif"></image>
|
||||
<view>数据处理中!请稍后...</view>
|
||||
</view>
|
||||
</van-overlay>
|
Loading…
Reference in New Issue