提交代码

dev_xd
姜玉琦 2025-02-22 19:04:51 +08:00
parent 76d3f1513b
commit cb04fa4bca
4 changed files with 293 additions and 177 deletions

View File

@ -135,17 +135,20 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
proProjectInfoSubdeptsUsers.setSubStep(2L); proProjectInfoSubdeptsUsers.setSubStep(2L);
proProjectInfoSubdeptsUsers.setApproveStatus(ApproveStatus.passed.getCode()); proProjectInfoSubdeptsUsers.setApproveStatus(ApproveStatus.passed.getCode());
// 参建单位信息
ProProjectInfoSubdepts subDepts = proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(proProjectInfoSubdeptsUsers.getSubDeptId());
proProjectInfoSubdeptsUsers.setSubDeptType(subDepts.getSubDeptType());
SysUser sysUser = new SysUser(); SysUser sysUser = new SysUser();
sysUser.setComId(proProjectInfoSubdeptsUsers.getComId()); sysUser.setComId(subDepts.getComId());
sysUser.setDeptId(proProjectInfoSubdeptsUsers.getProjectId()); sysUser.setDeptId(subDepts.getProjectId());
sysUser.setUserName(proProjectInfoSubdeptsUsers.getUserPhone()); sysUser.setUserName(proProjectInfoSubdeptsUsers.getUserPhone());
sysUser.setNickName(proProjectInfoSubdeptsUsers.getUserName()); sysUser.setNickName(proProjectInfoSubdeptsUsers.getUserName());
sysUser.setPhonenumber(proProjectInfoSubdeptsUsers.getUserPhone()); sysUser.setPhonenumber(proProjectInfoSubdeptsUsers.getUserPhone());
sysUser.setUpdateBy(SecurityUtils.getUsername()); sysUser.setUpdateBy(SecurityUtils.getUsername());
sysUser.setUpdateTime(DateUtils.getNowDate()); sysUser.setUpdateTime(DateUtils.getNowDate());
sysUser.setComId(proProjectInfoSubdeptsUsers.getComId());
sysUser.setDeptId(proProjectInfoSubdeptsUsers.getProjectId());
sysUser.setUserInfos(proProjectInfoSubdeptsUsers.getUserInfos()); sysUser.setUserInfos(proProjectInfoSubdeptsUsers.getUserInfos());
String subDeptType = proProjectInfoSubdeptsUsers.getSubDeptType(); String subDeptType = proProjectInfoSubdeptsUsers.getSubDeptType();
// 判断单位类型 // 判断单位类型
if(Objects.nonNull(subDeptType)){ if(Objects.nonNull(subDeptType)){
@ -166,6 +169,12 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.XMJL.getCode())){ }else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.XMJL.getCode())){
sysUser.setUserType(UserTypeEnums.FBXMJL.getCode()); sysUser.setUserType(UserTypeEnums.FBXMJL.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.XMJL.getCode()); proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.XMJL.getCode());
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.AQZY.getCode())){
sysUser.setUserType(UserTypeEnums.FBAQRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.AQRY.getCode());
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.CLZY.getCode())){
sysUser.setUserType(UserTypeEnums.FBXMJL.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.CLRY.getCode());
}else{ }else{
sysUser.setUserType(UserTypeEnums.FBLWRY.getCode()); sysUser.setUserType(UserTypeEnums.FBLWRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.LWGR.getCode()); proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.LWGR.getCode());
@ -192,14 +201,12 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
} }
sysUser.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId()); sysUser.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId());
sysUser.setWorkType(proProjectInfoSubdeptsUsers.getWorkType()); Long userId= remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER).getData();
R<Long> obj= remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
Long userId= obj.getData();
proProjectInfoSubdeptsUsers.setUserId(userId); proProjectInfoSubdeptsUsers.setUserId(userId);
int res = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers); int res = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
uniService.syncUniUser(proProjectInfoSubdeptsUsers); uniService.syncUniUser(proProjectInfoSubdeptsUsers);
if(res>0 && (Objects.equals(SubDeptsEnums.ZYFB.getCode(),subDeptType) || Objects.equals(SubDeptsEnums.LWFB.getCode(),subDeptType)) && Objects.nonNull(proProjectInfoSubdeptsUsers.getUserPost())){ String userPost = proProjectInfoSubdeptsUsers.getUserPost();
if(res>0 && (Objects.equals(UserPostEnums.WTDL.getCode(),userPost) || Objects.equals(UserPostEnums.XMJL.getCode(),userPost) || Objects.equals(UserPostEnums.BZZ.getCode(),userPost))){
// 生成二维码 // 生成二维码
try { try {
String accessToken = wxMaService.getAccessToken(); String accessToken = wxMaService.getAccessToken();
@ -208,7 +215,10 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
String profilePath = ProfileConfig.profile+"/"+filePath; String profilePath = ProfileConfig.profile+"/"+filePath;
log.info("accessToken...{}",accessToken); log.info("accessToken...{}",accessToken);
// 生成二维码 // 生成二维码
if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(), UserPostEnums.XMJL.getCode())){ 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); File file = wxMaService.getQrcodeService().createQrcode("pages/project_qr/index?SIGID=3&QRPID="+proProjectInfoSubdeptsUsers.getProjectId()+"&PARID="+proProjectInfoSubdeptsUsers.getId(),280);
FileUtil.copyFile(file,new File(savePath)); FileUtil.copyFile(file,new File(savePath));
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(), UserPostEnums.BZZ.getCode())){ }else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(), UserPostEnums.BZZ.getCode())){
@ -477,21 +487,112 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
@Override @Override
public int updateProProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers) public int updateProProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers)
{ {
//判断工种岗位设置用户岗位...PC需要单独设置
if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.WTDL.getCode())){ // 参建单位信息
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.WTDL.getCode()); ProProjectInfoSubdepts subDepts = proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(proProjectInfoSubdeptsUsers.getSubDeptId());
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.XMJL.getCode())){ proProjectInfoSubdeptsUsers.setSubDeptType(subDepts.getSubDeptType());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.XMJL.getCode());
}else{ SysUser sysUser = new SysUser();
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.LWGR.getCode()); sysUser.setComId(subDepts.getComId());
sysUser.setDeptId(subDepts.getProjectId());
sysUser.setUserName(proProjectInfoSubdeptsUsers.getUserPhone());
sysUser.setNickName(proProjectInfoSubdeptsUsers.getUserName());
sysUser.setPhonenumber(proProjectInfoSubdeptsUsers.getUserPhone());
sysUser.setUpdateBy(SecurityUtils.getUsername());
sysUser.setUpdateTime(DateUtils.getNowDate());
sysUser.setUserInfos(proProjectInfoSubdeptsUsers.getUserInfos());
String subDeptType = proProjectInfoSubdeptsUsers.getSubDeptType();
// 判断单位类型
if(Objects.nonNull(subDeptType)){
if(Objects.equals(SubDeptsEnums.JSDW.getCode(),subDeptType)){
sysUser.setUserType(UserTypeEnums.JSDWRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.JSDWGL.getCode());
}else if(Objects.equals(SubDeptsEnums.JLDW.getCode(),subDeptType)){
sysUser.setUserType(UserTypeEnums.JLDWRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.JLDWGL.getCode());
}else if(Objects.equals(SubDeptsEnums.SGDW.getCode(),subDeptType)){
sysUser.setUserType(UserTypeEnums.SGDWRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.SGDWGL.getCode());
}else if(Objects.equals(SubDeptsEnums.ZYFB.getCode(),subDeptType) || Objects.equals(SubDeptsEnums.LWFB.getCode(),subDeptType)){
//判断工种岗位设置用户岗位...PC需要单独设置
if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.WTDL.getCode())){
sysUser.setUserType(UserTypeEnums.FBWTDL.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.WTDL.getCode());
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.XMJL.getCode())){
sysUser.setUserType(UserTypeEnums.FBXMJL.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.XMJL.getCode());
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.AQZY.getCode())){
sysUser.setUserType(UserTypeEnums.FBAQRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.AQRY.getCode());
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getCraftPost(), CraftPostEnums.CLZY.getCode())){
sysUser.setUserType(UserTypeEnums.FBXMJL.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.CLRY.getCode());
}else{
sysUser.setUserType(UserTypeEnums.FBLWRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.LWGR.getCode());
}
}else if(Objects.equals(SubDeptsEnums.CLFB.getCode(),subDeptType)){
sysUser.setUserType(UserTypeEnums.CLFBRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.CLFBGL.getCode());
}else if(Objects.equals(SubDeptsEnums.HQFB.getCode(),subDeptType)){
sysUser.setUserType(UserTypeEnums.HQFBRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.HQFBGL.getCode());
}else if(Objects.equals(SubDeptsEnums.TSSB.getCode(),subDeptType)){
sysUser.setUserType(UserTypeEnums.TSSBRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.TSSBGL.getCode());
}else if(Objects.equals(SubDeptsEnums.KTDW.getCode(),subDeptType)){
sysUser.setUserType(UserTypeEnums.KTDWRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.KTDWGL.getCode());
}else if(Objects.equals(SubDeptsEnums.SJDW.getCode(),subDeptType)){
sysUser.setUserType(UserTypeEnums.SJDWRY.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.SJDWGL.getCode());
}else if(Objects.equals(SubDeptsEnums.QTDW.getCode(),subDeptType)){
sysUser.setUserType(UserTypeEnums.OTHERS.getCode());
proProjectInfoSubdeptsUsers.setUserPost(UserPostEnums.QTDWGL.getCode());
}
} }
ProProjectInfoSubdeptsUsers old=proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(proProjectInfoSubdeptsUsers.getId());
sysUser.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId());
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER).getData();
ProProjectInfoSubdeptsUsers old = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(proProjectInfoSubdeptsUsers.getId());
proProjectInfoSubdeptsUsers.setUpdateBy(SecurityUtils.getUsername()); proProjectInfoSubdeptsUsers.setUpdateBy(SecurityUtils.getUsername());
proProjectInfoSubdeptsUsers.setUpdateTime(DateUtils.getNowDate()); proProjectInfoSubdeptsUsers.setUpdateTime(DateUtils.getNowDate());
proProjectInfoSubdeptsUsers.setAdmitGuid(old.getAdmitGuid()); proProjectInfoSubdeptsUsers.setAdmitGuid(old.getAdmitGuid());
proProjectInfoSubdeptsUsers.setFaceGuid(old.getFaceGuid()); proProjectInfoSubdeptsUsers.setFaceGuid(old.getFaceGuid());
proProjectInfoSubdeptsUsers.setUserId(old.getUserId()); proProjectInfoSubdeptsUsers.setUserId(old.getUserId());
uniService.syncUniUser(proProjectInfoSubdeptsUsers); uniService.syncUniUser(proProjectInfoSubdeptsUsers);
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(), 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());
}
}
}
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers); return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
} }

View File

@ -53,7 +53,7 @@ Page({
craftType: null, craftType: null,
craftPost: null, craftPost: null,
leaderDegreeGrade: null, leaderDegreeGrade: null,
userInfos:{}, userInfos: {},
degreeGrade: null degreeGrade: null
}, },
parForm: {}, parForm: {},
@ -191,10 +191,13 @@ Page({
"id": "4", "id": "4",
"text": "劳务人员" "text": "劳务人员"
}); });
this.setData({
"form.craftType": '1'
});
} }
this.setData({ this.setData({
title, title,
active:0, active: 0,
proId: options.QRPID, proId: options.QRPID,
userPost: options.SIGID, userPost: options.SIGID,
"form.userPost": options.SIGID, "form.userPost": options.SIGID,
@ -244,7 +247,7 @@ Page({
} }
}); });
this.setData({ this.setData({
craftPostList:list, craftPostList: list,
craftPostAllOrginList: res.data craftPostAllOrginList: res.data
}); });
} }
@ -320,117 +323,117 @@ Page({
} }
}, },
initData(phoneNumber){ initData(phoneNumber) {
//使用手机号码查询详情 //使用手机号码查询详情
if (this.data.userPost == "1") { if (this.data.userPost == "1") {
findProSubDeptsInfo(this.data.proId, phoneNumber).then(deptRes => { findProSubDeptsInfo(this.data.proId, phoneNumber).then(deptRes => {
if (deptRes.code == 200 && deptRes.data) { if (deptRes.code == 200 && deptRes.data) {
deptRes.data.subDeptLeaderPhone = phoneNumber; deptRes.data.subDeptLeaderPhone = phoneNumber;
if(deptRes.data.proProjectInfoSubdeptsUsers){ if (deptRes.data.proProjectInfoSubdeptsUsers) {
deptRes.data.leaderDegreeGrade = deptRes.data.proProjectInfoSubdeptsUsers.degreeGrade; deptRes.data.leaderDegreeGrade = deptRes.data.proProjectInfoSubdeptsUsers.degreeGrade;
deptRes.data.eduFilePath = deptRes.data.proProjectInfoSubdeptsUsers.eduFilePath; deptRes.data.eduFilePath = deptRes.data.proProjectInfoSubdeptsUsers.eduFilePath;
deptRes.data.subStep = deptRes.data.proProjectInfoSubdeptsUsers.subStep; deptRes.data.subStep = deptRes.data.proProjectInfoSubdeptsUsers.subStep;
} }
if (deptRes.data.businessLicensePath) { if (deptRes.data.businessLicensePath) {
deptRes.data.businessLicensePath = (this.data.imgBase + deptRes.data.businessLicensePath).split(','); deptRes.data.businessLicensePath = (this.data.imgBase + deptRes.data.businessLicensePath).split(',');
} }
if (deptRes.data.subDeptInfos) { if (deptRes.data.subDeptInfos) {
let subDeptInfosJSON = JSON.parse(deptRes.data.subDeptInfos); let subDeptInfosJSON = JSON.parse(deptRes.data.subDeptInfos);
deptRes.data.subDeptInfos = subDeptInfosJSON; deptRes.data.subDeptInfos = subDeptInfosJSON;
if (deptRes.data.subDeptInfos.legalPersonCardImgPos) { if (deptRes.data.subDeptInfos.legalPersonCardImgPos) {
deptRes.data.subDeptInfos.legalPersonCardImgPos = (this.data.imgBase + deptRes.data.subDeptInfos.legalPersonCardImgPos).split(','); 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(',');
}
}
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.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(',');
}
this.setData({
form: deptRes.data,
userPhoneNumber: phoneNumber,
active: deptRes.data.subStep
});
if (deptRes.data.proProjectInfoSubdeptsUsers.subStep == 1) {
this.initBusEduVideos(false);
} else if (deptRes.data.proProjectInfoSubdeptsUsers.subStep == 2) {
this.initBusEduQuestion(false);
} else if (deptRes.data.proProjectInfoSubdeptsUsers.subStep == 3) {
this.startSignFile(false);
}
} else {
this.setData({
userPhoneNumber: phoneNumber,
"form.subDeptLeaderPhone": phoneNumber,
});
} }
if (deptRes.data.subDeptInfos.legalPersonCardImgInv) {
deptRes.data.subDeptInfos.legalPersonCardImgInv = (this.data.imgBase + deptRes.data.subDeptInfos.legalPersonCardImgInv).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.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(',');
}
this.setData({
form: deptRes.data,
userPhoneNumber: phoneNumber,
active: deptRes.data.subStep
}); });
if (deptRes.data.proProjectInfoSubdeptsUsers.subStep == 1) {
this.initBusEduVideos(false);
} else if (deptRes.data.proProjectInfoSubdeptsUsers.subStep == 2) {
this.initBusEduQuestion(false);
} else if (deptRes.data.proProjectInfoSubdeptsUsers.subStep == 3) {
this.startSignFile(false);
}
} else { } else {
this.setData({ findProSubDeptsUser(this.data.proId, phoneNumber).then(userRes => {
userPhoneNumber: phoneNumber, if (userRes.code == 200 && userRes.data) {
"form.subDeptLeaderPhone": phoneNumber, 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;
}
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(',');
}
this.setData({
form: userRes.data,
userPhoneNumber: phoneNumber,
"form.userPhone": phoneNumber,
active: userRes.data.subStep
});
if (userRes.data.subStep == 1) {
this.initBusEduVideos(false);
} else if (userRes.data.subStep == 2) {
this.initBusEduQuestion(false);
} else if (userRes.data.subStep == 3) {
this.startSignFile(false);
}
} else {
this.setData({
userPhoneNumber: phoneNumber,
"form.userPhone": phoneNumber,
});
}
}); });
} }
});
} else {
findProSubDeptsUser(this.data.proId, phoneNumber).then(userRes => {
if (userRes.code == 200 && userRes.data) {
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;
}
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(',');
}
this.setData({
form: userRes.data,
userPhoneNumber: phoneNumber,
"form.userPhone": phoneNumber,
active: userRes.data.subStep
});
if (userRes.data.subStep == 1) {
this.initBusEduVideos(false);
} else if (userRes.data.subStep == 2) {
this.initBusEduQuestion(false);
} else if (userRes.data.subStep == 3) {
this.startSignFile(false);
}
} else {
this.setData({
userPhoneNumber: phoneNumber,
"form.userPhone": phoneNumber,
});
}
});
}
}, },
/** /**
@ -591,8 +594,8 @@ if (this.data.userPost == "1") {
}) })
_busExamQuestions[idxs[0]].questionOption[idxs[1]].selected = true; _busExamQuestions[idxs[0]].questionOption[idxs[1]].selected = true;
let _userAnswer = []; let _userAnswer = [];
_busExamQuestions[idxs[0]].questionOption.forEach(item =>{ _busExamQuestions[idxs[0]].questionOption.forEach(item => {
if(item.selected){ if (item.selected) {
_userAnswer.push(item.opt); _userAnswer.push(item.opt);
} }
}); });
@ -613,8 +616,8 @@ if (this.data.userPost == "1") {
let _busExamQuestions = this.data.busExamQuestions; let _busExamQuestions = this.data.busExamQuestions;
_busExamQuestions[idxs[0]].questionOption[idxs[1]].selected = !_busExamQuestions[idxs[0]].questionOption[idxs[1]].selected; _busExamQuestions[idxs[0]].questionOption[idxs[1]].selected = !_busExamQuestions[idxs[0]].questionOption[idxs[1]].selected;
let _userAnswer = []; let _userAnswer = [];
_busExamQuestions[idxs[0]].questionOption.forEach(item =>{ _busExamQuestions[idxs[0]].questionOption.forEach(item => {
if(item.selected){ if (item.selected) {
_userAnswer.push(item.opt); _userAnswer.push(item.opt);
} }
}); });
@ -950,13 +953,13 @@ if (this.data.userPost == "1") {
}); });
file.forEach(async (item, idx) => { file.forEach(async (item, idx) => {
let obj = await this.syncUploadImage(item); let obj = await this.syncUploadImage(item);
findCardOcrFront(obj.data.data.url).then(res =>{ findCardOcrFront(obj.data.data.url).then(res => {
if(res.code==200){ if (res.code == 200) {
this.setData({ this.setData({
"form.subDeptInfos.legalPerson": res.data.name, "form.subDeptInfos.legalPerson": res.data.name,
"form.subDeptInfos.legalPersonCard": res.data.cardId "form.subDeptInfos.legalPersonCard": res.data.cardId
}) })
if(!res.data.name || !res.data.cardId){ if (!res.data.name || !res.data.cardId) {
this.setData({ this.setData({
"form.subDeptInfos.legalPersonCardImgPos": [] "form.subDeptInfos.legalPersonCardImgPos": []
}); });
@ -1031,8 +1034,8 @@ if (this.data.userPost == "1") {
}); });
file.forEach(async (item, idx) => { file.forEach(async (item, idx) => {
let obj = await this.syncUploadImage(item); let obj = await this.syncUploadImage(item);
findCardOcrFront(obj.data.data.url).then(res =>{ findCardOcrFront(obj.data.data.url).then(res => {
if(res.code==200){ if (res.code == 200) {
this.setData({ this.setData({
"form.subDeptLeaderName": res.data.name, "form.subDeptLeaderName": res.data.name,
"form.subDeptLeaderCode": res.data.cardId, "form.subDeptLeaderCode": res.data.cardId,
@ -1040,7 +1043,7 @@ if (this.data.userPost == "1") {
"form.nativePlace": res.data.native, "form.nativePlace": res.data.native,
"form.address": res.data.address "form.address": res.data.address
}) })
if(!res.data.name || !res.data.cardId){ if (!res.data.name || !res.data.cardId) {
this.setData({ this.setData({
"form.leaderCardImgPos": [] "form.leaderCardImgPos": []
}); });
@ -1130,11 +1133,11 @@ if (this.data.userPost == "1") {
*/ */
onChageUserPost(e) { onChageUserPost(e) {
this.setData({ this.setData({
userPost:e.detail.id, userPost: e.detail.id,
"form.userPost": e.detail.id, "form.userPost": e.detail.id,
"form.craftPost": null "form.craftPost": null
}) })
if(e.detail.id=='3'){ if (e.detail.id == '3') {
let craftPostList = []; let craftPostList = [];
this.data.craftPostAllOrginList.forEach(item => { this.data.craftPostAllOrginList.forEach(item => {
if (item.cssClass == '1') { if (item.cssClass == '1') {
@ -1149,7 +1152,7 @@ if (this.data.userPost == "1") {
"form.craftType": '1', "form.craftType": '1',
"form.craftPost": null "form.craftPost": null
}) })
} else if(e.detail.id=='5'){ } else if (e.detail.id == '5') {
let craftPostList = []; let craftPostList = [];
this.data.craftPostAllOrginList.forEach(item => { this.data.craftPostAllOrginList.forEach(item => {
if (item.cssClass == '2') { if (item.cssClass == '2') {
@ -1208,13 +1211,13 @@ if (this.data.userPost == "1") {
this.setData({ this.setData({
"form.cardImgPos": file "form.cardImgPos": file
}); });
console.log("filefilefilefile",file) console.log("filefilefilefile", file)
file.forEach(async (item, idx) => { file.forEach(async (item, idx) => {
let obj = await this.syncUploadImage(item); let obj = await this.syncUploadImage(item);
findCardOcrFront(obj.data.data.url).then(res =>{ findCardOcrFront(obj.data.data.url).then(res => {
if(res.code==200){ if (res.code == 200) {
if(res.data.nation.indexOf("族")<0){ if (res.data.nation.indexOf("族") < 0) {
res.data.nation = res.data.nation+"族"; res.data.nation = res.data.nation + "族";
} }
this.setData({ this.setData({
"form.userName": res.data.name, "form.userName": res.data.name,
@ -1223,7 +1226,7 @@ if (this.data.userPost == "1") {
"form.nativePlace": res.data.native, "form.nativePlace": res.data.native,
"form.address": res.data.address "form.address": res.data.address
}) })
if(!res.data.name || !res.data.cardId){ if (!res.data.name || !res.data.cardId) {
this.setData({ this.setData({
"form.cardImgPos": [] "form.cardImgPos": []
}); });
@ -1301,7 +1304,7 @@ if (this.data.userPost == "1") {
* 个人民族 * 个人民族
* @param {*} e * @param {*} e
*/ */
inputOriginNation(e){ inputOriginNation(e) {
this.setData({ this.setData({
"form.nation": e.detail.value "form.nation": e.detail.value
}) })
@ -1460,9 +1463,9 @@ if (this.data.userPost == "1") {
if (!form.subDeptLeaderCode) { if (!form.subDeptLeaderCode) {
app.toast("请填写委托人身份证号!"); app.toast("请填写委托人身份证号!");
return false; return false;
}else{ } 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])$/; 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.subDeptLeaderCode)){ if (!cardCodePattern.test(form.subDeptLeaderCode)) {
app.toast("身份证号码不正确!"); app.toast("身份证号码不正确!");
return false; return false;
} }
@ -1490,9 +1493,9 @@ if (this.data.userPost == "1") {
if (!form.contactPhone) { if (!form.contactPhone) {
app.toast("请填写紧急联系人电话!"); app.toast("请填写紧急联系人电话!");
return false; return false;
}else{ } else {
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/; const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if(!phonePattern.test(form.contactPhone)){ if (!phonePattern.test(form.contactPhone)) {
app.toast("紧急联系人电话不正确!"); app.toast("紧急联系人电话不正确!");
return false; return false;
} }
@ -1617,12 +1620,17 @@ if (this.data.userPost == "1") {
leaderUserInfos.cardImgPos = _form.leaderCardImgPos; leaderUserInfos.cardImgPos = _form.leaderCardImgPos;
leaderUserInfos.cardImgInv = _form.leaderCardImgInv; leaderUserInfos.cardImgInv = _form.leaderCardImgInv;
_form.leaderUserInfos = JSON.stringify(leaderUserInfos); _form.leaderUserInfos = JSON.stringify(leaderUserInfos);
if(_form.proProjectInfoSubdeptsUsers && _form.proProjectInfoSubdeptsUsers.userInfos){ if (_form.proProjectInfoSubdeptsUsers && _form.proProjectInfoSubdeptsUsers.userInfos) {
_form.proProjectInfoSubdeptsUsers.userInfos = JSON.stringify(_form.proProjectInfoSubdeptsUsers.userInfos); _form.proProjectInfoSubdeptsUsers.userInfos = JSON.stringify(_form.proProjectInfoSubdeptsUsers.userInfos);
} }
wx.showLoading({mask: true,title: '正在处理'}); wx.showLoading({
mask: true,
title: '正在处理'
});
registerSubDepts(_form).then(res => { registerSubDepts(_form).then(res => {
wx.hideLoading({success: (r) => {}}); wx.hideLoading({
success: (r) => {}
});
if (res.code == 200) { if (res.code == 200) {
this.setData({ this.setData({
"form.id": res.data.id, "form.id": res.data.id,
@ -1667,7 +1675,7 @@ if (this.data.userPost == "1") {
app.toast("请上传进场半身近照!"); app.toast("请上传进场半身近照!");
return false; return false;
} }
if(userPost == '2' || userPost == '6'){ if (userPost == '2' || userPost == '6') {
if (!form.subDeptPowerPath || form.subDeptPowerPath.length == 0) { if (!form.subDeptPowerPath || form.subDeptPowerPath.length == 0) {
app.toast("请上传委托人单位委托书!"); app.toast("请上传委托人单位委托书!");
return false; return false;
@ -1680,9 +1688,9 @@ if (this.data.userPost == "1") {
if (!form.cardCode) { if (!form.cardCode) {
app.toast("请填写身份证号!"); app.toast("请填写身份证号!");
return false; return false;
}else{ } 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])$/; 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)){ if (!cardCodePattern.test(form.cardCode)) {
app.toast("身份证号码不正确!"); app.toast("身份证号码不正确!");
return false; return false;
} }
@ -1710,9 +1718,9 @@ if (this.data.userPost == "1") {
if (!form.contactPhone) { if (!form.contactPhone) {
app.toast("请填写紧急联系人电话!"); app.toast("请填写紧急联系人电话!");
return false; return false;
}else{ } else {
const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/; const phonePattern = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
if(!phonePattern.test(form.contactPhone)){ if (!phonePattern.test(form.contactPhone)) {
app.toast("紧急联系人电话不正确!"); app.toast("紧急联系人电话不正确!");
return false; return false;
} }
@ -1823,9 +1831,14 @@ if (this.data.userPost == "1") {
userInfos.cardImgPos = _form.cardImgPos; userInfos.cardImgPos = _form.cardImgPos;
userInfos.cardImgInv = _form.cardImgInv; userInfos.cardImgInv = _form.cardImgInv;
_form.userInfos = JSON.stringify(userInfos); _form.userInfos = JSON.stringify(userInfos);
wx.showLoading({mask: true,title: '正在处理'}); wx.showLoading({
mask: true,
title: '正在处理'
});
registerSubDeptsUsers(_form).then(res => { registerSubDeptsUsers(_form).then(res => {
wx.hideLoading({success: (res) => {}}); wx.hideLoading({
success: (res) => {}
});
if (res.code == 200) { if (res.code == 200) {
this.setData({ this.setData({
"form.id": res.data.id, "form.id": res.data.id,
@ -2032,8 +2045,10 @@ if (this.data.userPost == "1") {
/** /**
* 立即登录 * 立即登录
*/ */
wxSignLogin(){ wxSignLogin() {
wxNumberLogin({'username':this.data.userPhoneNumber}).then(res =>{ wxNumberLogin({
'username': this.data.userPhoneNumber
}).then(res => {
setToken(res.data.access_token); setToken(res.data.access_token);
this.getUserInfoByCache(); this.getUserInfoByCache();
}) })
@ -2045,8 +2060,8 @@ if (this.data.userPost == "1") {
* @param {*} e * @param {*} e
*/ */
getUserInfoByCache: function () { getUserInfoByCache: function () {
findUserInfoByCache().then(res=>{ findUserInfoByCache().then(res => {
if(res.code==200){ if (res.code == 200) {
setUserInfo(res.user); setUserInfo(res.user);
app.globalData.userData = res.user; app.globalData.userData = res.user;
this.getMyProjectList(); this.getMyProjectList();
@ -2060,15 +2075,15 @@ if (this.data.userPost == "1") {
* 根据项目配置进入不同页面... * 根据项目配置进入不同页面...
*/ */
getMyProjectList: function () { getMyProjectList: function () {
findMyProjectList().then(res=>{ findMyProjectList().then(res => {
if(res.code==200){ if (res.code == 200) {
app.globalData.projectInfoList = res.rows; app.globalData.projectInfoList = res.rows;
if(res.rows.length>0){ if (res.rows.length > 0) {
if(res.rows.length==1){ if (res.rows.length == 1) {
app.globalData.useProjectId = res.rows[0].id; app.globalData.useProjectId = res.rows[0].id;
app.globalData.useProjectName = res.rows[0].projectName; app.globalData.useProjectName = res.rows[0].projectName;
findProSubDeptsUserInfo(app.globalData.useProjectId).then(detail=>{ findProSubDeptsUserInfo(app.globalData.useProjectId).then(detail => {
if(detail.code==200){ if (detail.code == 200) {
let userInfo = getUserInfo(); let userInfo = getUserInfo();
userInfo.projectUserInfo = detail.data; userInfo.projectUserInfo = detail.data;
setUserInfo(userInfo); setUserInfo(userInfo);
@ -2078,13 +2093,13 @@ if (this.data.userPost == "1") {
}) })
} }
}); });
}else{ } else {
//多项目进入项目切换页面 //多项目进入项目切换页面
wx.redirectTo({ wx.redirectTo({
url: '../project_list/index', url: '../project_list/index',
}) })
} }
}else{ } else {
app.toast("未查询到当前用户项目,信息审核中或人员已离场"); app.toast("未查询到当前用户项目,信息审核中或人员已离场");
return false; return false;
} }

View File

@ -128,11 +128,11 @@
<el-button v-if="scope.row.subDeptType != '4' && scope.row.subDeptType != '5'" link disabled> - </el-button> <el-button v-if="scope.row.subDeptType != '4' && scope.row.subDeptType != '5'" link disabled> - </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="人员岗位" align="center" prop="craftPost"> <!-- <el-table-column label="人员岗位" align="center" prop="craftPost">
<template #default="scope"> <template #default="scope">
{{ getWorkType(scope.row.workType) }} {{ getWorkType(scope.row.workType) }}
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="状态" align="center" prop="useStatus"> <el-table-column label="状态" align="center" prop="useStatus">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.useStatus == 0" style="color: green;"></span> <span v-if="scope.row.useStatus == 0" style="color: green;"></span>
@ -385,7 +385,7 @@ const data = reactive({
userWorkType: null, userWorkType: null,
workType: null, workType: null,
activeTags:"finished", activeTags:"finished",
searchValue:"pt1" searchValue:"active1"
}, },
rules: { rules: {
subDeptId: [{ required: true, trigger: ['blur', 'change'], message: "请选择所属单位" }], subDeptId: [{ required: true, trigger: ['blur', 'change'], message: "请选择所属单位" }],

View File

@ -150,7 +150,7 @@
<el-form-item label="用户类型" prop="userType"> <el-form-item label="用户类型" prop="userType">
<el-select v-model="form.userType" placeholder="请选择用户类型" style="width: 100%" <el-select v-model="form.userType" placeholder="请选择用户类型" style="width: 100%"
@change="doRoleChange"> @change="doRoleChange">
<el-option v-for="dict in sys_user_type" :key="dict.value" :label="dict.label" <el-option v-for="dict in sys_user_type" v-show="dict.value != '99'" :key="dict.value" :label="dict.label"
:value="dict.value" /> :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>