Compare commits

...

2 Commits

Author SHA1 Message Date
姜玉琦 b02c67b7a3 Merge branch 'dev_xd' of http://62.234.3.186:3000/jiangyq/YZProjectCloud into dev_xd 2024-12-30 00:31:13 +08:00
姜玉琦 f8ebc6679b 提交代码 2024-12-30 00:31:06 +08:00
22 changed files with 679 additions and 219 deletions

View File

@ -5,20 +5,22 @@ package com.yanzhu.common.core.enums;
*/
public enum UserTypeEnums {
ZSRY("00", "正式人员"),
LSRY("08", "临时人员"),
FBWTDL("80", "分包代理人"),
FBXMJL("79", "分包项目经理"),
FBBZZZ("78", "分包班组组长"),
FBLWRY("77", "分包劳务人员");
ZSRY("00", "正式人员",""),
LSRY("08", "临时人员",""),
FBWTDL("80", "分包代理人","fbwtdl"),
FBXMJL("79", "分包项目经理","fbxmjl"),
FBBZZZ("78", "分包班组组长","fbbzzz"),
FBLWRY("77", "分包劳务人员","");
private final String code;
private final String info;
private final String keys;
UserTypeEnums(String code, String info)
UserTypeEnums(String code, String info, String keys)
{
this.code = code;
this.info = info;
this.keys = keys;
}
public String getCode()
@ -31,4 +33,9 @@ public enum UserTypeEnums {
return info;
}
public String getKeys()
{
return keys;
}
}

View File

@ -55,6 +55,9 @@ public class FlowTaskEntity extends BaseEntity {
@ApiModelProperty("流程发起人名称")
private String startUserName;
@ApiModelProperty("流程发起人班组")
private Long startUserGroupId;
@ApiModelProperty("流程发起人单位")
private String startDeptName;
@ -406,4 +409,12 @@ public class FlowTaskEntity extends BaseEntity {
public void setBusinessMk3(String businessMk3) {
this.businessMk3 = businessMk3;
}
public Long getStartUserGroupId() {
return startUserGroupId;
}
public void setStartUserGroupId(Long startUserGroupId) {
this.startUserGroupId = startUserGroupId;
}
}

View File

@ -1,6 +1,7 @@
package com.yanzhu.flowable.mapper;
import com.yanzhu.flowable.domain.my.FlowTaskEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@ -66,4 +67,11 @@ public interface FlowBusinessKeyMapper {
*/
public List<Map<String, Object>> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity);
/**
*
* @param proId
* @param userId
* @return
*/
public List<Map<String, Object>> selectMySubdeptsGroups(@Param("proId")Long proId, @Param("userId")Long userId);
}

View File

@ -123,6 +123,15 @@ public interface SysRoleMapper
*/
public List<SysRole> findDeptRoleListByDeptId(Long deptId);
/**
* ID
*
* @param deptId ID
* @param roleKey
* @return
*/
public List<SysRole> findDeptRoleListByDeptIdAndKey(@Param("deptId") Long deptId, @Param("roleKey") String roleKey);
/**
* ID
*

View File

@ -69,7 +69,9 @@
<if test="startProId != null and startProId != ''"> and fa.startProId = #{startProId}</if>
<if test="startProName != null and startProName != ''"> and fa.startProName like concat('%', #{startProName}, '%')</if>
<if test='activeTags == "depts"'> and fa.category = '1'</if>
<if test='activeTags == "users"'> and fa.category in ('2','3','4')</if>
<if test='activeTags == "users"'> and fa.category in ('2','3','4')
<if test="startUserGroupId != null"> and bus.sub_dept_group = #{startUserGroupId}</if>
</if>
<if test="assigneeId != null and roleIds != null and roleIds.size()>0">
AND (fa.ASSIGNEE_ = #{assigneeId}
OR (
@ -145,4 +147,11 @@
order by fa.endTime desc
</select>
<!--查询我的已办任务-->
<select id="selectMySubdeptsGroups" resultType="Map">
select * from pro_project_info_subdepts_users where project_id = #{proId} and user_id = #{userId} and user_post=3 and is_del=0
</select>
</mapper>

View File

@ -89,6 +89,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by r.role_sort
</select>
<select id="findDeptRoleListByDeptIdAndKey" resultMap="SysRoleResult">
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
r.status, r.del_flag, r.create_time, r.remark
from sys_role r
left join sys_role_dept rd on rd.role_id = r.role_id
where r.del_flag = '0' and rd.dept_id = ${deptId} and r.role_key like concat('%', #{roleKey}, '%')
order by r.role_sort
</select>
<select id="findDeptRoleListByComId" parameterType="Long" resultMap="SysRoleSysRoleDeptResult">
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
r.status, r.del_flag, r.create_time, r.remark, rd.role_id as sub_role_id, rd.dept_id as sub_dept_id, d.dept_name as sub_dept_name

View File

@ -203,8 +203,11 @@ public class FlowBusinessKeyController extends BaseController {
* @return AjaxResult
*/
@GetMapping(value = "/findMyTask")
public AjaxResult findMyTask() {
public AjaxResult findMyTask(String proId) {
FlowTaskEntity flowTaskEntity = new FlowTaskEntity();
if(StringUtils.isNotEmpty(proId)){
flowTaskEntity.setStartProId(proId);
}
flowTaskEntity.setAssigneeId(SecurityUtils.getUserId());
List<SysRole> roles = SecurityUtils.getLoginUser().getSysUser().getRoles();
if(StringUtils.isNotEmpty(roles)){
@ -216,12 +219,19 @@ public class FlowBusinessKeyController extends BaseController {
flowTaskEntity.setRoleIds(roleIds);
}
List<Map<String, Object>> list = flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity);
Map<String, Long> sumByCategory = list.stream()
.collect(Collectors.groupingBy(
map -> (String) map.get("category"),
Collectors.counting()
));
Map<String,Object> data = new HashMap<>();
if(CollectionUtils.isNotEmpty(list)){
data.put("todo",list.size());
}else{
data.put("todo",0);
}
data.put("dwsh",Convert.toInt(sumByCategory.get("1"),0));
data.put("rysh",Convert.toInt(sumByCategory.get("2"),0)+Convert.toInt(sumByCategory.get("3"),0)+Convert.toInt(sumByCategory.get("4"),0));
return success(data);
}

View File

@ -1,6 +1,8 @@
package com.yanzhu.flowable.service.impl;
import com.yanzhu.common.core.text.Convert;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.flowable.domain.my.FlowTaskEntity;
import com.yanzhu.flowable.mapper.FlowBusinessKeyMapper;
import com.yanzhu.flowable.service.IFlowBusinessKeyService;
@ -8,10 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
*
@ -43,10 +42,19 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
*/
@Override
public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity) {
flowTaskEntity.setActiveTags("await");
// 查询用户是否是班组长...
if(Objects.nonNull(flowTaskEntity.getAssigneeId())){
List<Map<String, Object>> groups = flowBusinessKeyMapper.selectMySubdeptsGroups(Convert.toLong(flowTaskEntity.getStartProId()),SecurityUtils.getUserId());
if(StringUtils.isNotEmpty(groups)){
flowTaskEntity.setStartUserGroupId(Convert.toLong(groups.get(0).get("sub_dept_group")));
}
}
int awaitSize = flowBusinessKeyMapper.selectMyAwaitFlowTask(flowTaskEntity).size();
flowTaskEntity.setActiveTags("finished");
int finishedSize = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity).size();
FlowTaskEntity finishedQuery = new FlowTaskEntity();
finishedQuery.setAssigneeId(SecurityUtils.getUserId());
finishedQuery.setStartProId(flowTaskEntity.getStartProId());
finishedQuery.setActiveTags(flowTaskEntity.getActiveTags());
int finishedSize = flowBusinessKeyMapper.selectMyFinishedFlowTask(finishedQuery).size();
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("await",awaitSize);
dataMap.put("finished",finishedSize);
@ -87,6 +95,13 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
*/
@Override
public List<Map<String, Object>> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity){
// 查询用户是否是班组长...
if(Objects.nonNull(flowTaskEntity.getAssigneeId())){
List<Map<String, Object>> groups = flowBusinessKeyMapper.selectMySubdeptsGroups(Convert.toLong(flowTaskEntity.getStartProId()),SecurityUtils.getUserId());
if(StringUtils.isNotEmpty(groups)){
flowTaskEntity.setStartUserGroupId(Convert.toLong(groups.get(0).get("sub_dept_group")));
}
}
return flowBusinessKeyMapper.selectMyAwaitFlowTask(flowTaskEntity);
}

View File

@ -98,6 +98,7 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
sysUser.setCreateBy(SecurityUtils.getUsername());
sysUser.setCreateTime(DateUtils.getNowDate());
sysUser.setRemark(proProjectInfoSubdeptsGroup.getSubDeptName());
sysUser.setActiveProjectId(proProjectInfoSubdeptsGroup.getProjectId());
try {
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
}catch (Exception e){
@ -136,6 +137,7 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
sysUser.setCreateBy(SecurityUtils.getUsername());
sysUser.setCreateTime(DateUtils.getNowDate());
sysUser.setRemark(proProjectInfoSubdeptsGroup.getSubDeptName());
sysUser.setActiveProjectId(proProjectInfoSubdeptsGroup.getProjectId());
try {
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
}catch (Exception e){

View File

@ -121,6 +121,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
sysUser.setCreateBy(SecurityUtils.getUsername());
sysUser.setCreateTime(DateUtils.getNowDate());
sysUser.setRemark(proProjectInfoSubdepts.getSubDeptName());
sysUser.setActiveProjectId(proProjectInfoSubdepts.getProjectId());
try {
R<Long> userResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
proProjectInfoSubdepts.setSubDeptLeaderId(userResult.getData());
@ -211,6 +212,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
sysUser.setCreateBy(DataSourceEnuns.APP.getInfo());
sysUser.setCreateTime(DateUtils.getNowDate());
sysUser.setRemark(proProjectInfoSubdepts.getSubDeptName());
sysUser.setActiveProjectId(proProjectInfoSubdepts.getProjectId());
try {
R<Long> userResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
proProjectInfoSubdepts.setSubDeptLeaderId(userResult.getData());
@ -282,6 +284,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
sysUser.setUpdateBy(SecurityUtils.getUsername());
sysUser.setUpdateTime(DateUtils.getNowDate());
sysUser.setRemark(proProjectInfoSubdepts.getSubDeptName());
sysUser.setActiveProjectId(proProjectInfoSubdepts.getProjectId());
try {
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
}catch (Exception e){
@ -358,6 +361,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
sysUser.setUpdateBy(DataSourceEnuns.APP.getInfo());
sysUser.setUpdateTime(DateUtils.getNowDate());
sysUser.setRemark(proProjectInfoSubdepts.getSubDeptName());
sysUser.setActiveProjectId(proProjectInfoSubdepts.getProjectId());
try {
R<Long> userResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
proProjectInfoSubdepts.setSubDeptLeaderId(userResult.getData());

View File

@ -119,6 +119,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.LWGR)){
user.setUserType(UserTypeEnums.FBLWRY.getCode());
}
user.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId());
Long userId= remoteUserService.registerUserInfo(user, SecurityConstants.INNER).getData();
proProjectInfoSubdeptsUsers.setUserId(userId);
uniService.syncUniUser(userId,proProjectInfoSubdeptsUsers.getProjectId());
@ -225,6 +226,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
user.setCreateBy(DataSourceEnuns.APP.getInfo());
user.setCreateTime(DateUtils.getNowDate());
user.setRemark(proProjectInfoSubdeptsUsers.getSubDeptName());
user.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId());
Long userId = remoteUserService.registerUserInfo(user, SecurityConstants.INNER).getData();
proProjectInfoSubdeptsUsers.setUserId(userId);
proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
@ -255,6 +257,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
}
user.setUpdateBy(SecurityUtils.getUsername());
user.setUpdateTime(DateUtils.getNowDate());
user.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId());
Long userId = remoteUserService.registerUserInfo(user, SecurityConstants.INNER).getData();
proProjectInfoSubdeptsUsers.setUserId(userId);
uniService.syncUniUser(userId,proProjectInfoSubdeptsUsers.getProjectId());
@ -386,6 +389,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
user.setUpdateBy(DataSourceEnuns.APP.getInfo());
user.setUpdateTime(DateUtils.getNowDate());
user.setRemark(proProjectInfoSubdeptsUsers.getSubDeptName());
user.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId());
Long userId = remoteUserService.registerUserInfo(user, SecurityConstants.INNER).getData();
proProjectInfoSubdeptsUsers.setUserId(userId);
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);

View File

@ -7,7 +7,11 @@ import java.util.Objects;
import java.util.stream.Collectors;
import javax.validation.Validator;
import com.yanzhu.common.core.enums.ShiFouEnums;
import com.yanzhu.common.core.enums.UserTypeEnums;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.system.api.domain.SysDept;
import com.yanzhu.system.api.domain.SysRoleDept;
import com.yanzhu.system.domain.SysPost;
import com.yanzhu.system.domain.SysUserPost;
import com.yanzhu.system.domain.SysUserRole;
@ -65,6 +69,9 @@ public class SysUserServiceImpl implements ISysUserService
@Autowired
private ISysConfigService configService;
@Autowired
private SysRoleDeptMapper roleDeptMapper;
@Autowired
protected Validator validator;
@ -329,7 +336,76 @@ public class SysUserServiceImpl implements ISysUserService
}else{
userMapper.insertUser(user);
}
return user.getUserId();
Long userId = user.getUserId();
if(Objects.nonNull(info.getUserType()) && Objects.nonNull(user.getActiveProjectId())){
// 删除用户与角色关联
List<SysUserRole> sysUserRoleList = new ArrayList<>();
SysUserRole userRole = new SysUserRole();
userRole.setUserId(userId);
userRole.setDeptId(user.getActiveProjectId());
userRoleMapper.deleteUserRoleByUserRole(userRole);
if(Objects.equals(info.getUserType(), UserTypeEnums.FBWTDL.getCode())){
List<SysRole> list = roleMapper.findDeptRoleListByDeptIdAndKey(user.getActiveProjectId(),UserTypeEnums.FBWTDL.getKeys()+"_"+user.getActiveProjectId());
if(StringUtils.isEmpty(list)){
//新增单位角色...
Long roleId = insertDeptSysRole(UserTypeEnums.FBWTDL.getInfo(),UserTypeEnums.FBWTDL.getKeys()+"_"+user.getActiveProjectId(),user.getActiveProjectId());
userRole.setRoleId(roleId);
}else{
userRole.setRoleId(list.get(0).getRoleId());
}
sysUserRoleList.add(userRole);
userRoleMapper.batchUserRole(sysUserRoleList);
}else if(Objects.equals(info.getUserType(), UserTypeEnums.FBXMJL.getCode())){
List<SysRole> list = roleMapper.findDeptRoleListByDeptIdAndKey(user.getActiveProjectId(),UserTypeEnums.FBXMJL.getKeys()+"_"+user.getActiveProjectId());
if(StringUtils.isEmpty(list)){
//新增单位角色...
Long roleId = insertDeptSysRole(UserTypeEnums.FBXMJL.getInfo(),UserTypeEnums.FBXMJL.getKeys()+"_"+user.getActiveProjectId(),user.getActiveProjectId());
userRole.setRoleId(roleId);
}else{
userRole.setRoleId(list.get(0).getRoleId());
}
sysUserRoleList.add(userRole);
userRoleMapper.batchUserRole(sysUserRoleList);
}else if(Objects.equals(info.getUserType(), UserTypeEnums.FBBZZZ.getCode())){
List<SysRole> list = roleMapper.findDeptRoleListByDeptIdAndKey(user.getActiveProjectId(),UserTypeEnums.FBBZZZ.getKeys()+"_"+user.getActiveProjectId());
if(StringUtils.isEmpty(list)){
//新增单位角色...
Long roleId = insertDeptSysRole(UserTypeEnums.FBBZZZ.getInfo(),UserTypeEnums.FBBZZZ.getKeys()+"_"+user.getActiveProjectId(),user.getActiveProjectId());
userRole.setRoleId(roleId);
}else{
userRole.setRoleId(list.get(0).getRoleId());
}
sysUserRoleList.add(userRole);
userRoleMapper.batchUserRole(sysUserRoleList);
}
}
return userId;
}
/**
* ...
* @param roleName
* @param roleKey
* @param deptId
* @return
*/
private Long insertDeptSysRole(String roleName,String roleKey,Long deptId){
SysRole sysRole = new SysRole();
sysRole.setRoleName(roleName);
sysRole.setRoleKey(roleKey);
sysRole.setRoleSort(100);
sysRole.setStatus(ShiFouEnums.FOU.getCodeStr());
sysRole.setCreateBy("SYSTEM");
sysRole.setCreateTime(DateUtils.getNowDate());
roleMapper.insertRole(sysRole);
List<SysRoleDept> sysRoleDeptList = new ArrayList<>();
SysRoleDept sysRoleDept = new SysRoleDept();
sysRoleDept.setRoleId(sysRole.getRoleId());
sysRoleDept.setDeptId(deptId);
sysRoleDeptList.add(sysRoleDept);
roleDeptMapper.batchRoleDept(sysRoleDeptList);
return sysRole.getRoleId();
}
/**

View File

@ -123,6 +123,16 @@ export function findCommentByProcInsId(data) {
})
}
// 根据条件统计分包单位审批
export function findMyTask(query) {
return request({
url: '/flowable/businessKey/findMyTask',
method: 'get',
params: query
})
}
// 根据条件统计分包单位审批
export function quueryCount(query) {
return request({

View File

@ -7,9 +7,6 @@ import {
readDeployNotes,
findCommentByProcInsId
} from '../../../api/flowable'
import {
findProjectApplyData
} from '../../../api/publics'
import {
findProSubDeptsInfoById,
findProSubDeptsUserInfoById
@ -32,7 +29,6 @@ Page({
subDeptUserData: {
user: {},
},
stopBtnShow: false,
comment: "",
targetKey: "",
targetKeyList: [],

View File

@ -309,13 +309,13 @@ Page({
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
if (this.data.options.ret == "finished") {
if (wx.getStorageSync('nav-types') == "depts") {
wx.redirectTo({
url: '../finished/index',
url: '../subDepts/index',
})
} else {
} else if (wx.getStorageSync('nav-types') == "users") {
wx.redirectTo({
url: '../myProcessIns/index',
url: '../subDeptsUsers/index',
})
}
},

View File

@ -6,24 +6,24 @@ import {
quueryCount,
myAwaitFlowTaskList,
myFinishedFlowTaskList,
} from '../../../api/flowable'
const app = getApp()
} from '../../../api/flowable'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
projectId:'',
projectName:'',
projectId: '',
projectName: '',
initData: {},
activeState:"dsh",
dshCount:0,
yshCount:0,
listData:[],
pageNum:1,
pageSize:10,
total:0,
activeState: "dsh",
dshCount: 0,
yshCount: 0,
listData: [],
pageNum: 1,
pageSize: 10,
total: 0,
imgBaseUrl: config.baseImgUrl
},
@ -42,14 +42,14 @@ Page({
onLoad(options) {
if (getToken()) {
this.setData({
pageNum:1,
pageSize:10,
lastDataSize:10,
listData:[],
total:0,
dshCount:0,
yshCount:0,
activeState:"dsh",
pageNum: 1,
pageSize: 10,
lastDataSize: 10,
listData: [],
total: 0,
dshCount: 0,
yshCount: 0,
activeState: "dsh",
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
@ -70,33 +70,33 @@ Page({
/**
* 查询列表数据
*/
getListData(){
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize+"&activeTags=depts&startProId="+app.globalData.useProjectId;
if(this.data.activeState=='dsh'){
myAwaitFlowTaskList(params).then(res =>{
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&activeTags=depts&startProId=" + app.globalData.useProjectId;
if (this.data.activeState == 'dsh') {
myAwaitFlowTaskList(params).then(res => {
if (res.code == "200") {
res.rows.forEach(item =>{
item.businessImg = this.data.imgBaseUrl+item.businessImg;
res.rows.forEach(item => {
item.businessImg = this.data.imgBaseUrl + item.businessImg;
item.durationStr = this.getDurationDate(item.duration);
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
}
});
}else{
myFinishedFlowTaskList(params).then(res =>{
} else {
myFinishedFlowTaskList(params).then(res => {
if (res.code == "200") {
res.rows.forEach(item =>{
item.businessImg = this.data.imgBaseUrl+item.businessImg;
res.rows.forEach(item => {
item.businessImg = this.data.imgBaseUrl + item.businessImg;
item.durationStr = this.getDurationDate(item.duration);
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
}
});
}
},
@ -104,14 +104,14 @@ Page({
/**
* 统计分包单位数据
*/
getFlowableCount(){
let params = "activeTags=depts&startProId="+app.globalData.useProjectId;
getFlowableCount() {
let params = "activeTags=depts&startProId=" + app.globalData.useProjectId;
quueryCount(params).then(res => {
if(res.code==200){
if (res.code == 200) {
this.setData({
dshCount: res.data.await,
dshCount: res.data.await,
yshCount: res.data.finished
})
})
}
});
},
@ -122,32 +122,32 @@ Page({
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();
this.setData({
pageNum: this.data.pageNum + 1
});
this.getListData();
}
},
/**
* 切换页签数据
*/
switchTabJump(e){
switchTabJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if(index == 1){
nav = 'dsh';
}else{
nav = 'ysh';
if (index == 1) {
nav = 'dsh';
} else {
nav = 'ysh';
}
if(nav!=this.data.activeState){
if (nav != this.data.activeState) {
this.setData({
activeState:nav,
pageNum:1,
pageSize:10,
listData:[],
});
this.getListData();
activeState: nav,
pageNum: 1,
pageSize: 10,
listData: [],
});
this.getListData();
}
},
@ -155,19 +155,27 @@ Page({
* 点击栏目
* @param {*} e
*/
findDetail(e){
let {taskId,procInsId,deployId,category,businessKey,finishTime} = e.currentTarget.dataset.set
findDetail(e) {
let {
taskId,
taskName,
procInsId,
deployId,
category,
businessKey,
finishTime
} = e.currentTarget.dataset.set
wx.setStorageSync('nav-types', "depts");
if(finishTime){
if (finishTime) {
//详情页面
wx.redirectTo({
url: `../detailTask/index?taskId=${taskId}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
}else{
url: `../detailTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
} else {
//审批页面
wx.redirectTo({
url: `../approveTask/index?taskId=${taskId}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
url: `../approveTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
}
},
@ -175,42 +183,42 @@ Page({
* 办理时间计算
* @param {*} val
*/
getDurationDate(val){
let day=0;
let hours=0;
let min = val;
if(min>1440){
day = parseInt(min/1440);
min = min % 1440;
if(min>60){
hours = parseInt(min/60);
min = min % 60;
}
}else if(min>60){
hours = parseInt(min/60);
min = min % 60;
getDurationDate(val) {
let day = 0;
let hours = 0;
let min = val;
if (min > 1440) {
day = parseInt(min / 1440);
min = min % 1440;
if (min > 60) {
hours = parseInt(min / 60);
min = min % 60;
}
} else if (min > 60) {
hours = parseInt(min / 60);
min = min % 60;
}
if(day>0){
if(day<10) day="0"+day;
if(hours<10) hours="0"+hours;
if(min<10) min="0"+min;
return day+"天"+hours+"小时"+min+"分钟";
if (day > 0) {
if (day < 10) day = "0" + day;
if (hours < 10) hours = "0" + hours;
if (min < 10) min = "0" + min;
return day + "天" + hours + "小时" + min + "分钟";
}
if(hours>0){
if(hours<10) hours="0"+hours;
if(min<10) min="0"+min;
return hours+"小时"+min+"分钟";
if (hours > 0) {
if (hours < 10) hours = "0" + hours;
if (min < 10) min = "0" + min;
return hours + "小时" + min + "分钟";
}
if(min>0){
if(min<10) min="0"+min;
return min+"分钟";
if (min > 0) {
if (min < 10) min = "0" + min;
return min + "分钟";
}
if(min==0){
return "1分钟";
if (min == 0) {
return "1分钟";
}
},
},
/**
/**
* 返回页面
*/
returnToPage: function () {

View File

@ -1,18 +1,230 @@
// pages/project_flowable/subDeptsUsers/index.js
import config from '../../../config'
import {
getToken
} from '../../../utils/auth'
import {
quueryCount,
myAwaitFlowTaskList,
myFinishedFlowTaskList,
} from '../../../api/flowable'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
projectId: '',
projectName: '',
initData: {},
activeState: "dsh",
dshCount: 0,
yshCount: 0,
listData: [],
pageNum: 1,
pageSize: 10,
total: 0,
imgBaseUrl: config.baseImgUrl
},
//项目切换 返回值
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()) {
this.setData({
pageNum: 1,
pageSize: 10,
lastDataSize: 10,
listData: [],
total: 0,
dshCount: 0,
yshCount: 0,
activeState: "dsh",
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
}
});
this.getListData();
this.getFlowableCount();
} else {
console.log("未查询到Token...{}...准备重新登录")
wx.redirectTo({
url: '../login/login',
})
}
},
/**
* 查询列表数据
*/
getListData() {
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&activeTags=users&startProId=" + app.globalData.useProjectId;
if (this.data.activeState == 'dsh') {
myAwaitFlowTaskList(params).then(res => {
if (res.code == "200") {
res.rows.forEach(item => {
item.businessImg = this.data.imgBaseUrl + item.businessImg;
item.durationStr = this.getDurationDate(item.duration);
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
} else {
myFinishedFlowTaskList(params).then(res => {
if (res.code == "200") {
res.rows.forEach(item => {
item.businessImg = this.data.imgBaseUrl + item.businessImg;
item.durationStr = this.getDurationDate(item.duration);
});
this.setData({
total: res.total,
listData: this.data.listData.concat(res.rows)
})
}
});
}
},
/**
* 统计分包单位数据
*/
getFlowableCount() {
let params = "activeTags=users&startProId=" + app.globalData.useProjectId;
quueryCount(params).then(res => {
if (res.code == 200) {
this.setData({
dshCount: res.data.await,
yshCount: res.data.finished
})
}
});
},
/**
* 统计审批数据
*/
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();
}
},
/**
* 切换页签数据
*/
switchTabJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if (index == 1) {
nav = 'dsh';
} else {
nav = 'ysh';
}
if (nav != this.data.activeState) {
this.setData({
activeState: nav,
pageNum: 1,
pageSize: 10,
listData: [],
});
this.getListData();
}
},
/**
* 点击栏目
* @param {*} e
*/
findDetail(e) {
let {
taskId,
taskName,
procInsId,
deployId,
category,
businessKey,
finishTime
} = e.currentTarget.dataset.set
wx.setStorageSync('nav-types', "users");
if (finishTime) {
//详情页面
wx.redirectTo({
url: `../detailTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
} else {
//审批页面
wx.redirectTo({
url: `../approveTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`
})
}
},
/**
* 办理时间计算
* @param {*} val
*/
getDurationDate(val) {
let day = 0;
let hours = 0;
let min = val;
if (min > 1440) {
day = parseInt(min / 1440);
min = min % 1440;
if (min > 60) {
hours = parseInt(min / 60);
min = min % 60;
}
} else if (min > 60) {
hours = parseInt(min / 60);
min = min % 60;
}
if (day > 0) {
if (day < 10) day = "0" + day;
if (hours < 10) hours = "0" + hours;
if (min < 10) min = "0" + min;
return day + "天" + hours + "小时" + min + "分钟";
}
if (hours > 0) {
if (hours < 10) hours = "0" + hours;
if (min < 10) min = "0" + min;
return hours + "小时" + min + "分钟";
}
if (min > 0) {
if (min < 10) min = "0" + min;
return min + "分钟";
}
if (min == 0) {
return "1分钟";
}
},
/**
* 返回页面
*/
returnToPage: function () {
wx.redirectTo({
url: '../../project_more/index',
})
},
/**

View File

@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"navigationStyle":"custom"
}

View File

@ -1,2 +1,57 @@
<!--pages/project_flowable/subDeptsUsers/index.wxml-->
<text>pages/project_flowable/subDeptsUsers/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=='dsh'?'active':''}}" bindtap="switchTabJump" data-index="1"><text>待审核({{dshCount}}</text></view>
<view class="{{activeState=='ysh'?'active':''}}" bindtap="switchTabJump" data-index="2"><text>已审核({{yshCount}}</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" data-set="{{item}}" bindtap="findDetail">
<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 < 9 ?'0'+(index+1):(index+1)}}</view>
<view class="module_title_3 module_title_flex">
<text wx:if="{{!item.endTime}}" class="color_purple">申请时间 {{item.createTime}}</text>
<text wx:if="{{item.endTime}}" class="color_purple">办结时间 {{item.endTime}}</text>
</view>
</view>
</view>
<view class="inspect_list_info">
<view class="inspect_list_info_details">
<view class="inspect_list_info_img">
<van-image width="120rpx" height="120rpx" fit="cover" src="{{item.businessImg+'.min.jpg'}}" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">单位类型:<text>{{item.businessMk2}}</text></view>
<view class="inspect_list_info_data_prop">单位名称:<text>{{item.businessMk1}}</text></view>
<view class="inspect_list_info_data_prop">信用代码:<text>{{item.businessMk3}}</text></view>
<view class="inspect_list_info_data_prop color_orange">处理耗时:{{item.durationStr}}</view>
</view>
</view>
</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>
</scroll-view>

View File

@ -13,6 +13,9 @@ import {
findUsersAttendanceView,
findSubDeptsAttendanceView
} from '../../api/attendance'
import {
findMyTask
} from '../../api/flowable'
const app = getApp();
Page({
/**
@ -148,6 +151,7 @@ Page({
//统计劳务人员信息
this.getSubDeptsUsers(app.globalData.useProjectId);
this.initSubDeptDaysCharts(app.globalData.useProjectId);
this.awaitTask();
}
//今日出勤信息
if (app.globalData.userData.userType != '80' && app.globalData.userData.userType != '79' && app.globalData.userData.userType != '78' && app.globalData.userData.userType != '77') {
@ -589,31 +593,17 @@ Page({
})
},
//查询当前登录人的代办任务
awaitTask(minRoleId, deptId, loginName, userId) {
let param = {
"businessKey": app.globalData.projectId,
"nowRole": minRoleId,
"nowDept": deptId,
"nowUserName": loginName,
"nowUser": userId,
"activeName": "await"
}
var that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/myAwaitFlowTaskListCount',
data: param,
method: "post",
success: function (res) {
res = res.data;
if (res.code == "200") {
that.setData({
todoDb: res.data.todo + res.data.approveLZYJ,
approveDb: res.data.approve + res.data.zlCount,
aq: res.data.aqCount,
})
}
/**
* 统计代办
*/
awaitTask() {
let param = "proId=" + app.globalData.useProjectId;
findMyTask(param).then(res => {
if(res.code==200){
this.setData({
todoDb: res.data.todo
})
}
})
});
},
})

View File

@ -4,6 +4,9 @@ import {
import {
findUserMenuList
} from '../../api/publics'
import {
findMyTask
} from '../../api/flowable'
const app = getApp()
Page({
@ -11,27 +14,24 @@ Page({
* 页面的初始数据
*/
data: {
active:4,
projectId:'',
projectName:'' ,
loginName:'',
remark:'',
roleId:'',
roleName:'',
menuList:[],
initData:{},
hiddenn:true,
todoDB:0,
lzyjDB:0,
approveDB:0,
ad:0,
todoDb:0,
aq:0,
active: 4,
projectId: '',
projectName: '',
loginName: '',
remark: '',
roleId: '',
roleName: '',
menuList: [],
initData: {},
hiddenn: true,
todoDB: 0,
fbdwDB: 0,
fbrtDB: 0
},
//项目切换 返回值
onProjectSelect(e){
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.useProjectId = projectId;
@ -45,39 +45,40 @@ Page({
onLoad: function (options) {
if (getToken()) {
this.setData({
userData: app.globalData.userData,
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
}
userData: app.globalData.userData,
projectId: app.globalData.useProjectId,
projectName: app.globalData.useProjectName,
initData: {
id: app.globalData.useProjectId,
text: app.globalData.useProjectName,
}
});
//用户权限菜单
this.getUserMenuList(app.globalData.useProjectId);
} else {
this.awaitTask();
} else {
console.log("未查询到Token...{}...准备重新登录")
wx.redirectTo({
url: '../login/login',
url: '../login/login',
})
}
}
},
/**
* 查询功能菜单
* @param {*} proId
*/
getUserMenuList:function(proId){
findUserMenuList(proId,'gdgn').then(res =>{
if(res.code==200){
getUserMenuList: function (proId) {
findUserMenuList(proId, 'gdgn').then(res => {
if (res.code == 200) {
this.setData({
menuList:res.data
menuList: res.data
})
}
});
},
goMenu:function(event){
goMenu: function (event) {
wx.redirectTo({
url: event.currentTarget.dataset.url
})
@ -87,21 +88,23 @@ Page({
//})
},
// 底部导航
onChange(event) {
// 底部导航
onChange(event) {
// event.detail 的值为当前选中项的索引
this.setData({ active: event.detail });
this.setData({
active: event.detail
});
},
//跳转到项目概况页面
XMGK:function(){
XMGK: function () {
wx.redirectTo({
url: '../project_info/index'
})
},
//跳转到安全管理
AQGL:function(){
AQGL: function () {
app.toast("正在建设中");
// wx.redirectTo({
// url:'../safety_manage/index'
@ -109,48 +112,35 @@ Page({
},
//跳转到质量管理
ZLGL:function(){
ZLGL: function () {
app.toast("正在建设中");
// wx.redirectTo({
// url:'../quality_manage/index'
// })
},
//跳转到进度管理
JDGL2:function(){
//跳转到进度管理
JDGL2: function () {
app.toast("正在建设中");
// wx.redirectTo({
// url:'../../pageage/project_schedule/list/index'
// })
},
//查询当前登录人的代办任务
awaitTask(minRoleId,deptId,loginName,userId) {
let param = {
"businessKey":app.globalData.projectId,
"nowRole":minRoleId,
"nowDept":deptId,
"nowUserName":loginName,
"nowUser":userId,
"activeName":"await"
}
var that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/flowTask/myAwaitFlowTaskListCount',
data:param,
method: "post",
success: function (res) {
res = res.data;
if(res.code=="200"){
that.setData({
todoDB:res.data.todo,
lzyjDB:res.data.approveLZYJ,
todoDb:res.data.todo,
ad:res.data.approve+res.data.zlCount,
aq:res.data.aqCount,
})
}
/**
* 统计代办
*/
awaitTask() {
let param = "proId=" + app.globalData.useProjectId;
findMyTask(param).then(res => {
if (res.code == 200) {
this.setData({
todoDb: res.data.todo,
fbdwDB: res.data.dwsh,
fbrtDB: res.data.rysh
})
}
})
});
},
})

View File

@ -144,12 +144,46 @@
<el-form-item label="入场肖像近照" v-if="dataOptions.category=='1'">
<ImagePreview :src="initData.user.userPicture" :width="120" :height="70"/>
</el-form-item>
<el-form-item label="单位委托证明" v-if="dataOptions.category=='1'">
<el-form-item label="单位委托证明" v-if="dataOptions.category=='4'">
<ImagePreview :src="initData.subDeptPowerPath" :width="120" :height="70"/>
</el-form-item>
<el-form-item label="委托人姓名" v-if="dataOptions.category=='1'">
{{ initData.user.nickName }} <el-tag type="info">{{ initData.user.cardCode }}</el-tag>
</el-form-item>
<el-form-item label="人员姓名" v-if="dataOptions.category!='1'">
{{ initData.user.nickName }} <el-tag type="info">{{ initData.user.cardCode }}</el-tag>
</el-form-item>
<el-form-item label="工种岗位" v-if="dataOptions.category!='1'">
{{ initData.craftPostName }}
</el-form-item>
<el-form-item label="工种班组" v-if="dataOptions.category!='1' && dataOptions.category!='2'">
{{ initData.subDeptGroupName }}
</el-form-item>
<el-form-item label="所属民族" v-if="dataOptions.category!='1'">
{{ initData.user.userInfos.nativePlace }}
</el-form-item>
<el-form-item label="详细地址" v-if="dataOptions.category!='1'">
{{ initData.user.userInfos.address }}
</el-form-item>
<el-form-item label="身份证照片" v-if="dataOptions.category!='1'">
<ImagePreview :src="initData.user.cardImgPos" :width="120" :height="70"/>
<ImagePreview :src="initData.user.cardImgInv" :width="120" :height="70" style="margin-left: 20px;"/>
</el-form-item>
<el-form-item label="入场肖像近照" v-if="dataOptions.category!='1'">
<ImagePreview :src="initData.user.userPicture" :width="120" :height="70"/>
</el-form-item>
<el-form-item label="紧急联系人" v-if="dataOptions.category!='1'">
{{ initData.user.userInfos.emergencyContact }} <el-tag type="info">{{ initData.user.contactPhone }}</el-tag>
</el-form-item>
<el-form-item label="开户行名称" v-if="dataOptions.category=='4'">
{{ initData.user.userInfos.bankName }}
</el-form-item>
<el-form-item label="开户行网点" v-if="dataOptions.category=='4'">
{{ initData.user.userInfos.bankName }}
</el-form-item>
<el-form-item label="工资银行卡号" v-if="dataOptions.category=='4'">
{{ initData.user.userInfos.bankName }}
</el-form-item>
<el-form-item label="联系电话">
{{ initData.user.userName }}
</el-form-item>