Compare commits

...

2 Commits

Author SHA1 Message Date
姜玉琦 425eca74a2 Merge branch 'dev_xd' of http://62.234.3.186:3000/jiangyq/YZProjectCloud into dev_xd 2025-03-22 18:49:09 +08:00
姜玉琦 8add9bb887 提交代码 2025-03-22 18:49:00 +08:00
77 changed files with 4671 additions and 331 deletions

View File

@ -14,7 +14,7 @@ public enum UserTypeEnums {
FBLWRY("77", "分包劳务人员","fblwry"),
FBCLRY("76", "分包材料人员","fbclry"),
FBAQRY("75", "分包安全人员","fbaqry"),
JSDWRY("66", "建设单位人员","jsdw"),
JSDWRY("66", "总包单位管理","jsdw"),
JLDWRY("81", "监理单位人员","jldw"),
SGDWRY("82", "施工单位人员","sgdw"),
CLFBRY("83", "材料分包人员","clfb"),

View File

@ -32,6 +32,13 @@ public interface FlowBusinessKeyMapper {
*/
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId);
/**
* Id
* @param businessKey
* @return
*/
public List<Map<String, Object>> selectCommentByBusinessKey(String businessKey);
/**
* Id
* @param procInsId

View File

@ -37,9 +37,12 @@ public class ProProjectInfoSubdeptsGroup extends BaseEntity
private Long subDeptId;
/** 单位类型 */
@Excel(name = "单位类型")
private String subDeptType;
/** 单位类型 */
@Excel(name = "单位类型")
private String subDeptTypeName;
/** 分包单位名称 */
@Excel(name = "分包单位名称")
private String subDeptName;
@ -60,10 +63,18 @@ public class ProProjectInfoSubdeptsGroup extends BaseEntity
@Excel(name = "工种类型")
private String craftType;
/** 工种类型 */
@Excel(name = "工种类型")
private String craftTypeName;
/** 工种岗位 */
@Excel(name = "工种岗位")
private String craftPost;
/** 工种岗位 */
@Excel(name = "工种岗位")
private String craftPostName;
/** 负责人姓名 */
@Excel(name = "负责人姓名")
private String groupLeaderName;
@ -312,6 +323,30 @@ public class ProProjectInfoSubdeptsGroup extends BaseEntity
this.groupLeaderUserInfos = groupLeaderUserInfos;
}
public String getCraftTypeName() {
return craftTypeName;
}
public void setCraftTypeName(String craftTypeName) {
this.craftTypeName = craftTypeName;
}
public String getCraftPostName() {
return craftPostName;
}
public void setCraftPostName(String craftPostName) {
this.craftPostName = craftPostName;
}
public String getSubDeptTypeName() {
return subDeptTypeName;
}
public void setSubDeptTypeName(String subDeptTypeName) {
this.subDeptTypeName = subDeptTypeName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -124,9 +124,42 @@ public interface ProProjectInfoSubdeptsUsersMapper
*/
public int editDefaultProjectById(Long id);
/**
*
* @param userPhone
* @return
*/
public Map<String, Object> findUserPhone(String userPhone);
/**
*
* @param proId
* @param userPhone
* @return
*/
public Map<String, Object> findProUserPhone(@Param("proId")Long proId, @Param("userPhone")String userPhone);
/**
*
* @param oldUserPhone
* @param newUserPhone
* @return
*/
public int updateUserPhone(@Param("oldUserPhone")String oldUserPhone, @Param("newUserPhone")String newUserPhone);
/**
*
* @param oldUserPhone
* @param newUserPhone
* @return
*/
public int updatePhone(@Param("oldUserPhone")String oldUserPhone, @Param("newUserPhone")String newUserPhone);
/**
*
* @param subDeptId
* @param craftPost
* @return
*/
public List<Map<String,Object>> fileGroupLeaderUsers(@Param("subDeptId")Long subDeptId, @Param("craftPost")String craftPost);
}

View File

@ -34,11 +34,16 @@
<!--查询工作流操作日志-->
<select id="selectCommentByProcInsId" parameterType="string" resultType="Map">
select * from vw_flow_comment where procInstId = #{procInstId} order by commentId DESC
select * from vw_flow_comment where procInstId = #{procInstId} order by commentId IS NULL DESC,commentId DESC
</select>
<!--查询工作流操作日志-->
<select id="selectCommentByBusinessKey" parameterType="string" resultType="Map">
select * from vw_flow_comment where procInstId = #{procInstId} order by commentId IS NULL DESC,commentId DESC
</select>
<select id="selectLastCommentByProcInsId" parameterType="string" resultType="Map">
select * from vw_flow_comment where procInstId = #{procInstId} order by commentId DESC limit 1
select * from vw_flow_comment where procInstId = #{procInstId} order by commentId IS NULL DESC,commentId DESC limit 1
</select>
<!--查询工作流携带的参数-->

View File

@ -12,12 +12,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="projectName" column="project_name" />
<result property="subDeptId" column="sub_dept_id" />
<result property="subDeptType" column="sub_dept_type" />
<result property="subDeptTypeName" column="sub_dept_type_name" />
<result property="subDeptName" column="sub_dept_name" />
<result property="subDeptCode" column="sub_dept_code" />
<result property="groupName" column="group_name" />
<result property="groupCode" column="group_code" />
<result property="craftType" column="craft_type" />
<result property="craftTypeName" column="craft_type_name" />
<result property="craftPost" column="craft_post" />
<result property="craftPostName" column="craft_post_name" />
<result property="groupLeaderName" column="group_leader_name" />
<result property="groupLeaderCode" column="group_leader_code" />
<result property="groupLeaderPhone" column="group_leader_phone" />
@ -33,9 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectProProjectInfoSubdeptsGroupVo">
select psg.id, psg.com_id, sd.dept_name as com_name, psg.project_id, pi.project_name, psg.sub_dept_id, psg.sub_dept_type, psg.sub_dept_name, psg.sub_dept_code, psg.group_name, psg.group_code, psg.craft_type, psg.craft_post, psg.group_leader_name, psg.group_leader_code, psg.group_leader_phone, psg.use_status, psg.approve_status, psg.qr_code, psg.is_del, psg.create_by, psg.create_time, psg.update_by, psg.update_time, psg.remark from pro_project_info_subdepts_group psg
select psg.id, psg.com_id, sd.dept_name as com_name, psg.project_id, pi.project_name, psg.sub_dept_id, psg.sub_dept_type, dic0.dict_label as sub_dept_type_name, psg.sub_dept_name, psg.sub_dept_code, psg.group_name, psg.group_code, psg.craft_type, dic1.dict_label as craft_type_name, psg.craft_post, dic2.dict_label as craft_post_name, psg.group_leader_name, psg.group_leader_code, psg.group_leader_phone, psg.use_status, psg.approve_status, psg.qr_code, psg.is_del, psg.create_by, psg.create_time, psg.update_by, psg.update_time, psg.remark from pro_project_info_subdepts_group psg
left join pro_project_info pi on pi.id = psg.project_id
left join sys_dept sd on sd.dept_id = psg.com_id
left join sys_dict_data dic0 on psg.`sub_dept_type`=dic0.`dict_value` and dic0.`dict_type`='sub_dept_type'
left join sys_dict_data dic1 on psg.`craft_type`=dic1.`dict_value` and dic1.`dict_type`='pro_craft_type'
left join sys_dict_data dic2 on psg.`craft_post`=dic2.`dict_value` and dic2.`dict_type`='pro_craft_post'
</sql>
<select id="selectProProjectInfoSubdeptsGroupList" parameterType="ProProjectInfoSubdeptsGroup" resultMap="ProProjectInfoSubdeptsGroupResult">

View File

@ -130,6 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test='activeTags == "finished"'> and psu.approve_status <![CDATA[ >= ]]> 100 and psu.use_status in (0,1)</if>
<if test="isDel != null "> and psu.is_del = #{isDel}</if>
<if test='searchValue == "subUsers"'> and psu.user_post != '66' </if>
<if test='searchValue == "magUsers"'> and psu.user_post = '66' </if>
<if test='searchValue == "sedUsers"'> and psu.sub_dept_type in ('1','4','5') and psu.user_post not in ('4','5') </if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and date(psu.use_date) between #{params.beginTime} and #{params.endTime}</if>
and psu.is_del != 2
@ -389,6 +390,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) as total from sys_user su where (user_name = #{userPhone} or phonenumber = #{userPhone})
</select>
<select id="findProUserPhone" resultType="Map">
select count(1) as total from pro_project_info_subdepts_users where project_id = #{proId} and user_phone = #{userPhone}
</select>
<update id="updateUserPhone">
update sys_user set user_name = #{newUserPhone}, phonenumber = #{newUserPhone} where phonenumber = #{oldUserPhone}
</update>
@ -397,4 +402,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update pro_project_info_subdepts_users set user_phone = #{newUserPhone} where user_phone = #{oldUserPhone}
</update>
<select id="fileGroupLeaderUsers" resultType="Map">
select user_phone as id, user_id as userId, user_name as userName, user_post as userPost, card_code as userCode from pro_project_info_subdepts_users
where sub_dept_id=#{subDeptId} and approve_status <![CDATA[ >= ]]> 100 and use_status = 0 and
(
user_post in (2,6,8)
<if test="craftPost != null and craftPost != ''"> or craft_post = #{craftPost}</if>
)
</select>
</mapper>

View File

@ -132,6 +132,16 @@ public class FlowBusinessKeyController extends BaseController {
return success(flowBusinessKeyService.selectCommentByProcInsId(procInsId));
}
/**
* Id
* @param businessKey
* @return
*/
@GetMapping(value = "/findCommentByBusinessKey/{businessKey}")
public AjaxResult findCommentByBusinessKey(@PathVariable("businessKey") String businessKey) {
return success(flowBusinessKeyService.selectCommentByBusinessKey(businessKey));
}
/**
* Id
* @param procInsId

View File

@ -32,6 +32,13 @@ public interface IFlowBusinessKeyService {
*/
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId);
/**
* Id
* @param businessKey
* @return
*/
public List<Map<String, Object>> selectCommentByBusinessKey(String businessKey);
/**
* Id
* @param procInsId

View File

@ -75,6 +75,16 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
return flowBusinessKeyMapper.selectCommentByProcInsId(procInsId);
}
/**
* Id
* @param businessKey
* @return
*/
@Override
public List<Map<String, Object>> selectCommentByBusinessKey(String businessKey){
return flowBusinessKeyMapper.selectCommentByBusinessKey(businessKey);
}
/**
* Id
* @param procInsId

View File

@ -282,7 +282,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
if (Objects.isNull(task)) {
return startProcessInstance(procDefId,variables);
}
taskService.addComment(taskId, task.getProcessInstanceId(), FlowComment.NORMAL.getType(), userName+"提交流程申请!!");
taskService.addComment(taskId, task.getProcessInstanceId(), FlowComment.NORMAL.getType(), userName+"重新提交流程申请!!");
taskService.complete(task.getId(), variables);
return AjaxResult.success("流程重启成功");
}

View File

@ -1,5 +1,6 @@
package com.yanzhu.manage.controller;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.common.core.utils.poi.ExcelUtil;
import com.yanzhu.common.core.web.controller.BaseController;
import com.yanzhu.common.core.web.domain.AjaxResult;
@ -7,15 +8,15 @@ import com.yanzhu.common.core.web.page.TableDataInfo;
import com.yanzhu.common.log.annotation.Log;
import com.yanzhu.common.log.enums.BusinessType;
import com.yanzhu.common.security.annotation.RequiresPermissions;
import com.yanzhu.manage.domain.ProProjectInfoSubdepts;
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsGroup;
import com.yanzhu.manage.service.IProProjectInfoSubdeptsGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
* Controller
@ -133,6 +134,30 @@ public class ProProjectInfoSubdeptsGroupController extends BaseController
return toAjax(proProjectInfoSubdeptsGroupService.deleteProProjectInfoSubdeptsGroupByIds(ids));
}
/**
*
*/
@GetMapping("/findWxList")
public TableDataInfo findWxList(ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup)
{
startPage();
List<ProProjectInfoSubdeptsGroup> list = proProjectInfoSubdeptsGroupService.selectProProjectInfoSubdeptsGroupList(proProjectInfoSubdeptsGroup);
if(StringUtils.isNotEmpty(list)){
// 根据单位对班组进行分组
Map<String, List<ProProjectInfoSubdeptsGroup>> groupedList = list.stream()
.collect(Collectors.groupingBy(ProProjectInfoSubdeptsGroup::getSubDeptName));
List<Map<String, Object>> dataList = new ArrayList<>();
groupedList.forEach((subDeptName, datas) -> {
Map<String, Object> data = new HashMap<>();
data.put("subDepts",subDeptName);
data.put("groupList",datas);
dataList.add(data);
});
return getDataTable(dataList);
}
return getDataTable(list);
}
/**
*
*/

View File

@ -142,16 +142,16 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
public AjaxResult registerSubDeptsUsers(@RequestBody ProProjectInfoSubdeptsUsers ProProjectInfoSubdeptsUsers)
{
if(Objects.isNull(ProProjectInfoSubdeptsUsers.getId())){
return success(proProjectInfoSubdeptsUsersService.insertProProjectInfoSubdeptsUsersWX(ProProjectInfoSubdeptsUsers,true));
return success(proProjectInfoSubdeptsUsersService.insertProProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers));
}else{
return success(proProjectInfoSubdeptsUsersService.updateProProjectInfoSubdeptsUsersWX(ProProjectInfoSubdeptsUsers,true));
return success(proProjectInfoSubdeptsUsersService.updateProProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers));
}
}
/**
*
* @RequiresPermissions("manage:proProjectInfoSubdeptsUsers:editPhone")
*/
@RequiresPermissions("manage:proProjectInfoSubdeptsUsers:editPhone")
@Log(title = "变更手机号", businessType = BusinessType.UPDATE)
@PostMapping("/editPhone")
public AjaxResult editPhone(@RequestBody ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers)
@ -266,6 +266,22 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
proProjectInfoSubdeptsUsersService.updateApproveStatus(proUserId);
}
/**
*
* @param id
* @param status
* @return
* @RequiresPermissions("manage:proProjectInfoSubdeptsUsers:edit")
*/
@PostMapping("/editUseStatus/{id}")
public AjaxResult editUseStatus(@PathVariable("id") Long id, String status){
try {
return AjaxResult.success(proProjectInfoSubdeptsUsersService.editUseStatus(id,status));
}catch (Exception ex){
return AjaxResult.error(ex.getMessage());
}
}
/**
*
* @param ids
@ -277,16 +293,7 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
public AjaxResult updateEnterState(@RequestBody List<Long> ids,@PathVariable int state){
try {
for (Long id : ids) {
ProProjectInfoSubdeptsUsers user = proProjectInfoSubdeptsUsersService.selectProProjectInfoSubdeptsUsersById(id);
if(Objects.nonNull(user)) {
if (state == 0) {//进场
uniService.syncUserAuthDevice(id);
} else {
uniService.syncUserRevoke(id);
}
user.setUseStatus(Convert.toStr(state));
proProjectInfoSubdeptsUsersService.updateProProjectInfoSubdeptsUsers(user);
}
proProjectInfoSubdeptsUsersService.editUseStatus(id,Convert.toStr(state));
}
return AjaxResult.success();
}catch (Exception ex){
@ -338,6 +345,15 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
return success();
}
/**
*
*/
@GetMapping("/fileGroupLeaderUsers/{subDeptId}")
public AjaxResult fileGroupLeaderUsers(@PathVariable("subDeptId") Long subDeptId,String craftPost)
{
return success(proProjectInfoSubdeptsUsersService.fileGroupLeaderUsers(subDeptId,craftPost));
}
/**
*
*/
@ -472,6 +488,39 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
return success(datas);
}
/**
*
*/
@GetMapping("/findWxList")
public TableDataInfo findWxList(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers)
{
startPage();
List<ProProjectInfoSubdeptsUsers> list = proProjectInfoSubdeptsUsersService.selectProProjectInfoSubdeptsUsersList(proProjectInfoSubdeptsUsers);
if(StringUtils.isNotEmpty(list)){
// 根据单位对班组进行分组
Map<String, List<ProProjectInfoSubdeptsUsers>> deptsedList = list.stream()
.collect(Collectors.groupingBy(ProProjectInfoSubdeptsUsers::getSubDeptName));
List<Map<String, Object>> dataList = new ArrayList<>();
deptsedList.forEach((subDeptName, datas) -> {
Map<String, Object> deptData = new HashMap<>();
deptData.put("subDeptName",subDeptName);
Map<String, List<ProProjectInfoSubdeptsUsers>> groupedList = datas.stream()
.collect(Collectors.groupingBy(ProProjectInfoSubdeptsUsers::getSubDeptGroupName));
List<Map<String, Object>> groupList = new ArrayList<>();
groupedList.forEach((subDeptGroupName, users) -> {
Map<String, Object> groupData = new HashMap<>();
groupData.put("subDeptGroupName",subDeptGroupName);
groupData.put("users",users);
groupList.add(groupData);
});
deptData.put("groups",groupList);
dataList.add(deptData);
});
return getDataTable(dataList);
}
return getDataTable(list);
}
/**
*
*/

View File

@ -71,6 +71,14 @@ public interface IProProjectInfoSubdeptsUsersService
*/
public int updateProProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers);
/**
* /
* @param id
* @param status
* @return
*/
public int editUseStatus(Long id, String status);
/**
*
*
@ -222,4 +230,12 @@ public interface IProProjectInfoSubdeptsUsersService
* @param id
*/
void fileSign(Long id);
/**
*
* @param subDeptId
* @param craftPost
* @return
*/
List<Map<String,Object>> fileGroupLeaderUsers(Long subDeptId,String craftPost);
}

View File

@ -357,16 +357,19 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
oldQuery.setUserPhone(entiry.getGroupLeaderPhone());
List<ProProjectInfoSubdeptsUsers> dataList = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(oldQuery);
ProProjectInfoSubdeptsUsers oldUser = dataList.get(0);
oldUser.setUserPost(UserPostEnums.LWGR.getCode());
oldUser.setQrCode("");
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(oldUser);
try {
SysUser sysUser = new SysUser();
sysUser.setUserName(entiry.getGroupLeaderPhone());
sysUser.setDeptId(proProjectInfoSubdeptsGroup.getProjectId());
remoteUserService.removeUserRoles(sysUser, SecurityConstants.INNER);
}catch (Exception e){
e.printStackTrace();
//旧班组的用户为班组长时才修改...
if(Objects.equals(oldUser.getUserPost(),UserPostEnums.BZZ.getCode())){
oldUser.setUserPost(UserPostEnums.LWGR.getCode());
oldUser.setQrCode("");
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(oldUser);
try {
SysUser sysUser = new SysUser();
sysUser.setUserName(entiry.getGroupLeaderPhone());
sysUser.setDeptId(proProjectInfoSubdeptsGroup.getProjectId());
remoteUserService.removeUserRoles(sysUser, SecurityConstants.INNER);
}catch (Exception e){
e.printStackTrace();
}
}
}
ProProjectInfoSubdeptsUsers query = new ProProjectInfoSubdeptsUsers();
@ -374,47 +377,52 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
query.setSubDeptId(proProjectInfoSubdeptsGroup.getSubDeptId());
query.setUserPhone(proProjectInfoSubdeptsGroup.getGroupLeaderPhone());
List<ProProjectInfoSubdeptsUsers> dataList = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(query);
ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = dataList.get(0);
entiry.setGroupLeaderName(proProjectInfoSubdeptsUsers.getUserName());
entiry.setGroupLeaderCode(proProjectInfoSubdeptsUsers.getCardCode());
entiry.setGroupLeaderPhone(proProjectInfoSubdeptsUsers.getUserPhone());
entiry.setUpdateBy(SecurityUtils.getUsername());
entiry.setUpdateTime(DateUtils.getNowDate());
res = proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(entiry);
if(res > 0){
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.BZZ.getCode());
proProjectInfoSubdeptsUsers.setSubDeptGroup(entiry.getId());
proProjectInfoSubdeptsUsers.setSubDeptGroupName(entiry.getGroupName());
// 设置班组长二维码信息...
try {
//String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath;
// 生成二维码
File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=4&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
FileUtil.copyFile(file,new File(savePath));
proProjectInfoSubdeptsUsers.setQrCode(profilePath);
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
}catch (Exception e){
log.error(e.getMessage());
}
// 修改用户角色信息
try {
SysUser sysUser = new SysUser();
sysUser.setComId(proProjectInfoSubdeptsUsers.getComId());
sysUser.setDeptId(proProjectInfoSubdeptsUsers.getProjectId());
sysUser.setUserName(entiry.getGroupLeaderPhone());
sysUser.setUserType(UserTypeEnums.FBBZZZ.getCode());
sysUser.setNickName(entiry.getGroupLeaderName());
sysUser.setPhonenumber(entiry.getGroupLeaderPhone());
sysUser.setUpdateBy(SecurityUtils.getUsername());
sysUser.setUpdateTime(DateUtils.getNowDate());
sysUser.setRemark(entiry.getSubDeptName());
sysUser.setActiveProjectId(entiry.getProjectId());
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
}catch (Exception e){
e.printStackTrace();
if(StringUtils.isNotEmpty(dataList)){
ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = dataList.get(0);
entiry.setGroupLeaderName(proProjectInfoSubdeptsUsers.getUserName());
entiry.setGroupLeaderCode(proProjectInfoSubdeptsUsers.getCardCode());
entiry.setGroupLeaderPhone(proProjectInfoSubdeptsUsers.getUserPhone());
entiry.setUpdateBy(SecurityUtils.getUsername());
entiry.setUpdateTime(DateUtils.getNowDate());
res = proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(entiry);
if(res > 0){
// 角色冲突...这里只能将劳务人员设置为班组长
if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.LWGR.getCode()) || Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.TSGZ.getCode())){
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.BZZ.getCode());
proProjectInfoSubdeptsUsers.setSubDeptGroup(entiry.getId());
proProjectInfoSubdeptsUsers.setSubDeptGroupName(entiry.getGroupName());
// 设置班组长二维码信息...
try {
//String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath;
// 生成二维码
File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=4&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
FileUtil.copyFile(file,new File(savePath));
proProjectInfoSubdeptsUsers.setQrCode(profilePath);
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
}catch (Exception e){
log.error(e.getMessage());
}
// 修改用户角色信息
try {
SysUser sysUser = new SysUser();
sysUser.setComId(proProjectInfoSubdeptsUsers.getComId());
sysUser.setDeptId(proProjectInfoSubdeptsUsers.getProjectId());
sysUser.setUserName(entiry.getGroupLeaderPhone());
sysUser.setUserType(UserTypeEnums.FBBZZZ.getCode());
sysUser.setNickName(entiry.getGroupLeaderName());
sysUser.setPhonenumber(entiry.getGroupLeaderPhone());
sysUser.setUpdateBy(SecurityUtils.getUsername());
sysUser.setUpdateTime(DateUtils.getNowDate());
sysUser.setRemark(entiry.getSubDeptName());
sysUser.setActiveProjectId(entiry.getProjectId());
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
}catch (Exception e){
e.printStackTrace();
}
}
}
}
}
@ -437,7 +445,17 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
proProjectInfoSubdeptsGroup.setUpdateTime(DateUtils.getNowDate());
// 离场时所有人员全部离场
if(Objects.equals(UseStateEnums.OUT.getCode(), status)){
ProProjectInfoSubdeptsUsers userQuery = new ProProjectInfoSubdeptsUsers();
userQuery.setUseStatus(UseStateEnums.IN.getCode());
userQuery.setSubDeptId(proProjectInfoSubdeptsGroup.getSubDeptId());
userQuery.setSubDeptGroup(proProjectInfoSubdeptsGroup.getId());
List<ProProjectInfoSubdeptsUsers> users = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(userQuery);
proProjectInfoSubdeptsUsersMapper.updateUseStatusByParams(proProjectInfoSubdeptsGroup.getSubDeptId(),proProjectInfoSubdeptsGroup.getId());
if(users.size()>0){
for(ProProjectInfoSubdeptsUsers user:users){
uniService.syncUserRevoke(user.getId());
}
}
}
return proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup);
}else{

View File

@ -250,9 +250,9 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
}
proProjectInfoSubdepts.setComId(info.getComId());
if(Objects.equals(proProjectInfoSubdepts.getSubDeptType(), SubDeptsEnums.ZYFB.getCode()) || Objects.equals(proProjectInfoSubdepts.getSubDeptType(),SubDeptsEnums.LWFB.getCode())){
Map<String, Object> map = proProjectInfoSubdeptsUsersMapper.findUserPhone(proProjectInfoSubdepts.getSubDeptLeaderPhone());
Map<String, Object> map = proProjectInfoSubdeptsUsersMapper.findProUserPhone(info.getId(),proProjectInfoSubdepts.getSubDeptLeaderPhone());
if(Objects.nonNull(map) && Convert.toInt(map.get("total"),0)>0){
throw new ServiceException("手机号码已被注册");
throw new ServiceException("手机号码已存在");
}
// 单位委托人信息
if(StringUtils.isNotEmpty(proProjectInfoSubdepts.getSubDeptLeaderName()) && StringUtils.isNotEmpty(proProjectInfoSubdepts.getSubDeptLeaderCode()) && StringUtils.isNotEmpty(proProjectInfoSubdepts.getSubDeptLeaderPhone())){
@ -554,8 +554,17 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
proProjectInfoSubdepts.setUpdateTime(DateUtils.getNowDate());
// 离场时所有班组/人员全部离场
if(Objects.equals(UseStateEnums.OUT.getCode(), status)){
ProProjectInfoSubdeptsUsers userQuery = new ProProjectInfoSubdeptsUsers();
userQuery.setUseStatus(UseStateEnums.IN.getCode());
userQuery.setSubDeptId(proProjectInfoSubdepts.getId());
List<ProProjectInfoSubdeptsUsers> users = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(userQuery);
proProjectInfoSubdeptsGroupMapper.updateUseStatusByParams(proProjectInfoSubdepts.getId());
proProjectInfoSubdeptsUsersMapper.updateUseStatusByParams(proProjectInfoSubdepts.getId(),null);
if(users.size()>0){
for(ProProjectInfoSubdeptsUsers user:users){
uniService.syncUserRevoke(user.getId());
}
}
}
return proProjectInfoSubdeptsMapper.updateProProjectInfoSubdepts(proProjectInfoSubdepts);
}else{

View File

@ -145,7 +145,14 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
@Override
public int insertProProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers)
{
if(StringUtils.isEmpty(proProjectInfoSubdeptsUsers.getCardType())){
proProjectInfoSubdeptsUsers.setCardType("1");
}
if(StringUtils.isEmpty(proProjectInfoSubdeptsUsers.getUserSex())){
proProjectInfoSubdeptsUsers.setUserSex(StringUtils.judgeGender(proProjectInfoSubdeptsUsers.getCardCode()));
}
proProjectInfoSubdeptsUsers.setUseStatus(UseStateEnums.IN.getCode());
proProjectInfoSubdeptsUsers.setUseDate(DateUtils.getNowDate());
proProjectInfoSubdeptsUsers.setCreateBy(SecurityUtils.getUsername());
proProjectInfoSubdeptsUsers.setCreateTime(DateUtils.getNowDate());
proProjectInfoSubdeptsUsers.setSubStep(2L);
@ -153,6 +160,9 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
// 参建单位信息
ProProjectInfoSubdepts subDepts = proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(proProjectInfoSubdeptsUsers.getSubDeptId());
if(proProjectInfoSubdeptsUsers.getComId()==null){
proProjectInfoSubdeptsUsers.setComId(subDepts.getComId());
}
proProjectInfoSubdeptsUsers.setSubDeptType(subDepts.getSubDeptType());
SysUser sysUser = new SysUser();
@ -181,15 +191,19 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
//判断工种岗位设置用户岗位...PC需要单独设置
if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.WTDL.getCode())){
sysUser.setUserType(UserTypeEnums.FBWTDL.getCode());
proProjectInfoSubdeptsUsers.setCraftType(CraftTypeEnums.GLRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.WTDL.getCode());
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.XMJL.getCode())){
sysUser.setUserType(UserTypeEnums.FBXMJL.getCode());
proProjectInfoSubdeptsUsers.setCraftType(CraftTypeEnums.GLRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.XMJL.getCode());
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.AQZY.getCode())){
sysUser.setUserType(UserTypeEnums.FBAQRY.getCode());
proProjectInfoSubdeptsUsers.setCraftType(CraftTypeEnums.GLRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.AQRY.getCode());
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.CLZY.getCode())){
sysUser.setUserType(UserTypeEnums.FBXMJL.getCode());
proProjectInfoSubdeptsUsers.setCraftType(CraftTypeEnums.GLRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.CLRY.getCode());
}else{
sysUser.setUserType(UserTypeEnums.FBLWRY.getCode());
@ -335,9 +349,9 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
if(Objects.isNull(parUsers)){
throw new ServiceException("用户信息异常...请重新扫码");
}
Map<String, Object> map = proProjectInfoSubdeptsUsersMapper.findUserPhone(proProjectInfoSubdeptsUsers.getUserPhone());
Map<String, Object> map = proProjectInfoSubdeptsUsersMapper.findProUserPhone(parUsers.getProjectId(),proProjectInfoSubdeptsUsers.getUserPhone());
if(Objects.nonNull(map) && Convert.toInt(map.get("total"),0)>0){
throw new ServiceException("手机号码已被注册");
throw new ServiceException("手机号码已存在");
}
proProjectInfoSubdeptsUsers.setComId(parUsers.getComId());
proProjectInfoSubdeptsUsers.setProjectId(parUsers.getProjectId());
@ -620,11 +634,12 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER).getData();
ProProjectInfoSubdeptsUsers old = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(proProjectInfoSubdeptsUsers.getId());
proProjectInfoSubdeptsUsers.setUpdateBy(SecurityUtils.getUsername());
proProjectInfoSubdeptsUsers.setUpdateTime(DateUtils.getNowDate());
proProjectInfoSubdeptsUsers.setUserId(old.getUserId());
proProjectInfoSubdeptsUsers.setQrCode(old.getQrCode());
proProjectInfoSubdeptsUsers.setAdmitGuid(old.getAdmitGuid());
proProjectInfoSubdeptsUsers.setFaceGuid(old.getFaceGuid());
proProjectInfoSubdeptsUsers.setUserId(old.getUserId());
proProjectInfoSubdeptsUsers.setUpdateBy(SecurityUtils.getUsername());
proProjectInfoSubdeptsUsers.setUpdateTime(DateUtils.getNowDate());
/**
* ...
@ -637,34 +652,71 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
if(!Objects.equals(old.getUserPost(),proProjectInfoSubdeptsUsers.getUserPost())){
String userPost = proProjectInfoSubdeptsUsers.getUserPost();
if(Objects.equals(UserPostEnums.WTDL.getCode(),userPost) || Objects.equals(UserPostEnums.XMJL.getCode(),userPost) || Objects.equals(UserPostEnums.BZZ.getCode(),userPost)){
// 生成二维码
try {
String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath;
log.info("accessToken...{}",accessToken);
if(!Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),old.getUserPost()) || StringUtils.isEmpty(proProjectInfoSubdeptsUsers.getQrCode())){
// 生成二维码
if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(), UserPostEnums.WTDL.getCode())){
File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=2&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
FileUtil.copyFile(file,new File(savePath));
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(), UserPostEnums.XMJL.getCode())){
File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=3&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
FileUtil.copyFile(file,new File(savePath));
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(), UserPostEnums.BZZ.getCode())){
File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=4&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
FileUtil.copyFile(file,new File(savePath));
try {
String accessToken = wxMaService.getAccessToken();
String filePath = DateUtils.datePath()+"/"+System.currentTimeMillis()+".png";
String savePath = ProfileConfig.profilePath+"/"+filePath;
String profilePath = ProfileConfig.profile+"/"+filePath;
log.info("accessToken...{}",accessToken);
// 生成二维码
if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(), UserPostEnums.WTDL.getCode())){
File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=2&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
FileUtil.copyFile(file,new File(savePath));
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(), UserPostEnums.XMJL.getCode())){
File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=3&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
FileUtil.copyFile(file,new File(savePath));
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(), UserPostEnums.BZZ.getCode())){
File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=4&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
FileUtil.copyFile(file,new File(savePath));
}
proProjectInfoSubdeptsUsers.setQrCode(profilePath);
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
}catch (Exception e){
log.error(e.getMessage());
}
proProjectInfoSubdeptsUsers.setQrCode(profilePath);
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
}catch (Exception e){
log.error(e.getMessage());
}
}
}
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
}
/**
* /
* @param id
* @param status
* @return
*/
public int editUseStatus(Long id, String status){
ProProjectInfoSubdeptsUsers user = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(id);
if (Objects.equals(UseStateEnums.IN.getCode(),status)) {
//进场
uniService.syncUserAuthDevice(id);
//判断班组是否入场
if(user.getSubDeptGroup()!=null){
ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupById(user.getSubDeptGroup());
if(proProjectInfoSubdeptsGroup!=null && Objects.equals(UseStateEnums.OUT.getCode(),proProjectInfoSubdeptsGroup.getUseStatus())){
proProjectInfoSubdeptsGroup.setUseStatus(status);
proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup);
}
}
//判断班组是否入场
if(user.getSubDeptId()!=null){
ProProjectInfoSubdepts proProjectInfoSubdepts = proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(user.getSubDeptId());
if(proProjectInfoSubdepts!=null && Objects.equals(UseStateEnums.OUT.getCode(),proProjectInfoSubdepts.getUseStatus())){
proProjectInfoSubdepts.setUseStatus(status);
proProjectInfoSubdeptsMapper.updateProProjectInfoSubdepts(proProjectInfoSubdepts);
}
}
} else {
//离场
uniService.syncUserRevoke(id);
}
user.setUseStatus(status);
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(user);
}
/**
*
*
@ -1613,4 +1665,15 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
}
}
/**
*
* @param subDeptId
* @param craftPost
* @return
*/
@Override
public List<Map<String,Object>> fileGroupLeaderUsers(Long subDeptId,String craftPost){
return proProjectInfoSubdeptsUsersMapper.fileGroupLeaderUsers(subDeptId,craftPost);
}
}

View File

@ -345,6 +345,18 @@ public class SysUserController extends BaseController {
return toAjax(userService.insertUser(user));
}
/**
*
*/
@RequiresPermissions("system:user:add")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping("/addUser")
public AjaxResult addUser(@Validated @RequestBody SysUser user) {
user.setCreateBy(SecurityUtils.getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUserWx(user));
}
@GetMapping("/getUserByName/{userName}")
@RequiresPermissions("system:user:query")
public AjaxResult getUserByName(@PathVariable(value = "userName", required = true)String userName) {

View File

@ -149,6 +149,14 @@ public interface ISysUserService
*/
public int insertUser(SysUser user);
/**
*
*
* @param user
* @return
*/
public int insertUserWx(SysUser user);
/**
*
*

View File

@ -418,6 +418,80 @@ public class SysUserServiceImpl implements ISysUserService
return rows;
}
/**
*
*
* @param user
* @return
*/
public int insertUserWx(SysUser user){
// 新增用户信息
int rows=0;
SysUser sysUser = userMapper.selectByPhone(user.getPhonenumber());
if(Objects.nonNull(sysUser)){
// 此电话号码已注册
user.setUserId(sysUser.getUserId());
user.setIsActive(0l);
user.setStatus("0");
SysUserCom comWhere=new SysUserCom();
comWhere.setUserId(sysUser.getUserId());
comWhere.setComId(user.getComId());
List<SysUserCom> userComs= userComMapper.selectUserComs(comWhere);
if(userComs.size()==0){
userMapper.insertUserCom(user);
}
if(StringUtils.isEmpty(sysUser.getUserName())){
sysUser.setUserName(userNameAndCout(sysUser.getNickName()));
}
sysUser.setComId(user.getComId());
sysUser.setDeptId(user.getDeptId());
sysUser.setPhonenumber(user.getPhonenumber());
sysUser.setNickName(user.getNickName());
sysUser.setUpdateBy(user.getUpdateBy());
sysUser.setUpdateTime(user.getUpdateTime());
rows=userMapper.updateUser(sysUser);
userExtService.updateBySysUser(sysUser);
}else{
//此电话号码未注册
if(StringUtils.isEmpty(user.getUserName())){
user.setUserName(userNameAndCout(user.getNickName()));
}
user.setCreateBy(user.getUpdateBy());
user.setCreateTime(user.getUpdateTime());
if(StringUtils.isEmpty(user.getUserType())) {
user.setUserType(UserTypeEnums.XMRY.getCode());
}
rows=userMapper.insertUser(user);
user.setIsActive(1l);
userMapper.insertUserCom(user);
userExtService.updateBySysUser(user);
}
// 新增用户岗位关联
insertUserPost(user);
// 新增用户与角色管理
SysUserRole userRole = new SysUserRole();
userRole.setUserId(user.getUserId());
userRole.setDeptId(user.getDeptId());
userRoleMapper.deleteUserRoleByUserRole(userRole);
List<SysRole> roleList = roleMapper.findDeptRoleListByDeptIdAndKey(user.getDeptId(),UserTypeEnums.JSDWRY.getKeys()+"_"+user.getDeptId());
if(roleList.size()>0){
// 使用 Stream 来提取 roleId 并转换成一个数组
Long[] roleIds = roleList.stream()
.map(SysRole::getRoleId)
.toArray(Long[]::new);
user.setRoleIds(roleIds);
insertUserRole(user);
}
try {
SysDept sysDept = deptMapper.selectDeptById(user.getDeptId());
Map<String, Object> data = packageSubDeptUsers(user, sysDept);
remoteProService.syspushSubDeptsUser(data, SecurityConstants.INNER);
}catch (Exception e){
e.printStackTrace();
}
return rows;
}
/**
*
* @param user

View File

@ -126,7 +126,7 @@ export function subdeptsList(query) {
})
}
// 统计参建单位列表
// 统计参建单位信息
export function subdeptsCount(query) {
return request({
url: '/manage/proProjectInfoSubdepts/findWxCount',
@ -143,3 +143,133 @@ export function registerSubDeptsGL(data) {
data: data
})
}
// 修改参建单位入场状态
export function editSubDeptsUseStatus(id,status) {
return request({
url: '/manage/proProjectInfoSubdepts/editUseStatus/'+id+'?status='+status,
method: 'get'
})
}
// 查询单位班组列表
export function findSubGroupsList(query) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/list',
method: 'get',
params: query
})
}
// 查询单位班组列表
export function subgroupsList(query) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/findWxList',
method: 'get',
params: query
})
}
// 统计单位班组信息
export function subgroupsCount(query) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/findWxCount',
method: 'get',
params: query
})
}
// 查看单位班组详情
export function findSubdeptsGroupById(id) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/'+id,
method: 'get'
})
}
// 修改单位班组入场状态
export function editSubGroupsUseStatus(id,status) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/editUseStatus/'+id+'?status='+status,
method: 'get'
})
}
// 查看可选班组长列表
export function fileGroupLeaderUsers(subDeptId,craftPost) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/fileGroupLeaderUsers/'+subDeptId+'?craftPost='+craftPost,
method: 'get'
})
}
// 确认变更班组长信息
export function updateGroupLeader(data) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/updateGroupLeader',
method: 'post',
data: data
})
}
// 管理人员新增单位班组信息
export function registerSubDeptsGroupGL(data) {
return request({
url: '/manage/proProjectInfoSubdeptsGroup/registerSubDeptsGroup',
method: 'post',
data: data
})
}
// 查询班组人员列表
export function subusersList(query) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findWxList',
method: 'get',
params: query
})
}
// 统计班组人员信息
export function subusersCount(query) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/findWxCount',
method: 'get',
params: query
})
}
// 管理人员新增班组人员信息
export function registerSubUsersGL(data) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/registerSubDeptsUsers',
method: 'post',
data: data
})
}
// 查询班组人员详情
export function findProSubUsersInfoById(id) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/'+id,
method: 'get'
})
}
// 修改班组人员入场状态
export function editSubUsersUseStatus(id,status) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/editUseStatus/'+id+'?status='+status,
method: 'get'
})
}
// 修改班组人员手机号码
export function editSubUsersPhone(data) {
return request({
url: '/manage/proProjectInfoSubdeptsUsers/editPhone',
method: 'post',
data: data
})
}

View File

@ -32,7 +32,10 @@
"pages/project_subgroups/info/index",
"pages/project_subusers/list/index",
"pages/project_subusers/add/index",
"pages/project_subusers/info/index"
"pages/project_subusers/info/index",
"pages/project_magusers/list/index",
"pages/project_magusers/add/index",
"pages/project_magusers/info/index"
],
"usingComponents": {
"van-row": "@vant/weapp/row",

View File

@ -1480,6 +1480,10 @@ swiper-item video {
color: #45affb;
}
.color_delete {
color: #ff6d6d;
}
.color_purple {
color: #89a3ee;
}
@ -1934,7 +1938,7 @@ swiper-item video {
}
.code_label_red {
background: red;
background: #ff6d6d;
color: #FFFFFF;
}
@ -2039,3 +2043,14 @@ swiper-item video {
overflow: hidden;
word-break: break-all;
}
.inspect_input_fill_out {
height: 90rpx;
background: #a2303042;
border-radius: 10rpx;
padding: 0 30rpx;
}
.txtb{
font-weight: 600;
}

View File

@ -4,73 +4,84 @@ Component({
* 组件的属性列表
*/
properties: {
columns:{
type:Array
columns: {
type: Array
},
placeholder:{
type:String
placeholder: {
type: String
},
selectValue:{
type:String
selectValue: {
type: String
},
selectIndex:{
type:String
selectIndex: {
type: String
},
background:{
type:String
background: {
type: String
},
value:{
type:String,
value:""
value: {
type: String,
value: ""
}
},
/**数据监听 */
observers: {
columns: function (val) {
if(val.length > 0) {
columns: function (vals) {
if(vals.length>0){
this.setData({
item:val[0],
value:val[0].text
item: []
})
} else {
let _vals = this.data.value;
if(_vals!='' && typeof _vals === 'number'){
for (let i = 0; i < vals.length; i++) {
if (_vals == columns[i].id) {
this.setData({
value: columns[i].text
})
break;
}
}
}
}else{
this.setData({
item:[],
value:''
item: [],
value: ''
})
}
},
selectValue:function(val){
selectValue: function (val) {
let columns = this.data.columns;
if(val && columns){
for(let i=0;i<columns.length;i++){
if(val==columns[i].id){
val=columns[i].text;
if (val && columns) {
for (let i = 0; i < columns.length; i++) {
if (val == columns[i].id) {
val = columns[i].text;
break;
}
}
}
this.setData({
value:val
value: val
})
},
selectIndex:function(val){
selectIndex: function (val) {
this.setData({
index:val
index: val
})
}
},
lifetimes: {
created: function(){
created: function () {
//在组件实例刚刚被创建时执行,注意此时不能调用 setData
},
attached: function () {
//在组件实例进入页面节点树时执行
//在组件实例进入页面节点树时执行
},
ready: function () {
// 在组件在视图层布局完成后执行
// 在组件在视图层布局完成后执行
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
// 在组件实例被从页面节点树移除时执行
},
},
@ -79,11 +90,9 @@ Component({
* 组件的初始数据
*/
data: {
show: false,
item:'',
index:''
item: '',
index: ''
},
/**
@ -91,22 +100,32 @@ Component({
*/
methods: {
showPopup() {
this.setData({ show: true });
this.setData({
show: true
});
},
onClose() {
this.setData({ show: false });
},
onSelectChange(e){
this.setData({
item:e.detail.value
show: false
});
},
onSelectChange(e) {
this.setData({
item: e.detail.value
})
},
onConfirm(){
onConfirm() {
let _item = this.data.item;
if(_item.length==0){
_item = this.data.columns[0];
}
this.setData({
value:this.data.item.text
value: _item.text
})
this.triggerEvent('change',this.data.item)
this.setData({ show: false });
this.triggerEvent('change', _item)
this.setData({
show: false
});
}
}
})

View File

@ -31,7 +31,7 @@ Page({
subDeptInfos: {}
},
subDeptUserData: {
user: {},
userInfos: {},
},
comment: "",
targetKey: "",
@ -47,8 +47,8 @@ Page({
options: options
})
this.findFlowNodes();
this.findCommentByProcInsId();
this.findApplyDataInfo();
this.findCommentByProcInsId();
this.initTargetKeyList();
},
@ -89,7 +89,7 @@ Page({
let list = [];
res.data.forEach((item, idx) => {
if (idx == 1 && (item.commentType == "3" || item.commentType == "2")) {
that.setData({
this.setData({
rejectNode: true
})
}

View File

@ -24,9 +24,9 @@
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
<view class="inspect_list_title_number">{{(flowRecordList.length-index) < 10 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
<text wx:if="{{item.taskName!='提交申请' && item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='委派'}}" class="timeline_for_state_1 color_blue">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='转办'}}" class="timeline_for_state_1 color_blue">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>

View File

@ -26,7 +26,7 @@ Page({
subDeptInfos: {}
},
subDeptUserData: {
user: {},
userInfos: {},
},
stopShow: false,
deleteShow: false,
@ -47,8 +47,8 @@ Page({
options: options
})
this.findFlowNodes();
this.findCommentByProcInsId();
this.findApplyDataInfo();
this.findCommentByProcInsId();
},
//查询工作流节点
@ -90,7 +90,7 @@ Page({
let list = [];
res.data.forEach((item, idx) => {
if (idx == 1 && (item.commentType == "3" || item.commentType == "2")) {
that.setData({
this.setData({
rejectNode: true
})
}

View File

@ -24,9 +24,9 @@
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
<view class="inspect_list_title_number">{{(flowRecordList.length-index) < 10 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
<text wx:if="{{item.taskName!='提交申请' && item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='委派'}}" class="timeline_for_state_1 color_blue">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='转办'}}" class="timeline_for_state_1 color_blue">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>

View File

@ -25,7 +25,7 @@
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
<view class="inspect_list_title_number">{{(flowRecordList.length-index) < 10 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='委派'}}" class="timeline_for_state_1 color_blue">{{item.commentResult}}</text>

View File

@ -0,0 +1,66 @@
// pages/project_magusers/add/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,2 @@
<!--pages/project_magusers/add/index.wxml-->
<text>pages/project_magusers/add/index.wxml</text>

View File

@ -0,0 +1 @@
/* pages/project_magusers/add/index.wxss */

View File

@ -0,0 +1,66 @@
// pages/project_magusers/info/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,2 @@
<!--pages/project_magusers/info/index.wxml-->
<text>pages/project_magusers/info/index.wxml</text>

View File

@ -0,0 +1 @@
/* pages/project_magusers/info/index.wxss */

View File

@ -0,0 +1,228 @@
import {
getToken
} from '../../../utils/auth'
import {
subusersList,
subusersCount
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
addFlag: false,
initData: {},
pageNum: 1,
pageSize: 10000,
total: 0,
listData: [],
activeState: "0",
yrcCount: 0,
ylcCount: 0,
activeName: "0_0",
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../login/login',
})
}
this.setData({
addFlag: true,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
pageNum: 1,
pageSize: 10000,
listData: [],
total: 0
});
//获取数据列表
this.getListData();
this.getListCount();
},
/**
* 添加按钮
*/
skipAdd() {
wx.redirectTo({
url: `../add/index`,
})
},
/**
* 获取详情
* @param {*} e
*/
getInfo(e) {
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../info/index?id=${_id}`,
})
},
/**
* 修改按钮
* @param {*} e
*/
editInfo(e) {
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../add/index?id=${_id}`,
})
},
// 手风琴
onChange(e) {
this.setData({
activeName: e.target.dataset.set
});
},
/**
* 查询数据列表
*/
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished&searchValue=magUsers";
subusersList(params).then(res => {
if (res.code == 200) {
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
},
/**
* 统计数据列表
*/
getListCount() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished&searchValue=subUsers";
subusersCount(params).then(res => {
if (res.code == 200) {
let _yrc = 0,
_ylc = 0;
res.data.forEach(item => {
if (item.useStatus == "0") {
_yrc = item.total;
} else {
_ylc = item.total;
}
});
this.setData({
yrcCount: _yrc,
ylcCount: _ylc
})
}
});
},
/**
* 标签切换
*/
trainJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if (index == 1) {
nav = '0';
} else {
nav = '1';
}
this.setData({
activeState: nav,
pageNum: 1,
pageSize: 10000,
listData: [],
});
this.getListData();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: '../../project_more/index',
})
},
/**
* 滚动到底部
*/
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 {
console.log("已经到底了,没有数据可加载!!!");
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,9 @@
{
"usingComponents": {
"van-collapse": "@vant/weapp/collapse",
"van-collapse-item": "@vant/weapp/collapse-item",
"van-cell-group": "@vant/weapp/cell-group",
"van-cell": "@vant/weapp/cell"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,61 @@
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">班组人员管理</view>
</van-col>
</van-row>
</view>
</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=='0'?'active':''}}" bindtap="trainJump" data-index="1"><text>已入场({{yrcCount}}</text></view>
<view class="{{activeState=='1'?'active':''}}" bindtap="trainJump" data-index="2"><text>已离场({{ylcCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index">
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{index < 10 ?'0'+(index+1):(index+1)}}</view>
<view class="module_title module_title_flex inspect_list_title_text_2 color_orange">
{{item.subDeptName}}
</view>
</view>
</view>
<view class="inspect_list_info">
<van-collapse wx:for="{{item.groups}}" wx:for-item="groupItem" wx:for-index="groupIndex" wx:key="groupIndex" data-set="{{index+'_'+groupIndex}}" value="{{activeName}}" bind:change="onChange" accordion>
<van-collapse-item title="{{groupItem.subDeptGroupName+' ( '+groupItem.users.length+' )'}}" name="{{index+'_'+groupIndex}}" icon="qr">
<van-cell-group style="width: 100%;">
<van-cell wx:for="{{groupItem.users}}" wx:for-item="userItem" wx:for-index="userIndex" wx:key="userIndex" title="{{userItem.userName}}" cell-class="switch-cell" data-set="{{userItem.id}}" bindtap="getInfo" icon="vip-card-o">
<view class="module_see_info_edit" catchtap="editInfo" data-set="{{userItem.id}}">
<van-icon name="edit" /><text class="edit_text">修改</text>
</view>
</van-cell>
</van-cell-group>
</van-collapse-item>
</van-collapse>
</view>
</view>
</view>
<view wx:if="{{listData.length==0}}">
<view style="padding-top: 70px;text-align: -webkit-center;">
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
<view style="color: #a5abbb;">暂无数据</view>
</view>
</view>
<view wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -0,0 +1,19 @@
/* pages/project_subDepts/index.wxss */
.module_see_info_edit {
color: #91ef4a;
font-weight: 600;
}
.module_see_info_edit .edit_text {
padding-left: 10rpx;
}
.van-cell{
color: #89a3ee !important;
background-color: #32374c !important;
}
.van-collapse-item__content{
padding: 0;
background-color: transparent !important;
}

View File

@ -401,6 +401,8 @@ Page({
userRes.data.bankName = userInfosJSON.bankName;
userRes.data.bankOffice = userInfosJSON.bankOffice;
userRes.data.bankCardNo = userInfosJSON.bankCardNo;
userRes.data.cardImgPos = userInfosJSON.cardImgPos;
userRes.data.cardImgInv = userInfosJSON.cardImgInv;
}
if (userRes.data.cardImgPos) {
userRes.data.cardImgPos = (this.data.imgBase + userRes.data.cardImgPos).split(',');

View File

@ -73,13 +73,17 @@
</van-row>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">法定代表人姓名</view>
<view class="markers inspect_info_title">法定代表人姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写法定代表人姓名" placeholder-style="color:#6777aa;" model:value="{{form.subDeptInfos.legalPerson}}" disabled bindinput="inputInfoslegalPerson" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">法定代表人身份证号</view>
<view class="markers inspect_info_title">法定代表人身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写法定代表人身份证号" placeholder-style="color:#6777aa;" model:value="{{form.subDeptInfos.legalPersonCard}}" disabled bindinput="inputInfoslegalPersonCard" class="inspect_input_fill_in" maxlength="30" />
</view>
@ -143,37 +147,49 @@
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">委托代理人姓名</view>
<view class="markers inspect_info_title">委托代理人姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人姓名" placeholder-style="color:#6777aa;" model:value="{{form.subDeptLeaderName}}" disabled bindinput="inputLeaderName" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">委托代理人身份证号</view>
<view class="markers inspect_info_title">委托代理人身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人身份证号" placeholder-style="color:#6777aa;" model:value="{{form.subDeptLeaderCode}}" disabled bindinput="inputLeaderCode" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">委托代理人联系电话</view>
<view class="markers inspect_info_title">委托代理人联系电话
<text style="font-size: small; color: #ff711e;">[不可输入,识别登录手机号]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人联系电话" placeholder-style="color:#6777aa;" bindinput="subDeptLeaderPhone" model:value="{{form.subDeptLeaderPhone}}" disabled class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">民族</view>
<view class="markers inspect_info_title">民族
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写民族" placeholder-style="color:#6777aa;" bindinput="inputOriginNation" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nation}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">籍贯</view>
<view class="markers inspect_info_title">籍贯
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写籍贯" placeholder-style="color:#6777aa;" bindinput="inputOriginNative" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nativePlace}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">地址</view>
<view class="markers inspect_info_title">地址
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写地址" placeholder-style="color:#6777aa;" maxlength="64" disabled bindblur="inputOriginAddress" model:value="{{form.address}}" />
</view>
@ -215,9 +231,11 @@
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info">
<view class="inspect_info_list">
<view class="markers inspect_info_title">单位名称</view>
<view class="markers inspect_info_title">单位名称
<text style="font-size: small; color: #ff711e;">[不可修改,扫码识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写单位名称" placeholder-style="color:#6777aa;" model:value="{{parForm.subDeptName}}" class="inspect_input_fill_in" disabled />
<input placeholder="请填写单位名称" placeholder-style="color:#6777aa;" model:value="{{parForm.subDeptName}}" class="inspect_input_fill_out" disabled />
</view>
</view>
<view class="inspect_info_list">
@ -261,37 +279,49 @@
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">项目经理姓名</view>
<view class="markers inspect_info_title">项目经理姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写项目经理姓名" placeholder-style="color:#6777aa;" bindinput="inputUserName" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.userName}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">项目经理身份证号</view>
<view class="markers inspect_info_title">项目经理身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写项目经理身份证号" placeholder-style="color:#6777aa;" bindinput="inputUserCode" disabled class="inspect_input_fill_in" maxlength="30" model:value="{{form.cardCode}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">项目经理联系电话</view>
<view class="markers inspect_info_title">项目经理联系电话
<text style="font-size: small; color: #ff711e;">[不可输入,识别登录手机号]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写项目经理联系电话" placeholder-style="color:#6777aa;" model:value="{{form.userPhone}}" disabled class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">民族</view>
<view class="markers inspect_info_title">民族
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写民族" placeholder-style="color:#6777aa;" bindinput="inputOriginNation" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nation}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">籍贯</view>
<view class="markers inspect_info_title">籍贯
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写籍贯" placeholder-style="color:#6777aa;" bindinput="inputOriginNative" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nativePlace}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">地址</view>
<view class="markers inspect_info_title">地址
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写地址" placeholder-style="color:#6777aa;" maxlength="64" disabled bindblur="inputOriginAddress" model:value="{{form.address}}" />
</view>
@ -333,9 +363,11 @@
<view class="inspect_info">
<van-notice-bar wrapable left-icon="volume" text="红星号为必填项,请上传正确身份证信息。" />
<view class="inspect_info_list">
<view class="markers inspect_info_title">单位名称</view>
<view class="markers inspect_info_title">单位名称
<text style="font-size: small; color: #ff711e;">[不可修改,扫码识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写单位名称" placeholder-style="color:#6777aa;" model:value="{{parForm.subDeptName}}" class="inspect_input_fill_in" disabled />
<input placeholder="请填写单位名称" placeholder-style="color:#6777aa;" model:value="{{parForm.subDeptName}}" class="inspect_input_fill_out" disabled />
</view>
</view>
<view class="inspect_info_list">
@ -404,37 +436,49 @@
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">姓名</view>
<view class="markers inspect_info_title">姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写姓名" placeholder-style="color:#6777aa;" bindinput="inputUserName" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.userName}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">身份证号</view>
<view class="markers inspect_info_title">身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写身份证号" placeholder-style="color:#6777aa;" bindinput="inputUserCode" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.cardCode}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">联系电话</view>
<view class="markers inspect_info_title">联系电话
<text style="font-size: small; color: #ff711e;">[不可输入,识别登录手机号]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写联系电话" placeholder-style="color:#6777aa;" model:value="{{form.userPhone}}" disabled class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">民族</view>
<view class="markers inspect_info_title">民族
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写民族" placeholder-style="color:#6777aa;" bindinput="inputOriginNation" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nation}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">籍贯</view>
<view class="markers inspect_info_title">籍贯
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写籍贯" placeholder-style="color:#6777aa;" bindinput="inputOriginNative" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nativePlace}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">地址</view>
<view class="markers inspect_info_title">地址
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写地址" placeholder-style="color:#6777aa;" maxlength="64" disabled bindblur="inputOriginAddress" model:value="{{form.address}}" />
</view>
@ -496,21 +540,27 @@
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info">
<view class="inspect_info_list">
<view class="markers inspect_info_title">单位名称</view>
<view class="markers inspect_info_title">单位名称
<text style="font-size: small; color: #ff711e;">[不可修改,扫码识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写单位名称" placeholder-style="color:#6777aa;" model:value="{{parForm.subDeptName}}" class="inspect_input_fill_in" disabled maxlength="30" disabled />
<input placeholder="请填写单位名称" placeholder-style="color:#6777aa;" model:value="{{parForm.subDeptName}}" class="inspect_input_fill_out" disabled />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">班组名称</view>
<view class="markers inspect_info_title">班组名称
<text style="font-size: small; color: #ff711e;">[不可修改,扫码识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写班组名称" placeholder-style="color:#6777aa;" model:value="{{parForm.subDeptGroupName}}" class="inspect_input_fill_in" disabled maxlength="30" />
<input placeholder="请填写班组名称" placeholder-style="color:#6777aa;" model:value="{{parForm.subDeptGroupName}}" class="inspect_input_fill_out" disabled />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">班组长姓名</view>
<view class="markers inspect_info_title">班组长姓名
<text style="font-size: small; color: #ff711e;">[不可修改,扫码识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写班组长姓名" placeholder-style="color:#6777aa;" model:value="{{parForm.userName}}" class="inspect_input_fill_in" disabled maxlength="30" />
<input placeholder="请填写班组长姓名" placeholder-style="color:#6777aa;" model:value="{{parForm.userName}}" class="inspect_input_fill_out" disabled />
</view>
</view>
<view class="inspect_info_list">
@ -540,37 +590,49 @@
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">姓名</view>
<view class="markers inspect_info_title">姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写姓名" placeholder-style="color:#6777aa;" bindinput="inputUserName" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.userName}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">身份证号</view>
<view class="markers inspect_info_title">身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写身份证号" placeholder-style="color:#6777aa;" bindinput="inputUserCode" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.cardCode}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">联系电话</view>
<view class="markers inspect_info_title">联系电话
<text style="font-size: small; color: #ff711e;">[不可输入,识别登录手机号]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写联系电话" placeholder-style="color:#6777aa;" model:value="{{form.userPhone}}" disabled class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">民族</view>
<view class="markers inspect_info_title">民族
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写民族" placeholder-style="color:#6777aa;" bindinput="inputOriginNation" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nation}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">籍贯</view>
<view class="markers inspect_info_title">籍贯
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写籍贯" placeholder-style="color:#6777aa;" bindinput="inputOriginNative" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nativePlace}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">地址</view>
<view class="markers inspect_info_title">地址
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写地址" placeholder-style="color:#6777aa;" maxlength="64" disabled bindblur="inputOriginAddress" model:value="{{form.address}}" />
</view>

View File

@ -7,7 +7,8 @@ import {
findCardOcrFront
} from '../../../api/publics'
import {
registerSubDeptsGL
registerSubDeptsGL,
findProSubDeptsInfoById
} from '../../../api/project'
const app = getApp()
Page({
@ -53,11 +54,9 @@ Page({
flowNodes: [{
text: '信息登记'
}, {
text: '视频学习'
text: '信息审核'
}, {
text: '在线考试'
}, {
text: '文件签署'
text: '单位入场'
}],
loadShow: false,
imgBase: config.baseImgUrl,
@ -72,6 +71,10 @@ Page({
url: '../../../login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
}
this.setData({
"form.projectId": app.globalData.useProjectId,
"form.projectName": app.globalData.useProjectName
@ -117,6 +120,62 @@ Page({
})
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findProSubDeptsInfoById(id).then(deptRes => {
if (deptRes.code == 200 && deptRes.data) {
if (deptRes.data.proProjectInfoSubdeptsUsers) {
deptRes.data.leaderDegreeGrade = deptRes.data.proProjectInfoSubdeptsUsers.degreeGrade;
deptRes.data.eduFilePath = deptRes.data.proProjectInfoSubdeptsUsers.eduFilePath;
deptRes.data.subStep = deptRes.data.proProjectInfoSubdeptsUsers.subStep;
if (deptRes.data.proProjectInfoSubdeptsUsers.userPicture) {
deptRes.data.leaderUserPicture = (this.data.imgBase + deptRes.data.proProjectInfoSubdeptsUsers.userPicture).split(',');
}
if (deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath) {
deptRes.data.subDeptLeaderPowerPath = (this.data.imgBase + deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath).split(',');
}
if (deptRes.data.proProjectInfoSubdeptsUsers.userInfos) {
let userInfosJSON = JSON.parse(deptRes.data.proProjectInfoSubdeptsUsers.userInfos);
if (userInfosJSON.cardImgPos) {
deptRes.data.leaderCardImgPos = (this.data.imgBase + userInfosJSON.cardImgPos).split(',');
}
if (userInfosJSON.cardImgInv) {
deptRes.data.leaderCardImgInv = (this.data.imgBase + userInfosJSON.cardImgInv).split(',');
}
deptRes.data.proProjectInfoSubdeptsUsers.userInfos = userInfosJSON;
deptRes.data.nativePlace = userInfosJSON.nativePlace;
deptRes.data.nation = userInfosJSON.nation;
deptRes.data.address = userInfosJSON.address;
deptRes.data.emergencyContact = userInfosJSON.emergencyContact;
deptRes.data.contactPhone = userInfosJSON.contactPhone;
}
}
if (deptRes.data.businessLicensePath) {
deptRes.data.businessLicensePath = (this.data.imgBase + deptRes.data.businessLicensePath).split(',');
}
if (deptRes.data.subDeptInfos) {
let subDeptInfosJSON = JSON.parse(deptRes.data.subDeptInfos);
deptRes.data.subDeptInfos = subDeptInfosJSON;
if (deptRes.data.subDeptInfos.legalPersonCardImgPos) {
deptRes.data.subDeptInfos.legalPersonCardImgPos = (this.data.imgBase + deptRes.data.subDeptInfos.legalPersonCardImgPos).split(',');
}
if (deptRes.data.subDeptInfos.legalPersonCardImgInv) {
deptRes.data.subDeptInfos.legalPersonCardImgInv = (this.data.imgBase + deptRes.data.subDeptInfos.legalPersonCardImgInv).split(',');
}
}
this.setData({
active: 100,
form: deptRes.data
});
}
});
},
//取消页面
cancelSaveView() {
this.returnToPage()
@ -221,6 +280,12 @@ Page({
if (!form.subDeptLeaderPhone) {
app.toast("请填写委托人联系电话!");
return false;
}else{
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if (!phonePattern.test(form.subDeptLeaderPhone)) {
app.toast("委托人联系电话不正确!");
return false;
}
}
if (!form.nativePlace) {
app.toast("请填写籍贯!");
@ -324,69 +389,98 @@ Page({
}
let that = this;
let uploads = [];
uploadFiles.forEach(async (item) => {
let obj;
if (item.path.indexOf(this.data.imgBase) > -1) {
obj = {
data: {
if (uploadFiles.length > 0) {
uploadFiles.forEach(async (item) => {
let obj;
if (item.path.indexOf(this.data.imgBase) > -1) {
obj = {
data: {
url: item.path.replace(this.data.imgBase, "")
data: {
url: item.path.replace(this.data.imgBase, "")
}
}
}
} else {
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
obj = await that.syncUploadImage(item.path);
}
} else {
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
obj = await that.syncUploadImage(item.path);
}
if (item.type == "businessLicensePath") {
_form.businessLicensePath = obj.data.data.url;
}
if (item.type == "legalPersonCardImgPos") {
subDeptInfos.legalPersonCardImgPos = obj.data.data.url;
}
if (item.type == "legalPersonCardImgInv") {
subDeptInfos.legalPersonCardImgInv = obj.data.data.url;
}
if (item.type == "leaderCardImgPos") {
_form.leaderCardImgPos = obj.data.data.url;
}
if (item.type == "leaderCardImgInv") {
_form.leaderCardImgInv = obj.data.data.url;
}
if (item.type == "leaderUserPicture") {
_form.leaderUserPicture = obj.data.data.url;
}
if (item.type == "subDeptLeaderPowerPath") {
_form.subDeptLeaderPowerPath = obj.data.data.url;
}
uploads.push(obj.data.data.url);
//验证图片上传完毕
if (uploads.length == uploadFiles.length) {
_form.subDeptInfos = JSON.stringify(subDeptInfos);
let leaderUserInfos = {};
leaderUserInfos.nation = _form.nation;
leaderUserInfos.nativePlace = _form.nativePlace;
leaderUserInfos.address = _form.address;
leaderUserInfos.emergencyContact = _form.emergencyContact;
leaderUserInfos.contactPhone = _form.contactPhone;
leaderUserInfos.cardImgPos = _form.leaderCardImgPos;
leaderUserInfos.cardImgInv = _form.leaderCardImgInv;
_form.leaderUserInfos = JSON.stringify(leaderUserInfos);
registerSubDeptsGL(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("新增数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
if (item.type == "businessLicensePath") {
_form.businessLicensePath = obj.data.data.url;
}
if (item.type == "legalPersonCardImgPos") {
subDeptInfos.legalPersonCardImgPos = obj.data.data.url;
}
if (item.type == "legalPersonCardImgInv") {
subDeptInfos.legalPersonCardImgInv = obj.data.data.url;
}
if (item.type == "leaderCardImgPos") {
_form.leaderCardImgPos = obj.data.data.url;
}
if (item.type == "leaderCardImgInv") {
_form.leaderCardImgInv = obj.data.data.url;
}
if (item.type == "leaderUserPicture") {
_form.leaderUserPicture = obj.data.data.url;
}
if (item.type == "subDeptLeaderPowerPath") {
_form.subDeptLeaderPowerPath = obj.data.data.url;
}
uploads.push(obj.data.data.url);
//验证图片上传完毕
if (uploads.length == uploadFiles.length) {
_form.subDeptInfos = JSON.stringify(subDeptInfos);
let leaderUserInfos = {};
leaderUserInfos.nation = _form.nation;
leaderUserInfos.nativePlace = _form.nativePlace;
leaderUserInfos.address = _form.address;
leaderUserInfos.emergencyContact = _form.emergencyContact;
leaderUserInfos.contactPhone = _form.contactPhone;
leaderUserInfos.cardImgPos = _form.leaderCardImgPos;
leaderUserInfos.cardImgInv = _form.leaderCardImgInv;
_form.leaderUserInfos = JSON.stringify(leaderUserInfos);
if (_form.proProjectInfoSubdeptsUsers && _form.proProjectInfoSubdeptsUsers.userInfos) {
_form.proProjectInfoSubdeptsUsers.userInfos = JSON.stringify(_form.proProjectInfoSubdeptsUsers.userInfos);
}
registerSubDeptsGL(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("保存数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
}
});
} else {
_form.subDeptInfos = JSON.stringify(subDeptInfos);
let leaderUserInfos = {};
leaderUserInfos.nation = _form.nation;
leaderUserInfos.nativePlace = _form.nativePlace;
leaderUserInfos.address = _form.address;
leaderUserInfos.emergencyContact = _form.emergencyContact;
leaderUserInfos.contactPhone = _form.contactPhone;
leaderUserInfos.cardImgPos = _form.leaderCardImgPos;
leaderUserInfos.cardImgInv = _form.leaderCardImgInv;
_form.leaderUserInfos = JSON.stringify(leaderUserInfos);
registerSubDeptsGL(_form).then(res => {
this.setData({
loadShow: false
});
}
});
if (res.code == 200) {
app.toast("新增数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
}
},
//选择单位类型
@ -474,6 +568,13 @@ Page({
})
},
/** 合同约定的承包范围 */
inputContractInfos(e) {
this.setData({
"form.contractInfos": e.detail.value
})
},
/** 进入场地时间 */
onInputTime0(e) {
this.setData({
@ -554,7 +655,6 @@ Page({
*/
fileUpload6(options) {
let file = options.detail;
debugger
this.setData({
"form.subDeptLeaderPowerPath": file
});
@ -688,7 +788,7 @@ Page({
returnToPage: function () {
wx.redirectTo({
url: `../list/index?type=${this.data.type}`
url: `../list/index`
})
},

View File

@ -7,7 +7,7 @@
</view>
</van-col>
<van-col span="15">
<view class="header_name">新增参建单位</view>
<view class="header_name">{{form.id?'修改':'新增'}}参建单位</view>
</van-col>
</van-row>
</view>
@ -18,7 +18,15 @@
<view class="module_title_2 module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">单位类型
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写单位类型" placeholder-style="color:#6777aa;" model:value="{{form.subDeptTypeName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">单位类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{subDeptTypeList}}" placeholder="请选择单位企业类型" bindchange="onSubDeptType" selectValue="{{form.subDeptType}}"></voucher-select>
@ -63,13 +71,17 @@
</van-row>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">法定代表人姓名</view>
<view class="markers inspect_info_title">法定代表人姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写法定代表人姓名" placeholder-style="color:#6777aa;" model:value="{{form.subDeptInfos.legalPerson}}" disabled bindinput="inputInfoslegalPerson" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">法定代表人身份证号</view>
<view class="markers inspect_info_title">法定代表人身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写法定代表人身份证号" placeholder-style="color:#6777aa;" model:value="{{form.subDeptInfos.legalPersonCard}}" disabled bindinput="inputInfoslegalPersonCard" class="inspect_input_fill_in" maxlength="30" />
</view>
@ -133,37 +145,55 @@
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">委托代理人姓名</view>
<view class="markers inspect_info_title">委托代理人姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人姓名" placeholder-style="color:#6777aa;" model:value="{{form.subDeptLeaderName}}" disabled bindinput="inputLeaderName" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">委托代理人身份证号</view>
<view class="markers inspect_info_title">委托代理人身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人身份证号" placeholder-style="color:#6777aa;" model:value="{{form.subDeptLeaderCode}}" disabled bindinput="inputLeaderCode" class="inspect_input_fill_in" maxlength="30" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="inspect_info_list" wx:if="{{form.id && (form.subDeptType=='4' || form.subDeptType=='5')}}">
<view class="markers inspect_info_title">委托代理人联系电话
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人联系电话" placeholder-style="color:#6777aa;" model:value="{{form.subDeptLeaderPhone}}" class="inspect_input_fill_out" disabled/>
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id && (form.subDeptType=='4' || form.subDeptType=='5')}}">
<view class="markers inspect_info_title">委托代理人联系电话</view>
<view class="inspect_info_content">
<input placeholder="请填写委托代理人联系电话" placeholder-style="color:#6777aa;" bindinput="subDeptLeaderPhone" model:value="{{form.subDeptLeaderPhone}}" class="inspect_input_fill_in" maxlength="30" />
<input placeholder="请填写委托代理人联系电话" placeholder-style="color:#6777aa;" bindinput="subDeptLeaderPhone" model:value="{{form.subDeptLeaderPhone}}" class="inspect_input_fill_in" maxlength="11" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">民族</view>
<view class="markers inspect_info_title">民族
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写民族" placeholder-style="color:#6777aa;" bindinput="inputOriginNation" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nation}}" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">籍贯</view>
<view class="markers inspect_info_title">籍贯
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写籍贯" placeholder-style="color:#6777aa;" bindinput="inputOriginNative" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nativePlace}}" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptType=='4' || form.subDeptType=='5'}}">
<view class="markers inspect_info_title">地址</view>
<view class="markers inspect_info_title">地址
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写地址" placeholder-style="color:#6777aa;" maxlength="64" disabled bindblur="inputOriginAddress" model:value="{{form.address}}" />
</view>
@ -187,7 +217,7 @@
</view>
</view>
<view class="safety_inspect_title module_title_flex">
<text class="color_orange">添加的单位信息不进入审核流程、添加后立即生效。</text>
<text class="color_orange">{{form.id?'修改':'新增'}}单位信息不进入审核流程、{{form.id?'修改':'新增'}}后立即生效。</text>
</view>
</view>
<view class="problem_submit_to">

View File

@ -1,11 +1,11 @@
.van-steps {
background-color: transparent !important;
}
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -1,18 +1,213 @@
// pages/project_subdepts/info/index.js
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
editSubDeptsUseStatus,
findProSubDeptsInfoById
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 100,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '单位入场'
}],
form: {
subDeptInfos: {}
},
subDeptUserData: {
userInfos: {},
},
imgBaseUrl: config.baseImgUrl
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
}
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findProSubDeptsInfoById(id).then(deptRes => {
if (deptRes.code == 200 && deptRes.data) {
if (deptRes.data.proProjectInfoSubdeptsUsers) {
deptRes.data.leaderDegreeGrade = deptRes.data.proProjectInfoSubdeptsUsers.degreeGrade;
deptRes.data.eduFilePath = deptRes.data.proProjectInfoSubdeptsUsers.eduFilePath;
deptRes.data.subStep = deptRes.data.proProjectInfoSubdeptsUsers.subStep;
if (deptRes.data.proProjectInfoSubdeptsUsers.userPicture) {
deptRes.data.leaderUserPicture = deptRes.data.proProjectInfoSubdeptsUsers.userPicture.split(',');
}
if (deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath) {
deptRes.data.subDeptLeaderPowerPath = deptRes.data.proProjectInfoSubdeptsUsers.subDeptPowerPath.split(',');
}
if (deptRes.data.proProjectInfoSubdeptsUsers.userInfos) {
let userInfosJSON = JSON.parse(deptRes.data.proProjectInfoSubdeptsUsers.userInfos);
if (userInfosJSON.cardImgPos) {
deptRes.data.leaderCardImgPos = userInfosJSON.cardImgPos.split(',');
}
if (userInfosJSON.cardImgInv) {
deptRes.data.leaderCardImgInv = userInfosJSON.cardImgInv.split(',');
}
deptRes.data.proProjectInfoSubdeptsUsers.userInfos = userInfosJSON;
deptRes.data.nativePlace = userInfosJSON.nativePlace;
deptRes.data.nation = userInfosJSON.nation;
deptRes.data.address = userInfosJSON.address;
deptRes.data.emergencyContact = userInfosJSON.emergencyContact;
deptRes.data.contactPhone = userInfosJSON.contactPhone;
}
}
if (deptRes.data.businessLicensePath) {
deptRes.data.businessLicensePath = deptRes.data.businessLicensePath.split(',');
}
if (deptRes.data.subDeptInfos) {
let subDeptInfosJSON = JSON.parse(deptRes.data.subDeptInfos);
deptRes.data.subDeptInfos = subDeptInfosJSON;
if (deptRes.data.subDeptInfos.legalPersonCardImgPos) {
deptRes.data.subDeptInfos.legalPersonCardImgPos = deptRes.data.subDeptInfos.legalPersonCardImgPos.split(',');
}
if (deptRes.data.subDeptInfos.legalPersonCardImgInv) {
deptRes.data.subDeptInfos.legalPersonCardImgInv = deptRes.data.subDeptInfos.legalPersonCardImgInv.split(',');
}
}
let _subDeptUserData = {
userInfos: {}
};
if (deptRes.data.proProjectInfoSubdeptsUsers) {
_subDeptUserData = deptRes.data.proProjectInfoSubdeptsUsers;
}
this.setData({
active: 100,
form: deptRes.data,
subDeptUserData: _subDeptUserData
});
}
});
},
/**
* 返回上页
*/
returnToPage: function () {
wx.redirectTo({
url: `../list/index`
})
},
/**
* 展示图片
* @param {*} e
*/
showImg: function (e) {
let paths = e.target.dataset.set;
let path = [];
paths.split(',').forEach(url => {
path.push(config.baseImgUrl + url);
});
wx.previewImage({
urls: path,
current: path[0]
})
},
/**
* 下载并打开文档
* @param {*} e
*/
downFile: function (e) {
let path = this.data.subDeptUserData.eduFilePath;
wx.downloadFile({
// 示例 url并非真实存在
url: config.baseUrl + '/file/download?fileName=' + path,
header: {
'Authorization': 'Bearer ' + getToken()
},
success: function (res) {
const filePath = res.tempFilePath
let fpt = path.split(".");
wx.openDocument({
filePath: filePath,
fileType: fpt[fpt.length - 1],
success: function (res) {
console.log('打开文档成功')
},
fail: function (res) {
console.log(res)
}
})
}
})
},
/**
* 单位入场
*/
submitSubDeptsIn(){
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认参建单位入场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(0);
}
}
})
},
/**
* 单位离场
*/
submitSubDeptsOut(){
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认参建单位离场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(1);
}
}
})
},
/**
* 表单提交
*/
submitSubDeptsUseStatus(status){
editSubDeptsUseStatus(this.data.form.id,status).then(res =>{
if(res.code==200){
app.toast("操作成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
},
/**

View File

@ -1,3 +1,6 @@
{
"usingComponents": {}
"usingComponents": {
"van-steps": "@vant/weapp/steps/index"
},
"navigationStyle": "custom"
}

View File

@ -1,2 +1,277 @@
<!--pages/project_subdepts/info/index.wxml-->
<text>pages/project_subdepts/info/index.wxml</text>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="16">
<view class="header_name">参建单位详情</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_overview inspect_overview_max">
<view class="module_title module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info">
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位类型</text></van-col>
<van-col span="16" class="color_blue">{{form.subDeptTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位名称</text></van-col>
<van-col span="16">{{form.subDeptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptCode}}">
<van-row>
<van-col span="8"><text class="color_purple">信用代码</text></van-col>
<van-col span="16">{{form.subDeptCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.businessLicensePath}}">
<van-row>
<van-col span="8"><text class="color_purple">营业执照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.businessLicensePath}}" src="{{imgBaseUrl+form.businessLicensePath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptInfos.legalPerson}}">
<van-row>
<van-col span="8"><text class="color_purple">法人姓名</text></van-col>
<van-col span="16">{{form.subDeptInfos.legalPerson}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptInfos.legalPersonCard}}">
<van-row>
<van-col span="8"><text class="color_purple">法人身份证</text></van-col>
<van-col span="16">{{form.subDeptInfos.legalPersonCard}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptInfos.legalPersonCardImgPos && form.subDeptInfos.legalPersonCardImgInv}}">
<van-row>
<van-col span="8"><text class="color_purple">法人证件</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.subDeptInfos.legalPersonCardImgPos}}" src="{{imgBaseUrl+form.subDeptInfos.legalPersonCardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{form.subDeptInfos.legalPersonCardImgInv}}" src="{{imgBaseUrl+form.subDeptInfos.legalPersonCardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.useDates}}">
<van-row>
<van-col span="8"><text class="color_purple">进入场地时间</text></van-col>
<van-col span="16">{{form.useDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.startWorkDates}}">
<van-row>
<van-col span="8"><text class="color_purple">计划开工时间</text></van-col>
<van-col span="16">{{form.startWorkDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.endWorkDates}}">
<van-row>
<van-col span="8"><text class="color_purple">计划完工时间</text></van-col>
<van-col span="16">{{form.endWorkDates}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.contractInfos}}">
<van-row>
<van-col span="8"><text class="color_purple">合同约定范围</text></van-col>
<van-col span="16">{{form.contractInfos}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.cardImgPos && subDeptUserData.userInfos.cardImgInv}}">
<van-row>
<van-col span="8">
<text class="color_purple">代理人证件</text>
</van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.userInfos.cardImgPos}}" src="{{imgBaseUrl+subDeptUserData.userInfos.cardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{subDeptUserData.userInfos.cardImgInv}}" src="{{imgBaseUrl+subDeptUserData.userInfos.cardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userPicture}}">
<van-row>
<van-col span="8"><text class="color_purple">半身近照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.userPicture}}" src="{{imgBaseUrl+subDeptUserData.userPicture+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userName}}">
<van-row>
<van-col span="8">
<text class="color_purple">委托代理人</text>
</van-col>
<van-col span="16">{{subDeptUserData.userName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.cardCode}}">
<van-row>
<van-col span="8">
<text class="color_purple">身份证号码</text>
</van-col>
<van-col span="16">{{subDeptUserData.cardCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.nation}}">
<van-row>
<van-col span="8"><text class="color_purple">民族</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.nation}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.nativePlace}}">
<van-row>
<van-col span="8"><text class="color_purple">籍贯</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.nativePlace}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.address}}">
<van-row>
<van-col span="8"><text class="color_purple">详细地址</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.address}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.subDeptPowerPath}}">
<van-row>
<van-col span="8"><text class="color_purple">单位委托书</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{subDeptUserData.subDeptPowerPath}}" src="{{imgBaseUrl+subDeptUserData.subDeptPowerPath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userPhone}}">
<van-row>
<van-col span="8"><text class="color_purple">联系电话</text></van-col>
<van-col span="16">{{subDeptUserData.userPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.emergencyContact}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系人</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.emergencyContact}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.contactPhone}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系电话</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.contactPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.bankName}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行名称</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.bankOffice}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行网点</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankOffice}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.userInfos.bankCardNo}}">
<van-row>
<van-col span="8"><text class="color_purple">工资银行卡号</text></van-col>
<van-col span="16">{{subDeptUserData.userInfos.bankCardNo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.illnessStatus!=null}}">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">高血压、心脏病等基础身体健康问题
</view>
<view class="inspect_info_content">
<text wx:if="{{subDeptUserData.illnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{subDeptUserData.illnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.supIllnessStatus!=null}}">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">严重呼吸系统疾病、严重心脑血管疾病、肝肾疾病、恶性肿瘤以及药物无法有效控制的高血压和糖尿病等基础性病症状征兆
</view>
<view class="inspect_info_content">
<text wx:if="{{subDeptUserData.supIllnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{subDeptUserData.supIllnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.eduFilePath}}">
<van-row>
<van-col span="8"><text class="color_purple">安全承诺书</text></van-col>
<van-col span="16" class="color_blue">
<view class="files">
<text data-set="{{subDeptUserData.eduFilePath}}" style="word-wrap: break-word;" bindtap='downFile'>点击下载安全承诺书</text>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.useStatus}}">
<van-row>
<van-col span="8"><text class="color_purple">入场状态</text></van-col>
<van-col span="16">
<text wx:if="{{subDeptUserData.useStatus=='0'}}" class="color_blue txtb">已入场</text>
<text wx:if="{{subDeptUserData.useStatus=='1'}}" class="color_delete txtb">已离场</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.approveStatus}}">
<van-row>
<van-col span="8"><text class="color_purple">审批状态</text></van-col>
<van-col span="16">
<text wx:if="{{subDeptUserData.approveStatus==0}}" class="code_label_2 code_label_yellow" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">待提交</text>
<text wx:if="{{subDeptUserData.approveStatus==10}}" class="code_label_2 code_label_blue" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核中</text>
<text wx:if="{{subDeptUserData.approveStatus==11}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核驳回</text>
<text wx:if="{{subDeptUserData.approveStatus==100}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核通过</text>
<text wx:if="{{subDeptUserData.approveStatus==101}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">系统免审</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.createBy}}">
<van-row>
<van-col span="8"><text class="color_purple">数据来源</text></van-col>
<van-col span="16">{{subDeptUserData.createBy}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{subDeptUserData.createTime}}">
<van-row>
<van-col span="8"><text class="color_purple">创建时间</text></van-col>
<van-col span="16">{{subDeptUserData.createTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">返回取消</view>
<view wx:if="{{form.useStatus=='0'}}" class="problem_submit_to_btn problem_submit_to_delete" bindtap="submitSubDeptsOut">单位离场</view>
<view wx:if="{{form.useStatus=='1'}}" class="problem_submit_to_btn problem_submit_to_warning" bindtap="submitSubDeptsIn">单位入场</view>
</view>
</view>

View File

@ -1 +1,11 @@
/* pages/project_subdepts/info/index.wxss */
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -71,11 +71,20 @@ Page({
* @param {*} e
*/
getInfo(e) {
let {
id
} = e.currentTarget.dataset.set
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../info/index&id=${id}`,
url: `../info/index?id=${_id}`,
})
},
/**
* 修改按钮
* @param {*} e
*/
editInfo(e){
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../add/index?id=${_id}`,
})
},

View File

@ -20,14 +20,15 @@
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index" data-set="{{item}}" bindtap="getInfo">
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index" data-set="{{item.id}}" bindtap="getInfo">
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{index < 10 ?'0'+(index+1):(index+1)}}</view>
<view class="module_title module_title_flex inspect_list_title_text color_orange">
<view class="module_title module_title_flex inspect_list_title_text_2 color_orange">
{{item.subDeptTypeName}}
</view>
<view class="module_see_info_edit" catchtap="editInfo" data-set="{{item.id}}"><van-icon name="edit" /><text class="edit_text">修改</text></view>
</view>
</view>
<view class="inspect_list_info">

View File

@ -1 +1,11 @@
/* pages/project_subDepts/index.wxss */
.module_see_info_edit {
padding-left: 10rpx;
color: #91ef4a;
display: flex;
align-items: center;
font-weight: 600;
}
.module_see_info_edit .edit_text{
padding-left: 10rpx;
}

View File

@ -1,20 +1,239 @@
// pages/project_subgroups/add/index.js
import {
getToken
} from '../../../utils/auth'
import {
findDictCache
} from '../../../api/publics'
import {
subdeptsList,
findSubdeptsGroupById,
registerSubDeptsGroupGL
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 0,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '班组入场'
}],
form: {
subDeptId: "",
subDeptType: "",
subDeptName: "",
subDeptCode: "",
groupName: "",
craftType: "1",
craftPost: ""
},
subDeptList: [],
craftPostList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
this.getDictCache(options.id);
this.getAllSubDepts(options.id);
} else {
this.getDictCache(null);
this.getAllSubDepts(null);
}
this.setData({
"form.projectId": app.globalData.useProjectId,
"form.projectName": app.globalData.useProjectName
});
},
/**
* 获取单位
*/
getAllSubDepts(optId) {
let params = "pageNum=1&pageSize=1000&useStatus=0&activeTags=finished&projectId=" + app.globalData.useProjectId;
subdeptsList(params).then(res => {
let list = [];
res.rows.forEach(item => {
list.push({
"id": item.id,
"text": item.subDeptName,
"type": item.subDeptType,
"code": item.subDeptCode,
});
});
this.setData({
subDeptList: list
});
if (!optId) {
this.setData({
"form.subDeptId": list.length > 0 ? list[0].id : null,
"form.subDeptType": list.length > 0 ? list[0].type : null,
"form.subDeptName": list.length > 0 ? list[0].text : null,
"form.subDeptCode": list.length > 0 ? list[0].code : null
});
}
});
},
/**
* 获取字典缓存数据
*/
getDictCache(optId) {
/**
* 初始化工种类型
* (普通工种)
*/
findDictCache("pro_craft_post").then(res => {
if (res.code == 200) {
let list = [];
res.data.forEach(item => {
if (item.cssClass == "1") {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
}
});
this.setData({
craftPostList: list
});
if (!optId) {
this.setData({
"form.craftPost": list[0].id
});
}
}
});
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findSubdeptsGroupById(id).then(res => {
if (res.code == 200) {
this.setData({
active: 100,
form: res.data
});
}
});
},
/**
* 提交班组信息
*/
submitValues() {
let {
form
} = this.data;
//数据效验
if (!form.projectId) {
app.toast("数据异常,请刷新页面重试!")
return false;
}
//数据效验
if (!form.craftPost) {
app.toast("请选择工种类型!");
return false;
}
if (!form.groupName) {
app.toast("请填写班组名称!");
return false;
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认保存单位班组信息?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptForm();
}
}
})
},
/**
* 提交单位班组信息
*/
submitSubDeptForm() {
let _form = {
...this.data.form
};
this.setData({
loadShow: true
})
registerSubDeptsGroupGL(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("保存数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
},
//选择单位
onSubDept(e) {
let _list = this.data.subDeptList;
_list.forEach(item => {
if (item.id == e.detail.id) {
this.setData({
"form.subDeptId": item.id,
"form.subDeptType": item.type,
"form.subDeptName": item.text,
"form.subDeptCode": item.code
})
}
});
},
/**
* 选择工种类型
* @param {*} e
*/
onCraftPost(e) {
this.setData({
"form.craftPost": e.detail.id
})
},
//填写班组名称
onGroupName(e) {
this.setData({
"form.groupName": e.detail.value
})
},
returnToPage: function () {
wx.redirectTo({
url: `../list/index`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@ -1,3 +1,8 @@
{
"usingComponents": {}
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"van-notice-bar": "@vant/weapp/notice-bar/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle": "custom"
}

View File

@ -1,2 +1,82 @@
<!--pages/project_subgroups/add/index.wxml-->
<text>pages/project_subgroups/add/index.wxml</text>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">{{form.id?'修改':'新增'}}单位班组</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info">
<view class="module_title_2 module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">参建单位
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写参建单位" placeholder-style="color:#6777aa;" model:value="{{form.subDeptName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">参建单位</view>
<view class="inspect_info_content">
<voucher-select columns="{{subDeptList}}" placeholder="请选择参建单位" bindchange="onSubDept" selectValue="{{form.subDeptId}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">工种类型
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content" wx:if="{{form.groupCode=='DEFAULT'}}">
<input placeholder-style="color:#6777aa;" model:value="管理人员" disabled class="inspect_input_fill_out" />
</view>
<view class="inspect_info_content" wx:if="{{form.groupCode=='SPECIAL'}}">
<input placeholder-style="color:#6777aa;" model:value="特殊工种" disabled class="inspect_input_fill_out" />
</view>
<view class="inspect_info_content" wx:if="{{form.groupCode!='DEFAULT' && form.groupCode!='SPECIAL'}}">
<input placeholder-style="color:#6777aa;" model:value="{{form.craftPostName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">工种类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{craftPostList}}" placeholder="请选择工种类型" bindchange="onCraftPost" selectValue="{{form.craftPost}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">班组名称</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写班组名称" model:value="{{form.groupName}}" placeholder-style="color:#6777aa;" maxlength="64" bindblur="onGroupName" />
</view>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{form.groupCode=='DEFAULT' || form.groupCode=='SPECIAL'}}">
<text class="color_delete">系统生成默认班组不可修改。</text>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{!form.id}}">
<text class="color_blue">只能新增普通劳务班组、管理班组默认已创建。</text>
</view>
<view class="safety_inspect_title module_title_flex">
<text class="color_orange">{{form.id?'修改':'新增'}}班组信息不进入审核流程、{{form.id?'修改':'新增'}}后立即生效。</text>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">取消</view>
<view wx:if="{{form.groupCode!='DEFAULT' && form.groupCode!='SPECIAL'}}" class="problem_submit_to_btn problem_submit_to_save" bindtap="submitValues">提交保存</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="/images/loding.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -1 +1,11 @@
/* pages/project_subgroups/add/index.wxss */
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -1,18 +1,233 @@
// pages/project_subgroups/info/index.js
import {
getToken
} from '../../../utils/auth'
import {
updateGroupLeader,
fileGroupLeaderUsers,
findSubdeptsGroupById,
editSubGroupsUseStatus
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 100,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '班组入场'
}],
form: {},
isChange: false,
leaderUserList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
}
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findSubdeptsGroupById(id).then(res => {
if (res.code == 200) {
this.setData({
active: 100,
form: res.data
});
}
});
},
/**
* 初始化班组长
*/
initLeaderUser(subDeptId, craftPost) {
fileGroupLeaderUsers(subDeptId, craftPost).then(res => {
if (res.code == 200) {
let list = [];
res.data.forEach(item => {
let _pst = "";
if (item.userPost == "2") {
_pst = " [项目经理]"
} else if (item.userPost == "6") {
_pst = " [材料员]"
} else if (item.userPost == "8") {
_pst = " [安全员]"
}
item.text = item.userName + _pst;
list.push(item);
});
this.setData({
leaderUserList: list
});
if (!this.data.form.groupLeaderPhone && list.length > 0) {
this.setData({
"form.groupLeaderName": list[0].userName,
"form.groupLeaderCode": list[0].userCode,
"form.groupLeaderPhone": list[0].id,
});
}
}
});
},
/**
* 返回上页
*/
returnToPage: function () {
wx.redirectTo({
url: `../list/index`
})
},
/**
* 班组入场
*/
submitSubDeptsIn() {
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认单位班组入场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(0);
}
}
})
},
/**
* 班组离场
*/
submitSubDeptsOut() {
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认单位班组离场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(1);
}
}
})
},
/**
* 表单提交
*/
submitSubDeptsUseStatus(status) {
editSubGroupsUseStatus(this.data.form.id, status).then(res => {
if (res.code == 200) {
app.toast("操作成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
},
/**
* 变更班组长
*/
changeGroupLeader() {
if (this.data.form.groupCode == 'DEFAULT' || this.data.form.groupCode == 'SPECIAL') {
app.toast("系统默认班组不能修改班组长信息!")
return false;
}
this.initLeaderUser(this.data.form.subDeptId, this.data.form.craftPost);
this.setData({
isChange: !this.data.isChange
});
setTimeout(() => {
wx.pageScrollTo({
scrollTop: 99999, // 滚动到内容区域的高度,即最底部
duration: 100 // 滚动的动画持续时间
});
}, 500)
},
/**
* 修改班组长
*/
onLeaderUser(e) {
let _list = this.data.leaderUserList;
_list.forEach(item => {
if (item.id == e.detail.id) {
this.setData({
"form.groupLeaderName": item.userName,
"form.groupLeaderCode": item.userCode,
"form.groupLeaderPhone": item.id,
})
}
});
},
/**
* 保存班组长信息
*/
submitSubGroupLeader(){
let {
form
} = this.data;
//数据效验
if (!form.projectId) {
app.toast("数据异常,请刷新页面重试!")
return false;
}
//数据效验
if (!form.groupLeaderPhone) {
app.toast("请选择班组组长!");
return false;
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认变更班组组长?',
success: function (sm) {
if (sm.confirm) {
that.submitSubGroupLeaderForm(1);
}
}
})
},
/**
* 确认变更
*/
submitSubGroupLeaderForm(){
updateGroupLeader(this.data.form).then(res =>{
if (res.code == 200) {
app.toast("变更成功!")
this.setData({
isChange: !this.data.isChange
})
this.onLoad({id: this.data.form.id});
}
});
},
/**

View File

@ -1,3 +1,6 @@
{
"usingComponents": {}
"usingComponents": {
"van-steps": "@vant/weapp/steps/index"
},
"navigationStyle": "custom"
}

View File

@ -1,2 +1,139 @@
<!--pages/project_subgroups/info/index.wxml-->
<text>pages/project_subgroups/info/index.wxml</text>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="16">
<view class="header_name">单位班组详情</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_overview inspect_overview_max">
<view class="module_title module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info">
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位类型</text></van-col>
<van-col span="16" class="color_blue">{{form.subDeptTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位名称</text></van-col>
<van-col span="16">{{form.subDeptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptCode}}">
<van-row>
<van-col span="8"><text class="color_purple">信用代码</text></van-col>
<van-col span="16">{{form.subDeptCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">工种类型</text></van-col>
<van-col span="16">
<text wx:if="{{form.groupCode=='DEFAULT'}}">管理人员</text>
<text wx:if="{{form.groupCode=='SPECIAL'}}">特殊工种</text>
<text wx:if="{{form.groupCode!='DEFAULT' && form.groupCode!='SPECIAL'}}">{{form.craftPostName}}</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.groupName}}">
<van-row>
<van-col span="8"><text class="color_purple">班组名称</text></van-col>
<van-col span="16">{{form.groupName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.groupCode}}">
<van-row>
<van-col span="8"><text class="color_purple">班组代码</text></van-col>
<van-col span="16">{{form.groupCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{!form.groupLeaderName}}">
<van-row>
<van-col span="8"><text class="color_purple">组长姓名</text></van-col>
<van-col span="16"><text class="color_type txtb"> - </text></van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.groupLeaderName}}">
<van-row>
<van-col span="8"><text class="color_purple">组长姓名</text></van-col>
<van-col span="16"><text class="color_orange txtb">{{form.groupLeaderName}}</text></van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.groupLeaderPhone}}">
<van-row>
<van-col span="8"><text class="color_purple">组长电话</text></van-col>
<van-col span="16">{{form.groupLeaderPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">入场状态</text></van-col>
<van-col span="16">
<text wx:if="{{form.useStatus=='0'}}" class="color_blue txtb">已入场</text>
<text wx:if="{{form.useStatus=='1'}}" class="color_delete txtb">已离场</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">审批状态</text></van-col>
<van-col span="16">
<text wx:if="{{form.approveStatus==0}}" class="code_label_2 code_label_yellow" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">待提交</text>
<text wx:if="{{form.approveStatus==10}}" class="code_label_2 code_label_blue" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核中</text>
<text wx:if="{{form.approveStatus==11}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核驳回</text>
<text wx:if="{{form.approveStatus==100}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核通过</text>
<text wx:if="{{form.approveStatus==101}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">系统免审</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">数据来源</text></van-col>
<van-col span="16">{{form.createBy}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">创建时间</text></van-col>
<van-col span="16">{{form.createTime}}</van-col>
</van-row>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{form.groupCode=='DEFAULT' || form.groupCode=='SPECIAL'}}">
<text class="color_delete">系统生成默认班组</text>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{isChange}}">
<view class="module_title module_title_padding">
<view>变更班组长</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_info_list">
<view class="markers inspect_info_title">班组组长</view>
<view class="inspect_info_content">
<voucher-select columns="{{leaderUserList}}" placeholder="请选择班组组长" bindchange="onLeaderUser" selectValue="{{form.groupLeaderPhone}}"></voucher-select>
</view>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">返回取消</view>
<view wx:if="{{!isChange}}" class="problem_submit_to_btn problem_submit_to_view_eq" bindtap="changeGroupLeader">变更组长</view>
<view wx:if="{{isChange}}" class="problem_submit_to_btn problem_submit_to_view_save" bindtap="submitSubGroupLeader">提交保存</view>
<view wx:if="{{form.useStatus=='0'}}" class="problem_submit_to_btn problem_submit_to_delete" bindtap="submitSubDeptsOut">班组离场</view>
<view wx:if="{{form.useStatus=='1'}}" class="problem_submit_to_btn problem_submit_to_warning" bindtap="submitSubDeptsIn">班组入场</view>
</view>
</view>

View File

@ -1 +1,11 @@
/* pages/project_subgroups/info/index.wxss */
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -1,18 +1,150 @@
// pages/project_subgroups/list/index.js
import {
getToken
} from '../../../utils/auth'
import {
subgroupsList,
subgroupsCount
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
addFlag: false,
initData: {},
pageNum: 1,
pageSize: 1000,
total: 0,
listData: [],
activeState: "0",
yrcCount: 0,
ylcCount: 0
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../login/login',
})
}
this.setData({
addFlag: true,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
pageNum: 1,
pageSize: 1000,
listData: [],
total: 0
});
//获取数据列表
this.getListData();
this.getListCount();
},
/**
* 添加按钮
*/
skipAdd() {
wx.redirectTo({
url: `../add/index`,
})
},
/**
* 获取详情
* @param {*} e
*/
getInfo(e) {
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../info/index?id=${_id}`,
})
},
/**
* 修改按钮
* @param {*} e
*/
editInfo(e){
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../add/index?id=${_id}`,
})
},
/**
* 查询数据列表
*/
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished";
subgroupsList(params).then(res => {
if (res.code == 200) {
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
},
/**
* 统计数据列表
*/
getListCount() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished";
subgroupsCount(params).then(res => {
if (res.code == 200) {
let _yrc = 0,
_ylc = 0;
res.data.forEach(item => {
if (item.useStatus == "0") {
_yrc = item.total;
} else {
_ylc = item.total;
}
});
this.setData({
yrcCount: _yrc,
ylcCount: _ylc
})
}
});
},
/**
* 标签切换
*/
trainJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if (index == 1) {
nav = '0';
} else {
nav = '1';
}
this.setData({
activeState: nav,
pageNum: 1,
pageSize: 1000,
listData: [],
});
this.getListData();
},
/**
@ -29,6 +161,28 @@ Page({
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: '../../project_more/index',
})
},
/**
* 滚动到底部
*/
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 {
console.log("已经到底了,没有数据可加载!!!");
}
},
/**
* 生命周期函数--监听页面隐藏
*/

View File

@ -1,3 +1,7 @@
{
"usingComponents": {}
}
"usingComponents": {
"van-cell-group": "@vant/weapp/cell-group",
"van-cell": "@vant/weapp/cell"
},
"navigationStyle":"custom"
}

View File

@ -1,2 +1,55 @@
<!--pages/project_subgroups/list/index.wxml-->
<text>pages/project_subgroups/list/index.wxml</text>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">单位班组管理</view>
</van-col>
</van-row>
</view>
</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=='0'?'active':''}}" bindtap="trainJump" data-index="1"><text>已入场({{yrcCount}}</text></view>
<view class="{{activeState=='1'?'active':''}}" bindtap="trainJump" data-index="2"><text>已离场({{ylcCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index">
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{index < 10 ?'0'+(index+1):(index+1)}}</view>
<view class="module_title module_title_flex inspect_list_title_text_2 color_orange">
{{item.subDepts}}
</view>
</view>
</view>
<view class="inspect_list_info">
<van-cell-group style="width: 100%;">
<van-cell wx:for="{{item.groupList}}" wx:for-item="groupItem" wx:for-index="groupIndex" wx:key="groupIndex" title="{{groupItem.groupName}}" icon="qr" cell-class="switch-cell" data-set="{{groupItem.id}}" bindtap="getInfo">
<view class="module_see_info_edit" catchtap="editInfo" data-set="{{groupItem.id}}"><van-icon name="edit" /><text class="edit_text">修改</text></view>
</van-cell>
</van-cell-group>
</view>
</view>
</view>
<view wx:if="{{listData.length==0}}">
<view style="padding-top: 70px;text-align: -webkit-center;">
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
<view style="color: #a5abbb;">暂无数据</view>
</view>
</view>
<view wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -1 +1,14 @@
/* pages/project_subgroups/list/index.wxss */
/* pages/project_subDepts/index.wxss */
.module_see_info_edit {
color: #91ef4a;
font-weight: 600;
}
.module_see_info_edit .edit_text {
padding-left: 10rpx;
}
.van-cell{
color: #89a3ee !important;
background-color: #32374c !important;
}

View File

@ -1,18 +1,726 @@
// pages/project_subusers/add/index.js
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
findDictCache,
findCardOcrFront
} from '../../../api/publics'
import {
subdeptsList,
findSubGroupsList,
registerSubUsersGL,
findProSubUsersInfoById
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
limit: 1,
maxDate: new Date(2088, 1, 1).getTime(),
form: {},
active: 0,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '人员入场'
}],
subDeptList: [],
subGroupList: [],
userPostList: [],
eduCationalType: [],
loadShow: false,
imgBase: config.baseImgUrl,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
}
this.setData({
"form.projectId": app.globalData.useProjectId,
"form.projectName": app.globalData.useProjectName
});
this.getDictCache();
this.getAllSubDepts();
},
/**
* 获取单位
*/
getAllSubDepts() {
let params = "pageNum=1&pageSize=1000&useStatus=0&activeTags=finished&projectId=" + app.globalData.useProjectId;
subdeptsList(params).then(res => {
let list = [];
res.rows.forEach(item => {
list.push({
"id": item.id,
"text": item.subDeptName,
"type": item.subDeptType,
"typeName": item.subDeptTypeName,
"code": item.subDeptCode,
});
});
this.setData({
subDeptList: list
});
});
},
/**
* 获取班组
*/
getAllSubGroups(subDeptId) {
let params = "pageNum=1&pageSize=1000&useStatus=0&activeTags=finished&projectId=" + app.globalData.useProjectId + "&subDeptId=" + subDeptId;
findSubGroupsList(params).then(res => {
let list = [];
res.rows.forEach(item => {
list.push({
"id": item.id,
"text": item.groupName,
"groupCode": item.groupCode,
"craftType": item.craftType,
"craftTypeName": item.craftTypeName,
"craftPost": item.craftPost,
"craftPostName": item.craftPostName,
});
});
this.setData({
subGroupList: list
});
});
},
/**
* 获取字典缓存数据
*/
getDictCache() {
// 初始化学历类型
findDictCache("educational_type").then(res => {
if (res.code == 200) {
let eduCationalType = [];
res.data.forEach(item => {
eduCationalType.push({
"id": item.dictValue,
"text": item.dictLabel
});
})
this.setData({
eduCationalType
});
}
})
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findProSubUsersInfoById(id).then(userRes => {
if (userRes.code == 200 && userRes.data != null) {
if (userRes.data.userInfos) {
let userInfosJSON = JSON.parse(userRes.data.userInfos);
userRes.data.nativePlace = userInfosJSON.nativePlace;
userRes.data.nation = userInfosJSON.nation;
userRes.data.address = userInfosJSON.address;
userRes.data.emergencyContact = userInfosJSON.emergencyContact;
userRes.data.contactPhone = userInfosJSON.contactPhone;
userRes.data.bankName = userInfosJSON.bankName;
userRes.data.bankOffice = userInfosJSON.bankOffice;
userRes.data.bankCardNo = userInfosJSON.bankCardNo;
userRes.data.cardImgPos = userInfosJSON.cardImgPos;
userRes.data.cardImgInv = userInfosJSON.cardImgInv;
}
if (userRes.data.cardImgPos) {
userRes.data.cardImgPos = (this.data.imgBase + userRes.data.cardImgPos).split(',');
}
if (userRes.data.cardImgInv) {
userRes.data.cardImgInv = (this.data.imgBase + userRes.data.cardImgInv).split(',');
}
if (userRes.data.userPicture) {
userRes.data.userPicture = (this.data.imgBase + userRes.data.userPicture).split(',');
}
if (userRes.data.subDeptPowerPath) {
userRes.data.subDeptPowerPath = (this.data.imgBase + userRes.data.subDeptPowerPath).split(',');
}
userRes.data._userPost = userRes.data.craftPost;
this.setData({
active: 100,
form: userRes.data
});
this.initUserPostList(userRes.data.craftType,userRes.data.id);
}
});
},
//取消页面
cancelSaveView() {
this.returnToPage()
},
/**
* 委托代理提交参建单位信息
*/
submitSubUsers() {
let {
form
} = this.data;
//数据效验
if (!form.projectId) {
app.toast("数据异常,请刷新页面重试!")
return false;
}
//数据效验
if (!form.subDeptId || !form.subDeptType || !form.subDeptName) {
app.toast("请选择参建单位!");
return false;
}
if (!form.subDeptGroup || !form.subDeptGroupName) {
app.toast("请选择所属班组!");
return false;
}
if (!form._userPost) {
app.toast("请选择工种岗位!");
return false;
}
if (!form.cardImgPos || form.cardImgPos.length == 0) {
app.toast("请上传身份证正面照!");
return false;
}
if (!form.cardImgInv || form.cardImgInv.length == 0) {
app.toast("请上传身份证反面照!");
return false;
}
if (!form.userPicture || form.userPicture.length == 0) {
app.toast("请上传进场半身近照!");
return false;
}
if (form._userPost == '2' || form._userPost == '6') {
if (!form.subDeptPowerPath || form.subDeptPowerPath.length == 0) {
app.toast("请上传委托人单位委托书!");
return false;
}
}
if (!form.userName) {
app.toast("请填写人员姓名!");
return false;
}
if (!form.cardCode) {
app.toast("请填写身份证号!");
return false;
} else {
const cardCodePattern = /^[1-9]\d{5}(18|19|20|21|22)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|[Xx])$/;
if (!cardCodePattern.test(form.cardCode)) {
app.toast("身份证号码不正确!");
return false;
}
}
if (!form.userPhone) {
app.toast("请填写联系电话!");
return false;
} else {
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if (!phonePattern.test(form.userPhone)) {
app.toast("人员联系电话不正确!");
return false;
}
}
if (!form.nativePlace) {
app.toast("请填写籍贯!");
return false;
}
if (!form.nation) {
app.toast("请填写民族!");
return false;
}
if (!form.address) {
app.toast("请填写地址!");
return false;
}
if (!form.emergencyContact) {
app.toast("请填写紧急联系人!");
return false;
}
if (!form.contactPhone) {
app.toast("请填写紧急联系人电话!");
return false;
} else {
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if (!phonePattern.test(form.contactPhone)) {
app.toast("紧急联系人电话不正确!");
return false;
}
}
if (!form.degreeGrade) {
app.toast("请选择文化程度!");
return false;
}
if (false) {
if (!form.bankName) {
app.toast("请填写开户银行名称!");
return false;
}
if (!form.bankOffice) {
app.toast("请填写开户银行网点!");
return false;
}
if (!form.bankCardNo) {
app.toast("请填写工资银行卡号!");
return false;
}
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认保存班组人员信息?',
success: function (sm) {
if (sm.confirm) {
that.submitSubUserForm();
}
}
})
},
/**
* 委托代理提交参建单位表单
*/
submitSubUserForm() {
let _form = {
...this.data.form
};
this.setData({
loadShow: true
})
let uploadFiles = [];
if (_form.cardImgPos && _form.cardImgPos.length > 0) {
uploadFiles.push({
type: 'cardImgPos',
path: _form.cardImgPos[0]
});
}
if (_form.cardImgInv && _form.cardImgInv.length > 0) {
uploadFiles.push({
type: 'cardImgInv',
path: _form.cardImgInv[0]
});
}
if (_form.userPicture && _form.userPicture.length > 0) {
uploadFiles.push({
type: 'userPicture',
path: _form.userPicture[0]
});
}
if (_form.subDeptPowerPath && _form.subDeptPowerPath.length > 0) {
uploadFiles.push({
type: 'subDeptPowerPath',
path: _form.subDeptPowerPath[0]
});
}
let that = this;
let uploads = [];
uploadFiles.forEach(async (item, idx) => {
let obj;
if (item.path.indexOf(this.data.imgBase) > -1) {
obj = {
data: {
data: {
url: item.path.replace(this.data.imgBase, "")
}
}
}
} else {
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
obj = await that.syncUploadImage(item.path);
}
if (item.type == "cardImgPos") {
_form.cardImgPos = obj.data.data.url;
}
if (item.type == "cardImgInv") {
_form.cardImgInv = obj.data.data.url;
}
if (item.type == "userPicture") {
_form.userPicture = obj.data.data.url;
}
if (item.type == "subDeptPowerPath") {
_form.subDeptPowerPath = obj.data.data.url;
}
uploads.push(obj.data.data.url);
//验证图片上传完毕
if (uploads.length == uploadFiles.length) {
let userInfos = {};
userInfos.nation = _form.nation;
userInfos.nativePlace = _form.nativePlace;
userInfos.address = _form.address;
userInfos.emergencyContact = _form.emergencyContact;
userInfos.contactPhone = _form.contactPhone;
userInfos.bankName = _form.bankName;
userInfos.bankOffice = _form.bankOffice;
userInfos.bankCardNo = _form.bankCardNo;
userInfos.cardImgPos = _form.cardImgPos;
userInfos.cardImgInv = _form.cardImgInv;
_form.userInfos = JSON.stringify(userInfos);
_form.craftPost = _form._userPost;
registerSubUsersGL(_form).then(res => {
this.setData({
loadShow: false
});
if (res.code == 200) {
app.toast("保存数据成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
}
});
},
//选择参建单位
onSubDept(e) {
this.setData({
subGroupList: [],
userPostList: [],
});
this.getAllSubGroups(e.detail.id);
let _list = this.data.subDeptList;
_list.forEach(item => {
if (item.id == e.detail.id) {
this.setData({
"form.subDeptId": item.id,
"form.subDeptType": item.type,
"form.subDeptTypeName": item.typeName,
"form.subDeptName": item.text,
"form.subDeptCode": item.code,
"form.subDeptGroup": null,
"form.subDeptGroupName": null,
"form.craftType": null,
"form.craftTypeName": null,
"form.craftPost": null,
"form.craftPostName": null,
"form._userPost": null,
})
}
});
},
//选择所属班组
onSubGroup(e) {
this.setData({
userPostList: [],
});
let _list = this.data.subGroupList;
_list.forEach(item => {
if (item.id == e.detail.id) {
this.setData({
"form.subDeptGroup": item.id,
"form.subDeptGroupName": item.text,
"form.craftType": item.craftType,
"form.craftTypeName": item.craftTypeName,
"form.craftPost": item.craftPost,
"form.craftPostName": item.craftPostName,
"form._userPost": item.craftType=='1'?item.craftPost:null,
})
this.initUserPostList(item.craftType,this.data.form.id);
}
});
},
/**
* 初始化用户岗位
*/
initUserPostList(type,optId) {
if (!type) {
type == "1";
}
findDictCache("pro_craft_post").then(res => {
if (res.code == 200) {
let list = [];
res.data.forEach(item => {
let _rms = item.remark.split(',');
if (item.cssClass == type && _rms.includes(this.data.form.subDeptType)) {
if (type == "3") {
if (item.dictValue != "3022") {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
}
} else {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
}
}
});
this.setData({
userPostList: list
});
if(!optId && type!="1"){
this.setData({
"form._userPost": list.length == 1 ? list[0].id : null
});
}
}
});
},
/**
* 选择工种岗位
* @param {*} e
*/
onUserPost(e) {
this.setData({
"form._userPost": e.detail.id
})
console.log("form",this.data.form);
},
/**
* 个人身份证正面照
* @param {*} options
*/
fileUploadCardImgPos(options) {
let file = options.detail;
this.setData({
"form.cardImgPos": file
});
file.forEach(async (item, idx) => {
let obj = await this.syncUploadImage(item);
findCardOcrFront(obj.data.data.url).then(res => {
if (res.code == 200) {
if (res.data.nation.indexOf("族") < 0) {
res.data.nation = res.data.nation + "族";
}
this.setData({
"form.userName": res.data.name,
"form.cardCode": res.data.cardId,
"form.nation": res.data.nation,
"form.nativePlace": res.data.native,
"form.address": res.data.address
})
if (!res.data.name || !res.data.cardId) {
this.setData({
"form.cardImgPos": []
});
app.toast("身份证正面照识别失败!请重新上传");
}
}
});
})
},
/**
* 个人身份证反面照
* @param {*} options
*/
fileUploadCardImgInv(options) {
let file = options.detail;
this.setData({
"form.cardImgInv": file
});
},
/**
* 个人半身近照
* @param {*} options
*/
fileUploadUserPicture(options) {
let file = options.detail;
this.setData({
"form.userPicture": file
});
},
/**
* 单位委托书
* @param {*} options
*/
fileUploadDeptPower(options) {
let file = options.detail;
this.setData({
"form.subDeptPowerPath": file
});
},
/**
* 输入个人姓名
* @param {*} e
*/
inputUserName(e) {
this.setData({
"form.userName": e.detail.value
})
},
/**
* 输入个人身份证号
* @param {*} e
*/
inputUserCode(e) {
this.setData({
"form.cardCode": e.detail.value
})
},
/**
* 输入联系电话
* @param {*} e
*/
inputUserPhone(e) {
this.setData({
"form.userPhone": e.detail.value
})
},
/**
* 个人籍贯
* @param {*} e
*/
inputOriginNative(e) {
this.setData({
"form.nativePlace": e.detail.value
})
},
/**
* 个人民族
* @param {*} e
*/
inputOriginNation(e) {
this.setData({
"form.nation": e.detail.value
})
},
/**
* 个人籍贯地址
* @param {*} e
*/
inputOriginAddress(e) {
this.setData({
"form.address": e.detail.value
})
},
/**
* 紧急联系人
* @param {*} e
*/
inputUrgentUser(e) {
this.setData({
"form.emergencyContact": e.detail.value
})
},
/**
* 紧急联系人电话
* @param {*} e
*/
inputUrgentUserPhone(e) {
this.setData({
"form.contactPhone": e.detail.value
})
},
/**
* 个人文化程度
* @param {*} e
*/
onDegreeGrade(e) {
this.setData({
"form.degreeGrade": e.detail.id
})
},
/**
* 开户行名称
* @param {*} e
*/
inputBankName(e) {
this.setData({
"form.bankName": e.detail.value
})
},
/**
* 开户行网点
* @param {*} e
*/
inputBankOffice(e) {
this.setData({
"form.bankOffice": e.detail.value
})
},
/**
* 开户行卡号
* @param {*} e
*/
inputBankCardNo(e) {
this.setData({
"form.bankCardNo": e.detail.value
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
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 () {
wx.redirectTo({
url: `../list/index`
})
},
/**

View File

@ -1,3 +1,8 @@
{
"usingComponents": {}
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"van-notice-bar": "@vant/weapp/notice-bar/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle": "custom"
}

View File

@ -1,2 +1,235 @@
<!--pages/project_subusers/add/index.wxml-->
<text>pages/project_subusers/add/index.wxml</text>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">{{form.id?'修改':'新增'}}班组人员</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info">
<view class="module_title_2 module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">参建单位
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写参建单位" placeholder-style="color:#6777aa;" model:value="{{form.subDeptName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">参建单位
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<voucher-select columns="{{subDeptList}}" placeholder="请选择参建单位" bindchange="onSubDept" selectValue="{{form.subDeptId}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.subDeptTypeName}}">
<view class="markers inspect_info_title">单位类型
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写单位类型" placeholder-style="color:#6777aa;" model:value="{{form.subDeptTypeName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">所属班组
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写所属班组" placeholder-style="color:#6777aa;" model:value="{{form.subDeptGroupName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">所属班组</view>
<view class="inspect_info_content">
<voucher-select columns="{{subGroupList}}" placeholder="请选择所属班组" bindchange="onSubGroup" selectValue="{{form.subDeptGroup}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.craftTypeName}}">
<view class="markers inspect_info_title">班组岗位
<text style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写班组岗位" placeholder-style="color:#6777aa;" model:value="{{form.craftTypeName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{form.id}}">
<view class="markers inspect_info_title">工种岗位
<text wx:if="{{form.craftType=='3' || form.craftPost}}" style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content" wx:if="{{form.craftType=='3' || form.userPost=='3'}}">
<input placeholder="请填写工种岗位" placeholder-style="color:#6777aa;" model:value="{{form.craftPostName}}" disabled class="inspect_input_fill_out" />
</view>
<view class="inspect_info_content" wx:else>
<!-- <voucher-select columns="{{userPostList}}" placeholder="请选择工种岗位" bindchange="onUserPost" selectValue="{{form._userPost}}"></voucher-select> -->
<input placeholder="请填写工种岗位" placeholder-style="color:#6777aa;" model:value="{{form.craftPostName}}" disabled class="inspect_input_fill_out" />
</view>
</view>
<view class="inspect_info_list" wx:if="{{!form.id}}">
<view class="markers inspect_info_title">工种岗位
<text wx:if="{{form.craftPost}}" style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content" wx:if="{{form.craftPost}}">
<input placeholder="请填写工种岗位" placeholder-style="color:#6777aa;" model:value="{{form.craftPostName}}" disabled class="inspect_input_fill_out" />
</view>
<view class="inspect_info_content" wx:if="{{!form.craftPost}}">
<voucher-select columns="{{userPostList}}" placeholder="请选择工种岗位" bindchange="onUserPost" selectValue="{{form._userPost}}"></voucher-select>
</view>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{form.userPost=='3'}}">
<text class="color_delete">班组长不能修改工种岗位。</text>
</view>
<view class="inspect_info_list">
<van-row>
<van-col span="12">
<view class="markers inspect_info_title">身份证正面
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUploadCardImgPos" iconClass="in-zcard-click" limit="{{limit}}" fileUrlArray="{{form.cardImgPos}}"></file-uploader>
</view>
</van-col>
<van-col span="12">
<view class="markers inspect_info_title">身份证反面
</view>
<view class="inspect_info_content" style="margin-left: 10px;">
<file-uploader bindimages="fileUploadCardImgInv" iconClass="in-fcard-click" limit="{{limit}}" fileUrlArray="{{form.cardImgInv}}"></file-uploader>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">半身近照
<text style="font-size: small; color: #ff711e;">[进场扫脸,请上传清晰照片]</text>
</view>
<view class="inspect_info_content">
<file-uploader bindimages="fileUploadUserPicture" limit="{{limit}}" fileUrlArray="{{form.userPicture}}"></file-uploader>
</view>
</view>
<view class="inspect_info_list" wx:if="{{(form.subDeptType=='4' || form.subDeptType=='5') && (form._userPost=='2' || form._userPost=='6')}}">
<view class="markers inspect_info_title">劳务单位委托书
<text style="font-size: small; color: #ff711e;">[需加盖劳务单位的公章委托书照片]</text>
</view>
<view class="inspect_info_content">
<file-uploader bindimages="fileUploadDeptPower" limit="{{limit}}" fileUrlArray="{{form.subDeptPowerPath}}"></file-uploader>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">人员姓名
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写姓名" placeholder-style="color:#6777aa;" bindinput="inputUserName" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.userName}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">身份证号
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写身份证号" placeholder-style="color:#6777aa;" bindinput="inputUserCode" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.cardCode}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">联系电话
<text wx:if="{{form.id}}" style="font-size: small; color: #ff711e;">[不可修改]</text>
</view>
<view class="inspect_info_content" wx:if="{{form.id}}">
<input placeholder-style="color:#6777aa;" model:value="{{form.userPhone}}" disabled class="inspect_input_fill_out" disabled />
</view>
<view class="inspect_info_content" wx:if="{{!form.id}}">
<input placeholder="请填写联系电话" placeholder-style="color:#6777aa;" bindinput="inputUserPhone" model:value="{{form.userPhone}}" class="inspect_input_fill_in" maxlength="11"/>
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">民族
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写民族" placeholder-style="color:#6777aa;" bindinput="inputOriginNation" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nation}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">籍贯
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写籍贯" placeholder-style="color:#6777aa;" bindinput="inputOriginNative" class="inspect_input_fill_in" disabled maxlength="30" model:value="{{form.nativePlace}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">地址
<text style="font-size: small; color: #ff711e;">[不可输入,证件自动识别]</text>
</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写地址" placeholder-style="color:#6777aa;" maxlength="64" disabled bindblur="inputOriginAddress" model:value="{{form.address}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">紧急联系人</view>
<view class="inspect_info_content">
<input placeholder="请填写紧急联系人" placeholder-style="color:#6777aa;" bindinput="inputUrgentUser" class="inspect_input_fill_in" model:value="{{form.emergencyContact}}" maxlength="30" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">紧急联系人电话</view>
<view class="inspect_info_content">
<input placeholder="请填写紧急联系人电话" placeholder-style="color:#6777aa;" bindinput="inputUrgentUserPhone" class="inspect_input_fill_in" maxlength="11" model:value="{{form.contactPhone}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="markers inspect_info_title">文化程度</view>
<view class="inspect_info_content">
<voucher-select columns="{{eduCationalType}}" placeholder="请选择文化程度" bindchange="onDegreeGrade" selectValue="{{form.degreeGrade}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title">开户银行名称
<text style="font-size: small; color: antiquewhite;">[非必填]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写开户银行名称" placeholder-style="color:#6777aa;" bindinput="inputBankName" class="inspect_input_fill_in" maxlength="30" model:value="{{form.bankName}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title">开户银行网点
<text style="font-size: small; color: antiquewhite;">[非必填,开户银行地址]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写开户银行网点" placeholder-style="color:#6777aa;" bindinput="inputBankOffice" class="inspect_input_fill_in" maxlength="30" model:value="{{form.bankOffice}}" />
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title">工资银行卡号
<text style="font-size: small; color: antiquewhite;">[非必填]</text>
</view>
<view class="inspect_info_content">
<input placeholder="请填写工资银行卡号" placeholder-style="color:#6777aa;" bindinput="inputBankCardNo" class="inspect_input_fill_in" maxlength="30" model:value="{{form.bankCardNo}}" />
</view>
</view>
<view class="safety_inspect_title module_title_flex">
<text class="color_orange">{{form.id?'修改':'新增'}}人员信息不进入审核流程、{{form.id?'修改':'新增'}}后立即生效。</text>
</view>
</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="submitSubUsers">提交保存</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="/images/loding.gif"></image>
<view>数据处理中!请稍后...</view>
</view>
</van-overlay>

View File

@ -1 +1,11 @@
/* pages/project_subusers/add/index.wxss */
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -1,18 +1,273 @@
// pages/project_subusers/info/index.js
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
editSubUsersPhone,
editSubUsersUseStatus,
findProSubUsersInfoById
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
active: 100,
flowNodes: [{
text: '信息登记'
}, {
text: '信息审核'
}, {
text: '人员入场'
}],
form: {},
newUserPhone:"",
isChange: false,
imgBaseUrl: config.baseImgUrl
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../login/login',
})
}
if (options && options.id) {
//查询数据回填...
this.initData(options.id);
}
},
/**
* 初始化数据
* @param {*} id
*/
initData(id) {
findProSubUsersInfoById(id).then(userRes => {
if (userRes.code == 200 && userRes.data != null) {
if (userRes.data.userInfos) {
let userInfosJSON = JSON.parse(userRes.data.userInfos);
userRes.data.nativePlace = userInfosJSON.nativePlace;
userRes.data.nation = userInfosJSON.nation;
userRes.data.address = userInfosJSON.address;
userRes.data.emergencyContact = userInfosJSON.emergencyContact;
userRes.data.contactPhone = userInfosJSON.contactPhone;
userRes.data.bankName = userInfosJSON.bankName;
userRes.data.bankOffice = userInfosJSON.bankOffice;
userRes.data.bankCardNo = userInfosJSON.bankCardNo;
userRes.data.cardImgPos = userInfosJSON.cardImgPos;
userRes.data.cardImgInv = userInfosJSON.cardImgInv;
}
if (userRes.data.cardImgPos) {
userRes.data.cardImgPos = (this.data.imgBaseUrl + userRes.data.cardImgPos).split(',');
}
if (userRes.data.cardImgInv) {
userRes.data.cardImgInv = (this.data.imgBaseUrl + userRes.data.cardImgInv).split(',');
}
if (userRes.data.userPicture) {
userRes.data.userPicture = (this.data.imgBaseUrl + userRes.data.userPicture).split(',');
}
if (userRes.data.subDeptPowerPath) {
userRes.data.subDeptPowerPath = (this.data.imgBaseUrl + userRes.data.subDeptPowerPath).split(',');
}
this.setData({
active: 100,
form: userRes.data
});
}
});
},
/**
* 返回上页
*/
returnToPage: function () {
wx.redirectTo({
url: `../list/index`
})
},
/**
* 展示图片
* @param {*} e
*/
showImg: function (e) {
let paths = e.target.dataset.set;
let path = [];
paths.split(',').forEach(url => {
path.push(url);
});
wx.previewImage({
urls: path,
current: path[0]
})
},
/**
* 下载并打开文档
* @param {*} e
*/
downFile: function (e) {
let path = this.data.form.eduFilePath;
wx.downloadFile({
// 示例 url并非真实存在
url: config.baseUrl + '/file/download?fileName=' + path,
header: {
'Authorization': 'Bearer ' + getToken()
},
success: function (res) {
const filePath = res.tempFilePath
let fpt = path.split(".");
wx.openDocument({
filePath: filePath,
fileType: fpt[fpt.length - 1],
success: function (res) {
console.log('打开文档成功')
},
fail: function (res) {
console.log(res)
}
})
}
})
},
/**
* 单位入场
*/
submitSubDeptsIn(){
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认班组人员入场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(0);
}
}
})
},
/**
* 单位离场
*/
submitSubDeptsOut(){
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认班组人员离场?',
success: function (sm) {
if (sm.confirm) {
that.submitSubDeptsUseStatus(1);
}
}
})
},
/**
* 表单提交
*/
submitSubDeptsUseStatus(status){
editSubUsersUseStatus(this.data.form.id,status).then(res =>{
if(res.code==200){
app.toast("操作成功!")
setTimeout(() => {
wx.redirectTo({
url: `../list/index`,
})
}, 200)
}
});
},
/**
* 输入联系电话
* @param {*} e
*/
inputUserPhone(e) {
this.setData({
newUserPhone: e.detail.value
})
},
/**
* 变更手机号
*/
changeUserPhone() {
this.setData({
isChange: !this.data.isChange
});
setTimeout(() => {
wx.pageScrollTo({
scrollTop: 99999, // 滚动到内容区域的高度,即最底部
duration: 100 // 滚动的动画持续时间
});
}, 500)
},
/**
*
*/
submitChangePhone(){
let {
form,
newUserPhone
} = this.data;
if(!newUserPhone){
app.toast("请输入新手机号码!")
return false;
}else{
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if (!phonePattern.test(newUserPhone)) {
app.toast("手机号码不正确!");
return false;
}
}
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认变更人员手机号?',
success: function (sm) {
if (sm.confirm) {
that.submitChangePhoneForm();
}
}
})
},
/**
* 确定
* 变更手机号
*/
submitChangePhoneForm(){
let _form = {
...this.data.form
};
let {
newUserPhone
} = this.data;
_form.userPhone = newUserPhone;
_form.cardImgPos = "";
_form.cardImgInv = "";
_form.userPicture = "";
_form.subDeptPowerPath = "";
editSubUsersPhone(_form).then(res =>{
if(res.code==200){
app.toast("变更成功!")
this.setData({
isChange: !this.data.isChange
})
this.onLoad({id: _form.id});
}
});
},
/**

View File

@ -1,3 +1,6 @@
{
"usingComponents": {}
"usingComponents": {
"van-steps": "@vant/weapp/steps/index"
},
"navigationStyle": "custom"
}

View File

@ -1,2 +1,244 @@
<!--pages/project_subusers/info/index.wxml-->
<text>pages/project_subusers/info/index.wxml</text>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
<text class="header_fh">返回</text>
</view>
</van-col>
<van-col span="16">
<view class="header_name">班组人员详情</view>
</van-col>
</van-row>
</view>
</view>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_overview inspect_overview_max">
<view class="module_title module_title_padding">
<view>{{form.projectName}}</view>
</view>
<view class="inspect_info">
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位类型</text></van-col>
<van-col span="16" class="color_blue">{{form.subDeptTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="8"><text class="color_purple">单位名称</text></van-col>
<van-col span="16">{{form.subDeptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptGroupName}}">
<van-row>
<van-col span="8"><text class="color_purple">所属班组</text></van-col>
<van-col span="16">{{form.subDeptGroupName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.craftTypeName}}">
<van-row>
<van-col span="8"><text class="color_purple">工种类型</text></van-col>
<van-col span="16">{{form.craftTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.craftPostName}}">
<van-row>
<van-col span="8"><text class="color_purple">工种岗位</text></van-col>
<van-col span="16">
{{form.craftPostName}}
<text wx:if="{{form.userPost=='3'}}" style="font-size: small; color: #ff6d6d;">[班组长]</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.cardImgPos && form.cardImgInv}}">
<van-row>
<van-col span="8"><text class="color_purple">身份证件</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.cardImgPos}}" src="{{form.cardImgPos+'.min.jpg'}}"></image>
<image bindtap='showImg' data-set="{{form.cardImgInv}}" src="{{form.cardImgInv+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.userPicture}}">
<van-row>
<van-col span="8"><text class="color_purple">半身近照</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.userPicture}}" src="{{form.userPicture+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.subDeptPowerPath}}">
<van-row>
<van-col span="8"><text class="color_purple">单位委托书</text></van-col>
<van-col span="16">
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:key="index">
<image bindtap='showImg' data-set="{{form.subDeptPowerPath}}" src="{{form.subDeptPowerPath+'.min.jpg'}}"></image>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.userName}}">
<van-row>
<van-col span="8">
<text class="color_purple">人员姓名</text>
</van-col>
<van-col span="16">{{form.userName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.cardCode}}">
<van-row>
<van-col span="8">
<text class="color_purple">身份证号码</text>
</van-col>
<van-col span="16">{{form.cardCode}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.nation}}">
<van-row>
<van-col span="8"><text class="color_purple">所属民族</text></van-col>
<van-col span="16">{{form.nation}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.nativePlace}}">
<van-row>
<van-col span="8"><text class="color_purple">籍贯地址</text></van-col>
<van-col span="16">{{form.nativePlace}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.address}}">
<van-row>
<van-col span="8"><text class="color_purple">详细地址</text></van-col>
<van-col span="16">{{form.address}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.userPhone}}">
<van-row>
<van-col span="8"><text class="color_purple">联系电话</text></van-col>
<van-col span="16"><text class="color_blue txtb">{{form.userPhone}}</text></van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.emergencyContact}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系人</text></van-col>
<van-col span="16">{{form.emergencyContact}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.contactPhone}}">
<van-row>
<van-col span="8"><text class="color_purple">紧急联系电话</text></van-col>
<van-col span="16">{{form.contactPhone}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.bankName}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行名称</text></van-col>
<van-col span="16">{{form.bankName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.bankOffice}}">
<van-row>
<van-col span="8"><text class="color_purple">开户行网点</text></van-col>
<van-col span="16">{{form.bankOffice}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.bankCardNo}}">
<van-row>
<van-col span="8"><text class="color_purple">工资银行卡号</text></van-col>
<van-col span="16">{{form.bankCardNo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.illnessStatus!=null}}">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">高血压、心脏病等基础身体健康问题
</view>
<view class="inspect_info_content">
<text wx:if="{{form.illnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{form.illnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list" wx:if="{{form.supIllnessStatus!=null}}">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">严重呼吸系统疾病、严重心脑血管疾病、肝肾疾病、恶性肿瘤以及药物无法有效控制的高血压和糖尿病等基础性病症状征兆
</view>
<view class="inspect_info_content">
<text wx:if="{{form.supIllnessStatus=='0'}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 25rpx;">无</text>
<text wx:if="{{form.supIllnessStatus!='0'}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 25rpx;">有</text>
</view>
</view>
<view class="inspect_overview_list" wx:if="{{form.eduFilePath}}">
<van-row>
<van-col span="8"><text class="color_purple">安全承诺书</text></van-col>
<van-col span="16" class="color_blue">
<view class="files">
<text data-set="{{form.eduFilePath}}" style="word-wrap: break-word;" bindtap='downFile'>点击下载安全承诺书</text>
</view>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.useStatus}}">
<van-row>
<van-col span="8"><text class="color_purple">入场状态</text></van-col>
<van-col span="16">
<text wx:if="{{form.useStatus=='0'}}" class="color_blue txtb">已入场</text>
<text wx:if="{{form.useStatus=='1'}}" class="color_delete txtb">已离场</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.approveStatus}}">
<van-row>
<van-col span="8"><text class="color_purple">审批状态</text></van-col>
<van-col span="16">
<text wx:if="{{form.approveStatus==0}}" class="code_label_2 code_label_yellow" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">待提交</text>
<text wx:if="{{form.approveStatus==10}}" class="code_label_2 code_label_blue" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核中</text>
<text wx:if="{{form.approveStatus==11}}" class="code_label_2 code_label_red" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核驳回</text>
<text wx:if="{{form.approveStatus==100}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">审核通过</text>
<text wx:if="{{form.approveStatus==101}}" class="code_label_2 code_label_green" style="padding: 5rpx 50rpx;font-size: 15px;font-weight: 600;">系统免审</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.createBy}}">
<van-row>
<van-col span="8"><text class="color_purple">数据来源</text></van-col>
<van-col span="16">{{form.createBy}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{form.createTime}}">
<van-row>
<van-col span="8"><text class="color_purple">创建时间</text></van-col>
<van-col span="16">{{form.createTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{isChange}}">
<view class="module_title module_title_padding">
<view>变更手机号码</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_info_list">
<view class="markers inspect_info_title">新手机号码</view>
<view class="inspect_info_content">
<input placeholder="请填写新手机号码" placeholder-style="color:#6777aa;" bindinput="inputUserPhone" model:value="{{newUserPhone}}" class="inspect_input_fill_in" maxlength="11"/>
</view>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="returnToPage">返回取消</view>
<view wx:if="{{!isChange}}" class="problem_submit_to_btn problem_submit_to_view_eq" bindtap="changeUserPhone">变更电话</view>
<view wx:if="{{isChange}}" class="problem_submit_to_btn problem_submit_to_view_save" bindtap="submitChangePhone">提交保存</view>
<view wx:if="{{form.useStatus=='0'}}" class="problem_submit_to_btn problem_submit_to_delete" bindtap="submitSubDeptsOut">人员离场</view>
<view wx:if="{{form.useStatus=='1'}}" class="problem_submit_to_btn problem_submit_to_warning" bindtap="submitSubDeptsIn">人员入场</view>
</view>
</view>

View File

@ -1 +1,11 @@
/* pages/project_subusers/info/index.wxss */
.van-steps {
background-color: transparent !important;
}
.van-step--horizontal .van-step__circle-container {
background-color: transparent !important;
}
.van-steps--horizontal {
padding: 10px 20px !important;
}

View File

@ -1,18 +1,158 @@
// pages/project_subusers/list/index.js
import {
getToken
} from '../../../utils/auth'
import {
subusersList,
subusersCount
} from '../../../api/project'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
addFlag: false,
initData: {},
pageNum: 1,
pageSize: 10000,
total: 0,
listData: [],
activeState: "0",
yrcCount: 0,
ylcCount: 0,
activeName: "",
},
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!getToken()) {
wx.redirectTo({
url: '../../../login/login',
})
}
this.setData({
addFlag: true,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
},
pageNum: 1,
pageSize: 10000,
listData: [],
total: 0
});
//获取数据列表
this.getListData();
this.getListCount();
},
/**
* 添加按钮
*/
skipAdd() {
wx.redirectTo({
url: `../add/index`,
})
},
/**
* 获取详情
* @param {*} e
*/
getInfo(e) {
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../info/index?id=${_id}`,
})
},
/**
* 修改按钮
* @param {*} e
*/
editInfo(e) {
let _id = e.currentTarget.dataset.set;
wx.redirectTo({
url: `../add/index?id=${_id}`,
})
},
// 手风琴
onChange(e) {
this.setData({
activeName: e.target.dataset.set
});
},
/**
* 查询数据列表
*/
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished&searchValue=subUsers";
subusersList(params).then(res => {
if (res.code == 200) {
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
},
/**
* 统计数据列表
*/
getListCount() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished&searchValue=subUsers";
subusersCount(params).then(res => {
if (res.code == 200) {
let _yrc = 0,
_ylc = 0;
res.data.forEach(item => {
if (item.useStatus == "0") {
_yrc = item.total;
} else {
_ylc = item.total;
}
});
this.setData({
yrcCount: _yrc,
ylcCount: _ylc
})
}
});
},
/**
* 标签切换
*/
trainJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if (index == 1) {
nav = '0';
} else {
nav = '1';
}
this.setData({
activeState: nav,
pageNum: 1,
pageSize: 10000,
listData: [],
});
this.getListData();
},
/**
@ -29,6 +169,28 @@ Page({
},
returnToPage: function () {
/*关闭当前页面,跳转到其它页面。*/
wx.redirectTo({
url: '../../project_more/index',
})
},
/**
* 滚动到底部
*/
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 {
console.log("已经到底了,没有数据可加载!!!");
}
},
/**
* 生命周期函数--监听页面隐藏
*/

View File

@ -1,3 +1,9 @@
{
"usingComponents": {}
"usingComponents": {
"van-collapse": "@vant/weapp/collapse",
"van-collapse-item": "@vant/weapp/collapse-item",
"van-cell-group": "@vant/weapp/cell-group",
"van-cell": "@vant/weapp/cell"
},
"navigationStyle": "custom"
}

View File

@ -1,2 +1,61 @@
<!--pages/project_subusers/list/index.wxml-->
<text>pages/project_subusers/list/index.wxml</text>
<view class="header_title">
<view class="header_title_row">
<van-row>
<van-col span="4">
<view class="header_img" bindtap="returnToPage">
<image src="/images/left.png"></image>
</view>
</van-col>
<van-col span="15">
<view class="header_name">班组人员管理</view>
</van-col>
</van-row>
</view>
</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=='0'?'active':''}}" bindtap="trainJump" data-index="1"><text>已入场({{yrcCount}}</text></view>
<view class="{{activeState=='1'?'active':''}}" bindtap="trainJump" data-index="2"><text>已离场({{ylcCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index">
<view class="inspect_for_bgd">
<view class="inspect_list_title">
<view class="inspect_list_title_label inspect_list_title_width">
<view class="inspect_list_title_number">{{index < 10 ?'0'+(index+1):(index+1)}}</view>
<view class="module_title module_title_flex inspect_list_title_text_2 color_orange">
{{item.subDeptName}}
</view>
</view>
</view>
<view class="inspect_list_info">
<van-collapse wx:for="{{item.groups}}" wx:for-item="groupItem" wx:for-index="groupIndex" wx:key="groupIndex" data-set="{{index+'_'+groupIndex}}" value="{{activeName}}" bind:change="onChange" accordion>
<van-collapse-item title="{{groupItem.subDeptGroupName+' ( '+groupItem.users.length+' )'}}" name="{{index+'_'+groupIndex}}" icon="qr">
<van-cell-group style="width: 100%;">
<van-cell wx:for="{{groupItem.users}}" wx:for-item="userItem" wx:for-index="userIndex" wx:key="userIndex" title="{{userItem.userName}}" cell-class="switch-cell" data-set="{{userItem.id}}" bindtap="getInfo" icon="vip-card-o">
<view class="module_see_info_edit" catchtap="editInfo" data-set="{{userItem.id}}">
<van-icon name="edit" /><text class="edit_text">修改</text>
</view>
</van-cell>
</van-cell-group>
</van-collapse-item>
</van-collapse>
</view>
</view>
</view>
<view wx:if="{{listData.length==0}}">
<view style="padding-top: 70px;text-align: -webkit-center;">
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
<view style="color: #a5abbb;">暂无数据</view>
</view>
</view>
<view wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>新增</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -1 +1,19 @@
/* pages/project_subusers/list/index.wxss */
/* pages/project_subDepts/index.wxss */
.module_see_info_edit {
color: #91ef4a;
font-weight: 600;
}
.module_see_info_edit .edit_text {
padding-left: 10rpx;
}
.van-cell{
color: #89a3ee !important;
background-color: #32374c !important;
}
.van-collapse-item__content{
padding: 0;
background-color: transparent !important;
}