提交代码

dev_xd
姜玉琦 2025-02-16 17:19:52 +08:00
parent d4fb05d7d1
commit c9104c62e3
53 changed files with 3478 additions and 287 deletions

View File

@ -34,12 +34,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBusTrainingVideoUserVo">
select btvu.id, btvu.com_id, sd.dept_name as com_name, btvu.project_id, pi.project_name, btvu.user_id, su.nick_name as user_nick, su.user_name, btvu.video_id, btv.train_title,
select btvu.id, btvu.com_id, btvu.project_id, pi.project_name, btvu.user_id, su.nick_name as user_nick, su.user_name, btvu.video_id, btv.train_title,
btv.train_type, dic1.dict_label as train_type_name, btv.train_level, dic2.dict_label as train_level_name, btv.train_file_path, btv.train_file_image, btvu.play_times, btvu.play_dates,
btvu.play_status, btvu.sort_by, btvu.is_del, btvu.create_by, btvu.create_time, btvu.update_by, btvu.update_time, btvu.remark from bus_training_video_user btvu
left join bus_training_video btv on btv.id = btvu.video_id
left join pro_project_info pi on pi.id = btvu.project_id
left join sys_dept sd on sd.com_id = btvu.com_id
left join sys_user su on su.user_id = btvu.user_id
left join sys_dict_data dic1 ON btv.train_type = dic1.`dict_value` AND dic1.`dict_type`='edu_train_type'
left join sys_dict_data dic2 ON btv.train_level = dic2.`dict_value` AND dic2.`dict_type`='edu_train_level'
@ -48,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBusTrainingVideoUserList" parameterType="BusTrainingVideoUser" resultMap="BusTrainingVideoUserResult">
<include refid="selectBusTrainingVideoUserVo"/>
<where>
btvu.is_del!=2
<if test="comId != null "> and btvu.com_id = #{comId}</if>
<if test="projectId != null "> and btvu.project_id = #{projectId}</if>
<if test="activeComId != null "> and btvu.com_id = #{activeComId}</if>
@ -57,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userName != null and userName != ''"> and (su.nick_name like concat('%', #{userName}, '%') or su.user_name like concat('%', #{userName}, '%') )</if>
<if test="userId != null "> and btvu.user_id = #{userId}</if>
<if test="isDel != null "> and btvu.is_del = #{isDel}</if>
and btvu.is_del!=2
</where>
order by btvu.id desc
</select>

View File

@ -10,6 +10,7 @@ import com.yanzhu.common.core.utils.ServletUtils;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.system.api.model.LoginUser;
import java.util.Objects;
import java.util.Set;
/**
@ -100,7 +101,7 @@ public class SecurityUtils
*/
public static boolean isGSAdmin()
{
return getLoginUser().getRoles().contains("gsAdmin");
return Objects.nonNull(getLoginUser().getRoles()) && getLoginUser().getRoles().contains("gsAdmin");
}
/**

View File

@ -68,12 +68,13 @@ public class BusExamUserController extends BaseController
*
* @RequiresPermissions("manage:busExamUser:query")
*/
@GetMapping(value = "/last/{userId}")
public AjaxResult findBusExamUserList(@PathVariable("userId") Long userId)
@GetMapping(value = "/last/{proId}")
public AjaxResult findBusExamUserList(@PathVariable("userId") Long proId,Long userId)
{
BusExamUser query = new BusExamUser();
query.setUserId(userId);
List<BusExamUser> list = busExamUserService.selectBusExamUserList(query);
query.setProjectId(proId);
List<BusExamUser> list = busExamUserService.selectAllList(query);
if(StringUtils.isNotEmpty(list)){
return success(busExamUserService.selectBusExamUserById(list.get(0).getId()));
}

View File

@ -67,12 +67,13 @@ public class BusTrainingVideoUserController extends BaseController
*
* @RequiresPermissions("manage:busTrainingVideoUser:query")
*/
@GetMapping(value = "/last/{userId}")
public AjaxResult findBusTrainingVideoUserLast(@PathVariable("userId") Long userId)
@GetMapping(value = "/last/{proId}")
public AjaxResult findBusTrainingVideoUserLast(@PathVariable("proId") Long proId,Long userId)
{
BusTrainingVideoUser query = new BusTrainingVideoUser();
query.setUserId(userId);
return success(busTrainingVideoUserService.selectBusTrainingVideoUserList(query));
query.setProjectId(proId);
return success(busTrainingVideoUserService.selectAllList(query));
}
/**

View File

@ -1,9 +1,6 @@
package com.yanzhu.manage.controller;
import com.yanzhu.common.core.constant.Constants;
import com.yanzhu.common.core.domain.R;
import com.yanzhu.common.core.utils.PageUtils;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.common.core.utils.bean.BeanUtils;
import com.yanzhu.common.core.utils.poi.ExcelUtil;
import com.yanzhu.common.core.web.controller.BaseController;
@ -24,7 +21,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* Controller
@ -148,6 +144,7 @@ public class ProProjectInfoController extends BaseController
LoginUser loginUser = SecurityUtils.getLoginUser();
proProjectInfo.setComId(loginUser.getSysUser().getComId());
if(!SecurityUtils.isAdmin(loginUser.getUserid())){
System.out.println("SecurityUtils.getRoles==>"+SecurityUtils.getLoginUser().getRoles());
if(SecurityUtils.isGSAdmin()){
proProjectInfo.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
}else{

View File

@ -3,12 +3,13 @@ package com.yanzhu.manage.controller.wechat;
import com.yanzhu.common.core.utils.OcrService;
import com.yanzhu.common.core.web.controller.BaseController;
import com.yanzhu.common.core.web.domain.AjaxResult;
import com.yanzhu.manage.domain.BusExamUser;
import com.yanzhu.manage.domain.ProProjectInfoSubdepts;
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
import com.yanzhu.manage.domain.SignetFileVo;
import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.manage.domain.*;
import com.yanzhu.manage.enums.SubDeptsEnums;
import com.yanzhu.manage.enums.UserPostEnums;
import com.yanzhu.manage.service.*;
import com.yanzhu.security.utils.DictUtils;
import com.yanzhu.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -97,12 +98,39 @@ public class WxController extends BaseController {
return success(proProjectInfoSubdeptsService.findProSubDeptsInfo(proId,phoneNumber));
}
/**
*
* @param proId
*/
@GetMapping("/findProSubDeptsUserInfo/{proId}")
public AjaxResult findProSubDeptsUserInfo(@PathVariable("proId") Long proId)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
if(SecurityUtils.isGSAdmin()){
ProProjectInfo projectInfo = proProjectInfoService.selectProProjectInfoById(proId);
ProProjectInfoSubdeptsUsers adminUser = new ProProjectInfoSubdeptsUsers();
adminUser.setId(0L);
adminUser.setComId(projectInfo.getComId());
adminUser.setComName(projectInfo.getComName());
adminUser.setProjectId(projectInfo.getId());
adminUser.setProjectName(projectInfo.getProjectName());
adminUser.setSubDeptId(0L);
adminUser.setSubDeptType(SubDeptsEnums.JSDW.getCode());
adminUser.setUserId(loginUser.getUserid());
adminUser.setUserPost(UserPostEnums.JSDWGL.getCode());
adminUser.setUserName(loginUser.getSysUser().getNickName());
return success(adminUser);
}else{
return success(proProjectInfoSubdeptsUsersService.findProSubDeptsUserInfo(proId, SecurityUtils.getUserId()));
}
}
/**
*
* @param id
*/
@GetMapping("/findProSubDeptsUser/{id}")
public AjaxResult findProSubDeptsUserById(@PathVariable("id")Long id)
public AjaxResult findProSubDeptsUserById(@PathVariable("id") Long id)
{
return success(proProjectInfoSubdeptsUsersService.selectProProjectInfoSubdeptsUsersById(id));
}

View File

@ -5,10 +5,10 @@ package com.yanzhu.manage.enums;
*/
public enum CraftPostEnums {
WTDL("1022", "委托代理人"),
XMJL("1023", "项目经理"),
AQZY("1024", "安全专员"),
CLZY("1025", "材料专员");
WTDL("3022", "委托代理人"),
XMJL("3023", "项目经理"),
AQZY("3024", "安全专员"),
CLZY("3025", "材料专员");
private final String code;
private final String info;

View File

@ -20,6 +20,14 @@ public interface IBusExamUserService
*/
public BusExamUser selectBusExamUserById(Long id);
/**
*
*
* @param busExamUser
* @return
*/
public List<BusExamUser> selectAllList(BusExamUser busExamUser);
/**
*
*

View File

@ -20,6 +20,13 @@ public interface IBusTrainingVideoUserService
*/
public BusTrainingVideoUser selectBusTrainingVideoUserById(Long id);
/**
*
* @param busTrainingVideoUser
* @return
*/
public List<BusTrainingVideoUser> selectAllList(BusTrainingVideoUser busTrainingVideoUser);
/**
*
*

View File

@ -95,6 +95,14 @@ public interface IProProjectInfoSubdeptsUsersService
*/
public ProProjectInfoSubdeptsUsers findProSubDeptsUser(Long proId, String phoneNumber);
/**
*
* @param proId
* @param userId
* @return
*/
public ProProjectInfoSubdeptsUsers findProSubDeptsUserInfo(Long proId, Long userId);
/**
*
* @param signetFileVo

View File

@ -58,6 +58,18 @@ public class BusExamUserServiceImpl implements IBusExamUserService
return busExamUserMapper.selectBusExamUserById(id);
}
/**
*
*
* @param busExamUser
* @return
*/
@Override
public List<BusExamUser> selectAllList(BusExamUser busExamUser)
{
return busExamUserMapper.selectBusExamUserList(busExamUser);
}
/**
*
*

View File

@ -47,6 +47,18 @@ public class BusTrainingVideoUserServiceImpl implements IBusTrainingVideoUserSer
return busTrainingVideoUserMapper.selectBusTrainingVideoUserById(id);
}
/**
*
*
* @param busTrainingVideoUser
* @return
*/
@Override
public List<BusTrainingVideoUser> selectAllList(BusTrainingVideoUser busTrainingVideoUser)
{
return busTrainingVideoUserMapper.selectBusTrainingVideoUserList(busTrainingVideoUser);
}
/**
*
*

View File

@ -757,6 +757,17 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
return null;
}
/**
*
* @param proId
* @param userId
* @return
*/
@Override
public ProProjectInfoSubdeptsUsers findProSubDeptsUserInfo(Long proId, Long userId){
return proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersByParamId(proId,userId);
}
/**
*
* @param signetFileVo
@ -890,7 +901,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.WTDL.getCode())){
ProProjectInfoSubdepts proProjectInfoSubdepts = proProjectInfoSubdeptsMapper.selectProProjectInfoSubdeptsById(proProjectInfoSubdeptsUsers.getSubDeptId());
proProjectInfoSubdepts.setApproveStatus(ApproveStatus.exempt.getCode());
if(Objects.isNull(proProjectInfoSubdepts.getUseStatus()) && Objects.equals(proProjectInfoSubdepts.getUseStatus(),UseStateEnums.AW.getCode())){
if(Objects.nonNull(proProjectInfoSubdepts.getUseStatus()) && Objects.equals(proProjectInfoSubdepts.getUseStatus(),UseStateEnums.AW.getCode())){
proProjectInfoSubdepts.setUseStatus(UseStateEnums.IN.getCode());
}
// 生成二维码
@ -920,7 +931,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
if(Objects.nonNull(groups) && groups.size()>0){
ProProjectInfoSubdeptsGroup specialGroup = groups.get(0);
specialGroup.setApproveStatus(ApproveStatus.exempt.getCode());
if(Objects.isNull(specialGroup.getUseStatus()) && Objects.equals(specialGroup.getUseStatus(),UseStateEnums.AW.getCode())){
if(Objects.nonNull(specialGroup.getUseStatus()) && Objects.equals(specialGroup.getUseStatus(),UseStateEnums.AW.getCode())){
specialGroup.setUseStatus(UseStateEnums.IN.getCode());
}
proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(specialGroup);
@ -941,7 +952,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
}else if(Objects.equals(proProjectInfoSubdeptsUsers.getUserPost(),UserPostEnums.BZZ.getCode())){
ProProjectInfoSubdeptsGroup proProjectInfoSubdeptsGroup = proProjectInfoSubdeptsGroupMapper.selectProProjectInfoSubdeptsGroupById(proProjectInfoSubdeptsUsers.getSubDeptGroup());
proProjectInfoSubdeptsGroup.setApproveStatus(ApproveStatus.exempt.getCode());
if(Objects.isNull(proProjectInfoSubdeptsGroup.getUseStatus()) && Objects.equals(proProjectInfoSubdeptsGroup.getUseStatus(),UseStateEnums.AW.getCode())){
if(Objects.nonNull(proProjectInfoSubdeptsGroup.getUseStatus()) && Objects.equals(proProjectInfoSubdeptsGroup.getUseStatus(),UseStateEnums.AW.getCode())){
proProjectInfoSubdeptsGroup.setUseStatus(UseStateEnums.IN.getCode());
}
proProjectInfoSubdeptsGroupMapper.updateProProjectInfoSubdeptsGroup(proProjectInfoSubdeptsGroup);
@ -1069,11 +1080,11 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(id);
ProProjectInfoSubdeptsUsers userQuery = new ProProjectInfoSubdeptsUsers();
userQuery.setWorkType(101L);
userQuery.setProjectId(proProjectInfoSubdeptsUsers.getProjectId());
userQuery.setComId(proProjectInfoSubdeptsUsers.getComId());
List<ProProjectInfoSubdeptsUsers> users = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(userQuery);
if(StringUtils.isNotEmpty(users)){
BasSignet query = new BasSignet();
query.setProjectId(users.get(0).getProjectId());
query.setComId(users.get(0).getComId());
query.setUserId(users.get(0).getUserId());
List<BasSignet> signets = basSignetMapper.selectBasSignetList(query);
if(StringUtils.isNotEmpty(signets)){

View File

@ -103,10 +103,10 @@ public class SysRoleController extends BaseController
{
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (!roleService.checkRoleKeyUnique(role))
/**else if (!roleService.checkRoleKeyUnique(role))
{
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
}*/
role.setCreateBy(SecurityUtils.getUsername());
return toAjax(roleService.insertRole(role));

View File

@ -43,6 +43,14 @@ export function findProSubDeptsUser(proId, phoneNumber) {
})
}
// 查询项目参建单位人员
export function findProSubDeptsUserInfo(proId) {
return request({
url: '/manage/wxApi/findProSubDeptsUserInfo/' + proId,
method: 'get'
})
}
// 查询项目参建单位人员
export function findProSubDeptsUserById(id) {
return request({

View File

@ -15,7 +15,13 @@
"pages/project_list/index",
"pages/project_more/index",
"pages/project_qr/index",
"pages/sign_mags/index"
"pages/sign_mags/index",
"pages/project_problemmodify/list/index",
"pages/project_problemmodify/info/index",
"pages/project_problemmodify/modify/index",
"pages/project_problemmodify/check/index",
"pages/project_problemmodify/add/index",
"pages/project_problemmodify/draft/index"
],
"usingComponents": {
"van-row": "@vant/weapp/row",

View File

@ -1,209 +1,210 @@
import {
removeToken
} from '../../../utils/auth'
import {
} from '../../../utils/auth'
import {
loginOut,
updatePwd,
findOpenUserMsgId
} from '../../../api/login'
const app = getApp()
Component({
} from '../../../api/login'
const app = getApp()
Component({
/**数据监听 */
observers: {},
/**
* 组件的初始数据
*/
data: {
show: false,
userData: {},
resPas: false,
oldPsw: '',
newPsw: '',
password: '',
showOldPass: true,
showNewPass: true,
showPassWord: true,
binding: false,
msgOpenId: "",
show: false,
userData: {},
resPas: false,
oldPsw: '',
newPsw: '',
password: '',
showOldPass: true,
showNewPass: true,
showPassWord: true,
binding: false,
msgOpenId: "",
},
created() {
this.setData({
userData: app.globalData.userData,
loginName: app.globalData.userData.userName,
msgOpenId: "",
userData: app.globalData.userData,
loginName: app.globalData.userData.userName,
msgOpenId: "",
})
},
/**
* 组件的方法列表
*/
methods: {
loadUserInfo() {
let that = this;
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success: function (res) {
findOpenUserMsgId(res.data.openId).then(vo =>{
if(vo.code==200 && vo.data){
res.data.msgOpenId=vo.data.msgOpenId;
wx.setStorage({
key: 'userinfo',
data: res.data
});
that.setData({
show:true,
userData: res.data,
loginName: res.data.loginName,
msgOpenId: res.data.msgOpenId || "",
})
}
});
}
})
},
showPopup() {
this.setData({
show: true
});
},
/**
* 关闭用户详情
*/
closePopup() {
this.setData({
show: false
});
},
//修改密码
resPassword: function () {
this.setData({
resPas: true
});
},
//绑定公众号
binding: function () {
app.initWxAuth();
},
/**
* 修改密码返回
*/
closeResPas: function () {
this.setData({
resPas: false
});
},
/**
* 修改密码返回
*/
closeBinding: function () {
this.setData({
binding: false
});
},
bindingBuild: function () {
wx.previewImage({
urls: "https://szgcwx.jhncidg.com/staticFiles/qrv1.jpg".split(","),
current: 0
})
},
//退出登录
loginOut: function () {
loginOut().then(res => {
removeToken();
wx.clearStorageSync();
wx.redirectTo({
url: '../login/login'
loadUserInfo() {
let that = this;
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success: function (res) {
findOpenUserMsgId(res.data.openId).then(vo => {
if (vo.code == 200 && vo.data) {
res.data.msgOpenId = vo.data.msgOpenId;
wx.setStorage({
key: 'userinfo',
data: res.data
});
that.setData({
show: true,
userData: res.data,
loginName: res.data.loginName,
msgOpenId: res.data.msgOpenId || "",
})
}
});
}
})
});
},
seeTap1() {
let that = this;
that.setData({
// 切换图标
showOldPass: !that.data.showOldPass
})
},
seeTap2() {
let that = this;
that.setData({
// 切换图标
showNewPass: !that.data.showNewPass
})
},
seeTap3() {
let that = this;
that.setData({
// 切换图标
showPassWord: !that.data.showPassWord
})
if (that.data.newPsw != '' && that.data.newPsw != that.data.password) {
app.toast("两次密码输入不一致!");
}
},
/**
* 添加预警信息
*/
submit: function () {
var that = this;
if (false && that.data.oldPsw == '') {
app.toast("请输入旧密码!");
return;
}
if (that.data.password == '') {
app.toast("请确认新密码!");
return;
}
if (that.data.newPsw != '' && that.data.newPsw != that.data.password) {
app.toast("两次密码输入不一致!");
return;
}
if (false && that.data.oldPsw.length < 6) {
app.toast("请输入旧密码长度 [6-20]位字符!");
return;
}
if (that.data.newPsw.length < 6) {
app.toast("请输入新密码长度 [6-20]位字符!");
return;
}
if (that.data.password.length < 6) {
app.toast("请输入确认密码长度 [6-20]位字符!");
return;
}
let data = {
loginName: that.data.loginName,
oldPass: that.data.oldPsw,
password: that.data.newPsw,
confPass: that.data.password,
source:"u"
}
updatePwd(data).then(res =>{
if(res.code==200){
app.toast("密码修改成功,请重新登录!",800);
loginOut().then(res =>{
},
showPopup() {
this.setData({
show: true
});
},
/**
* 关闭用户详情
*/
closePopup() {
this.setData({
show: false
});
},
//修改密码
resPassword: function () {
this.setData({
resPas: true
});
},
//绑定公众号
binding: function () {
app.initWxAuth();
},
/**
* 修改密码返回
*/
closeResPas: function () {
this.setData({
resPas: false
});
},
/**
* 修改密码返回
*/
closeBinding: function () {
this.setData({
binding: false
});
},
bindingBuild: function () {
wx.previewImage({
urls: "https://szgcwx.jhncidg.com/staticFiles/qrv1.jpg".split(","),
current: 0
})
},
//退出登录
loginOut: function () {
loginOut().then(res => {
removeToken();
wx.clearStorageSync();
setTimeout(()=>{
wx.redirectTo({
url: '../login/login'
});
},500)
wx.redirectTo({
url: '../login/login'
})
});
}
});
},
},
seeTap1() {
let that = this;
that.setData({
// 切换图标
showOldPass: !that.data.showOldPass
})
},
seeTap2() {
let that = this;
that.setData({
// 切换图标
showNewPass: !that.data.showNewPass
})
},
seeTap3() {
let that = this;
that.setData({
// 切换图标
showPassWord: !that.data.showPassWord
})
if (that.data.newPsw != '' && that.data.newPsw != that.data.password) {
app.toast("两次密码输入不一致!");
}
},
/**
* 添加预警信息
*/
submit: function () {
var that = this;
if (false && that.data.oldPsw == '') {
app.toast("请输入旧密码!");
return;
}
if (that.data.password == '') {
app.toast("请确认新密码!");
return;
}
if (that.data.newPsw != '' && that.data.newPsw != that.data.password) {
app.toast("两次密码输入不一致!");
return;
}
if (false && that.data.oldPsw.length < 6) {
app.toast("请输入旧密码长度 [6-20]位字符!");
return;
}
if (that.data.newPsw.length < 6) {
app.toast("请输入新密码长度 [6-20]位字符!");
return;
}
if (that.data.password.length < 6) {
app.toast("请输入确认密码长度 [6-20]位字符!");
return;
}
let data = {
loginName: that.data.loginName,
oldPass: that.data.oldPsw,
password: that.data.newPsw,
confPass: that.data.password,
source: "u"
}
updatePwd(data).then(res => {
if (res.code == 200) {
app.toast("密码修改成功,请重新登录!", 800);
loginOut().then(res => {
removeToken();
wx.clearStorageSync();
setTimeout(() => {
wx.redirectTo({
url: '../login/login'
});
}, 500)
});
}
});
},
}
})
})

View File

@ -4,6 +4,7 @@ import {
getOpenId,
setOpenId,
setUserInfo,
getUserInfo,
getSessionKey,
setSessionKey,
} from '../../utils/auth'
@ -17,6 +18,7 @@ import {
} from '../../api/login'
import {
findMyProjectList,
findProSubDeptsUserInfo,
} from '../../api/project'
const app = getApp();
Page({
@ -178,10 +180,17 @@ Page({
if(res.rows.length==1){
app.globalData.useProjectId = res.rows[0].id;
app.globalData.useProjectName = res.rows[0].projectName;
//单项目直接进入项目页面
wx.redirectTo({
url: '../project_info/index',
})
findProSubDeptsUserInfo(app.globalData.useProjectId).then(detail=>{
if(detail.code==200){
let userInfo = getUserInfo();
userInfo.projectUserInfo = detail.data;
setUserInfo(userInfo);
//单项目直接进入项目页面
wx.redirectTo({
url: '../project_info/index',
})
}
});
}else{
//多项目进入项目切换页面
wx.redirectTo({

View File

@ -192,7 +192,13 @@
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">所属民族</text></van-col>
<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="{{options.category!='1'}}">
<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 File

@ -192,7 +192,13 @@
</view>
<view class="inspect_overview_list" wx:if="{{options.category!='1'}}">
<van-row>
<van-col span="8"><text class="color_purple">所属民族</text></van-col>
<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="{{options.category!='1'}}">
<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 File

@ -162,11 +162,10 @@ Page({
procInsId,
deployId,
category,
businessKey,
finishTime
businessKey
} = e.currentTarget.dataset.set
wx.setStorageSync('nav-types', "users");
if (finishTime) {
if (this.data.activeState=="ysh") {
//详情页面
wx.redirectTo({
url: `../detailTask/index?taskId=${taskId}&taskName=${taskName}&procInsId=${procInsId}&deployId=${deployId}&category=${category}&businessKey=${businessKey}`

View File

@ -1,11 +1,11 @@
import config from '../../config'
import {
getToken
getToken,
getUserInfo
} from '../../utils/auth'
import {
findProjectInfo,
findProjectDepts,
findProSubDeptsUserByParams
findProjectDepts
} from '../../api/project'
import {
findSubDeptsUsers,
@ -145,8 +145,8 @@ Page({
//项目基本信息
this.getProjectInfo(app.globalData.useProjectId);
//用户项目信息
this.getProSubDeptsUserInfo(app.globalData.useProjectId);
//项目单位信息
this.getProSubDeptsUserInfo();
//项目建设单位
this.getProjectDepts(app.globalData.useProjectId);
} else {
console.log("未查询到Token...{}...准备重新登录")
@ -349,29 +349,28 @@ Page({
* 查询单位人员信息
* @param {*} proId
*/
getProSubDeptsUserInfo(proId) {
findProSubDeptsUserByParams(proId).then(res => {
app.globalData.subDeptUserData = res.data[0];
this.setData({
subDeptUserInfo: res.data[0]
});
//劳务人员信息
if ((app.globalData.subDeptUserData.subDeptType=='1' || app.globalData.subDeptUserData.subDeptType=='4' || app.globalData.subDeptUserData.subDeptType=='5') && app.globalData.subDeptUserData.userPost != '4' && app.globalData.subDeptUserData.userPost != '5' && app.globalData.subDeptUserData.userPost != '6' && app.globalData.subDeptUserData.userPost != '8') {
//统计劳务人员信息
this.getSubDeptsUsers(app.globalData.useProjectId);
this.initSubDeptDaysCharts(app.globalData.useProjectId);
}
this.awaitTask();
//今日出勤信息
if (app.globalData.subDeptUserData.subDeptType=='1') {
this.getSubDeptsAttendanceView(app.globalData.useProjectId);
}
//人员出勤信息
if (app.globalData.subDeptUserData.userPost == '4' || app.globalData.subDeptUserData.userPost == '5' || app.globalData.subDeptUserData.userPost == '6' || app.globalData.subDeptUserData.userPost == '8') {
//统计劳务人员信息
this.getUsersAttendanceView(app.globalData.useProjectId);
}
getProSubDeptsUserInfo() {
const proUserInfo = getUserInfo();
app.globalData.subDeptUserData = proUserInfo.projectUserInfo;
this.setData({
subDeptUserInfo: proUserInfo.projectUserInfo
});
//劳务人员信息
if ((app.globalData.subDeptUserData.subDeptType=='1' || app.globalData.subDeptUserData.subDeptType=='4' || app.globalData.subDeptUserData.subDeptType=='5') && app.globalData.subDeptUserData.userPost != '4' && app.globalData.subDeptUserData.userPost != '5' && app.globalData.subDeptUserData.userPost != '6' && app.globalData.subDeptUserData.userPost != '8') {
//统计劳务人员信息
this.getSubDeptsUsers(app.globalData.useProjectId);
this.initSubDeptDaysCharts(app.globalData.useProjectId);
}
this.awaitTask();
//今日出勤信息
if (app.globalData.subDeptUserData.subDeptType=='1') {
this.getSubDeptsAttendanceView(app.globalData.useProjectId);
}
//人员出勤信息
if (app.globalData.subDeptUserData.userPost == '4' || app.globalData.subDeptUserData.userPost == '5' || app.globalData.subDeptUserData.userPost == '6' || app.globalData.subDeptUserData.userPost == '8') {
//统计劳务人员信息
this.getUsersAttendanceView(app.globalData.useProjectId);
}
},
/**
@ -467,7 +466,7 @@ Page({
/**
* 查询
* 项目建单位
* 项目单位
* @param {*} proId
*/
getProjectDepts: function (proId) {

View File

@ -1,8 +1,11 @@
import {
getToken
getToken,
setUserInfo,
getUserInfo
} from '../../utils/auth'
import {
findMyProjectList,
findProSubDeptsUserInfo,
} from '../../api/project'
const app = getApp()
Page({
@ -56,8 +59,16 @@ import {
//赋值到公共参数
app.globalData.useProjectId = even.currentTarget.dataset['id'];
app.globalData.useProjectName = even.currentTarget.dataset['name'];
wx.redirectTo({
url: '../project_info/index',
})
findProSubDeptsUserInfo(app.globalData.useProjectId).then(detail=>{
if(detail.code==200){
let userInfo = getUserInfo();
userInfo.projectUserInfo = detail.data;
setUserInfo(userInfo);
//单项目直接进入项目页面
wx.redirectTo({
url: '../project_info/index',
})
}
});
}
})

View File

@ -4,9 +4,6 @@ import {
import {
findUserMenuList
} from '../../api/publics'
import {
findProSubDeptsUserByParams
} from '../../api/project'
import {
findMyTask
} from '../../api/flowable'
@ -60,7 +57,7 @@ Page({
//用户权限菜单
this.getUserMenuList(app.globalData.useProjectId);
//用户项目信息
this.getProSubDeptsUserInfo(app.globalData.useProjectId);
this.getProSubDeptsUserInfo();
this.awaitTask();
} else {
console.log("未查询到Token...{}...准备重新登录")
@ -86,15 +83,12 @@ Page({
/**
* 查询单位人员信息
* @param {*} proId
*/
getProSubDeptsUserInfo(proId) {
findProSubDeptsUserByParams(proId).then(res => {
app.globalData.subDeptUserData = res.data;
this.setData({
subDeptUserInfo: res.data[0]
});
});
getProSubDeptsUserInfo() {
const proUserInfo = getUserInfo();
this.setData({
subDeptUserInfo: proUserInfo.projectUserInfo
});
},
goMenu: function (event) {

View File

@ -0,0 +1,543 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
maxDate: new Date(2088, 1, 1).getTime(),
minDate: new Date().getTime() + (3600 * 48 * 1000),
projectId: "",
projectName: "",
loginName: "",
userName: "",
rectifierData: [],
rectifierData2: [],
rectifierData3: [],
imageInfoData: [],
//验收时间
nickedTime: '',
loadShow: false,
lordSent: "",
lordSentUser: "",
copySend: "",
copySendUser: "",
recheckSend: "",
recheckSendUser: "",
workParts: "",
changeInfo: "",
dangerType: "1",
dangerTypeList: [],
selectValue: "",
selectIndex: "",
problemType: "1",
showHis: false,
problemTypeList: [{
id: "1",
text: "常规检查"
}, {
id: "2",
text: "专项检查"
}],
flowNodes:[{text:'开始'},{text:'提交隐患'},{text:'隐患整改'},{text:'隐患复检'},{text:'结束'}],
active: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {
ts
} = options
this.setData({
projectId: app.globalData.projectId,
projectName: app.globalData.projectName,
loginName: res.data.loginName,
userName: res.data.nickName,
recheckSend: res.data.nickName,
recheckSendUser: res.data.loginName
});
//获取缓存数据
wx.getStorage({
key: 'YanZhu-XD-App-UserInfoKey',
success: res => {
this.setData({
projectId: app.globalData.projectId,
projectName: app.globalData.projectName,
loginName: res.data.loginName,
userName: res.data.nickName,
recheckSend: res.data.nickName,
recheckSendUser: res.data.loginName
});
this.getAllProjectUserData();
this.getDangerTypeList();
this.getHisInfo();
}
})
},
//查询项目人员数据
getAllProjectUserData() {
let that = this
wx.request({
url: app.globalData.reqUrl + '/wechat/projectuserinfo/queryAllProjectUserByParams',
method: "get",
data: {
projectId: that.data.projectId,
loginName: that.data.loginName
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res) {
res = res.data
if (res.code == 200) {
that.setData({
rectifierData: res.data,
rectifierData3: res.data,
})
}
}
})
wx.request({
url: app.globalData.reqUrl + '/wechat/projectuserinfo/queryAllProjectUserByParams',
method: "get",
data: {
projectId: that.data.projectId,
loginName: that.data.loginName,
selectMy: 'Y'
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res) {
res = res.data;
if (res.code == 200) {
let findMy = false;
res.data.forEach(it => {
if (it.userinfoList.length > 0) {
it.userinfoList.forEach(u => {
if (that.data.loginName == u.phonenumber) {
findMy = true;
}
});
}
});
if(!findMy){
res.data[0].userinfoList.push({state:false,nickName:that.data.userName,jobTypeName:'集团公司',phonenumber:that.data.loginName});
}
that.setData({
rectifierData2: res.data,
})
}
}
})
},
getHisInfo() {
//这里查询当前登录人上次提交隐患,自动填充整改人,复检人,抄送人
let that = this
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/findLastDataByParams',
method: "get",
data: {
projectId: that.data.projectId,
createUser: that.data.loginName,
infoType: 1
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res) {
res = res.data
if (res.code == 200 && res.data) {
that.setData({
showHis: true,
lordSent: res.data.lordSent,
lordSentUser: res.data.lordSentUser,
recheckSend: res.data.recheckSend,
recheckSendUser: res.data.recheckSendUser,
copySend: res.data.copySend,
copySendUser: res.data.copySendUser
})
}
}
})
},
getDangerTypeList() {
let that = this
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/queryDangerType',
method: "get",
data: {
type: 'ssp_zlyhlx'
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res) {
res = res.data
if (res.code == 200) {
let list = [];
res.data.forEach(it => {
list.push({
"id": it.dictValue,
"text": it.dictLabel
});
})
that.setData({
dangerTypeList: list
})
}
}
})
},
//隐患描述
onInputWorkParts(e) {
let workParts = e.detail.value
this.setData({
workParts
})
},
//整改要求
onInputChangeInfoValue(e) {
let changeInfo = e.detail.value
this.setData({
changeInfo
})
},
//验收时间
onInputTime(e) {
let nickedTime = e.detail
this.setData({
nickedTime
})
},
// list 上传图片
onImagesArr(e) {
var data = this.data.imageInfoData
data = e.detail
this.setData({
imageInfoData: data
})
},
//添加整改人
onAddLordSent(e) {
if (e.detail.length > 0) {
this.setData({
lordSent: e.detail[0].userName,
lordSentUser: e.detail[0].phoneNumber
})
}
},
//添加抄送人
onAddCopySend(e) {
if (e.detail.length > 0) {
let phoneNumbers = "";
let userNames = "";
e.detail.forEach(it => {
phoneNumbers += "," + it.phoneNumber;
userNames += "," + it.userName;
});
this.setData({
copySend: userNames.substring(1),
copySendUser: phoneNumbers.substring(1)
})
} else {
this.setData({
copySend: "",
copySendUser: ""
})
}
},
//添加复检人
onAddRecheckSend(e) {
if (e.detail.length > 0) {
this.setData({
recheckSend: e.detail[0].userName,
recheckSendUser: e.detail[0].phoneNumber
})
}
},
//取消页面
cancelSaveView() {
this.returnToPage()
},
//保存
onProblemSubmitSave() {
this.setData({
loadShow: true
})
let that = this
let {
projectId,
projectName,
dangerType,
lordSent,
lordSentUser,
copySend,
copySendUser,
workParts,
changeInfo,
nickedTime,
recheckSend,
recheckSendUser,
imageInfoData,
loginName,
problemType,
userName
} = that.data;
//数据效验
if (projectId == "" || loginName == "") {
app.toast("数据异常,请刷新页面重试!")
that.setData({
loadShow: false
})
return;
}
if (imageInfoData.length == 0) {
app.toast("请上传隐患现场图片!")
that.setData({
loadShow: false
})
return;
}
if (problemType == "") {
app.toast("请选择检查类型!")
that.setData({
loadShow: false
})
return;
}
if (dangerType == "") {
app.toast("请选择隐患类型!")
that.setData({
loadShow: false
})
return;
}
if (workParts == "") {
app.toast("请填写隐患描述!")
that.setData({
loadShow: false
})
return;
}
if (changeInfo == "") {
app.toast("请填写隐患整改要求!")
that.setData({
loadShow: false
})
return;
}
if (nickedTime == "") {
app.toast("请选择整改截至时间!")
that.setData({
loadShow: false
})
return;
}
if (lordSent == "" || lordSentUser == "") {
app.toast("请选择整改人!")
that.setData({
loadShow: false
})
return;
}
if (recheckSend == "" || recheckSendUser == "") {
app.toast("请选择复检人!")
that.setData({
loadShow: false
})
return;
}
if (copySend == "" || copySendUser == "") {
app.toast("请选择抄送人!")
that.setData({
loadShow: false
})
return;
}
let pos = copySend.split(",");
pos.forEach(it => {
if (it == lordSent) {
app.toast("抄送人中不能包含整改人!")
that.setData({
loadShow: false
})
return;
}
});
let fileUrls = [];
imageInfoData.forEach(async (item) => {
let uploadUrl = app.globalData.uploadUrl + '/common/upload'
let name = "file"
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(uploadUrl, item, name);
fileUrls.push(obj.data.fileName);
//验证图片上传完毕
if (fileUrls.length == imageInfoData.length) {
let params = {
projectId,
infoType: "1",
problemArea: projectName,
problemType,
workParts,
changeInfo,
lordSent,
lordSentUser,
copySend,
copySendUser,
checkState: 0,
nickedTime: nickedTime + " 23:59:59",
smarkUrl: fileUrls.toString(),
createUser: loginName,
dangerType,
recheckSend,
recheckSendUser
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/addQuality',
method: "POST",
data: params,
header: {
"Username": loginName,
"Content-Type": "application/json"
},
success(res) {
that.setData({
loadShow: false
})
res = res.data
if (res.code == 200) {
app.toast("添加成功!")
setTimeout(() => {
wx.redirectTo({
url: '../list/index',
})
}, 200)
}
}
})
}
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
syncUploadImage(url, uploadFile, name) {
return new Promise((resolve, reject) => {
wx.uploadFile({
url, // 上传的服务器接口地址
filePath: uploadFile,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
},
name, //上传的所需字段,后端提供
formData: {
user: 'test'
},
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)
}
});
})
},
//选择检查类型
onSelectProblemType(e) {
this.setData({
problemType: e.detail.id
})
},
//选择隐患类型
onSelectDangerType(e) {
this.setData({
dangerType: e.detail.id
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,141 @@
<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>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info ">
<view class="module_title module_title_flex">
<view>{{projectName}}</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">隐患图片</view>
<view class="inspect_info_content">
<file-uploader bindimages="onImagesArr"></file-uploader>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">检查类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{problemTypeList}}" placeholder="请选择检查类型" bindchange="onSelectProblemType"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">隐患类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{dangerTypeList}}" placeholder="请选择隐患类型" bindchange="onSelectDangerType" selectValue="{{activeName}}" selectIndex="{{activeIndex}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list" >
<view class="inspect_info_title">隐患描述</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写质量隐患描述"
placeholder-style="color:#6777aa;" bindinput="onInputWorkParts" maxlength="200"/>
</view>
</view>
<view class="inspect_info_list" >
<view class="inspect_info_title">整改要求</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写隐患整改要求"
placeholder-style="color:#6777aa;" bindinput="onInputChangeInfoValue" maxlength="200"/>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title">整改截至时间</view>
<view class="inspect_info_content">
<voucher-date counts="5" placeholder="请选择整改截至时间" minDate="{{minDate}}" maxDate="{{maxDate}}" bindchange="onInputTime"></voucher-date>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">整改人</view>
<view class="inspect_info_content">
<select-group-person rectifierData="{{rectifierData}}" multiple="{{fales}}" bindselected="onAddLordSent" index="1" title="请选择整改人" choose="{{lordSent}}">
</select-group-person>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">复检人</view>
<view class="inspect_info_content">
<select-group-person rectifierData="{{rectifierData2}}" multiple="{{fales}}" bindselected="onAddRecheckSend" index="2" title="请选择复检人" choose="{{recheckSend}}">
</select-group-person>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">抄送人</view>
<view class="inspect_info_content">
<select-group-person rectifierData="{{rectifierData3}}" multiple="{{true}}" bindselected="onAddCopySend" index="3" title="请选择抄送人" choose="{{copySend}}">
</select-group-person>
</view>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{showHis}}">
<text class="color_orange">已自动填充上次隐患的整改人,复检人,抄送人。</text>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onProblemSubmitSave">提交隐患</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="/../images/loding2.gif"></image>
<view>数据加载中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,6 @@
.van-popup{
background: none !important;
}
.van-image__img{
border-radius: 10rpx !important;
}

View File

@ -0,0 +1,304 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id:"",
infoData:{},
loadShow:false,
auditInfo:{},
reject:false,
rejectOpinion:"",
loadShow:false,
loginName:"",
imageList:[],
minImageList:[],
auditImageList:[],
auditMinImageList:[],
request:app.globalData.reqUrl,
flowNodes:[{text:'开始'},{text:'提交隐患'},{text:'隐患整改'},{text:'隐患复检'},{text:'结束'}],
active: 3
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {id} = options
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
id,
loginName:res.data.loginName
})
this.getInfo();
this.getAuditinfo();
}
})
},
/**
* 获取安全检查详情信息
*
*/
getInfo(){
let {id} = this.data
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectProblemmodify/info',
method:"get",
data:{
id:id
},
success(res){
res = res.data
if(res.code == 200){
let urls = [];
let minUrls = [];
if(res.data.smarkUrl){
res.data.smarkUrl.split(',').forEach(element => {
urls.push(that.data.request+element);
minUrls.push(that.data.request+element+'.min.jpg');
});
}
that.setData({
infoData:res.data,
imageList:urls,
minImageList:minUrls,
loadShow:false
})
}
}
})
},
getAuditinfo(){
let {id} = this.data
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectProblemmodify/queryAuditInfo',
method:"get",
data:{
id:id
},
success(res){
res = res.data
if(res.code == 200 && res.data){
let urls = [];
let minUrls = [];
if(res.data.fileUrls){
res.data.fileUrls.split(',').forEach(element => {
urls.push(that.data.request+element);
minUrls.push(that.data.request+element+'.min.jpg');
});
}
that.setData({
auditInfo:res.data,
auditImageList:urls,
auditMinImageList:minUrls
})
}
}
})
},
//取消页面
cancelSaveView(){
this.returnToPage()
},
//保存
onSubmitSave(status){
this.setData({
loadShow:true
})
let that = this
let {id,reject,rejectOpinion,loginName} = that.data;
//数据效验
if(id==""){
app.toast("数据异常,请刷新页面重试!")
that.setData({
loadShow:false
})
return;
}
if(reject && rejectOpinion==""){
app.toast("请填写整改驳回意见!")
that.setData({
loadShow:false
})
return;
}
let params = {
mainId:id,
processState:status,
opinion:rejectOpinion,
createUser:loginName
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/modifyProblem',
method:"POST",
data:params,
header: {
"Username": loginName,
"Content-Type": "application/json"
},
success(res){
that.setData({
loadShow:false
})
res =res.data
if(res.code == 200){
app.toast("操作成功!")
setTimeout(()=>{
wx.redirectTo({
url: '../list/index',
})
},200)
}
}
})
},
//审核驳回
onRejectSave(){
let that = this;
if(that.data.rejectOpinion!=""){
//弹出确认
wx.showModal({
title: '提示',
content: '是否确认复检驳回?',
success: function (sm) {
if (sm.confirm) {
// 用户点击了确定 可以调用了
that.onSubmitSave(2);
} else if (sm.cancel) {
console.log('用户点击取消');
}
}
})
}else{
app.toast("请填写整改驳回意见!")
that.setData({
loadShow:false
})
return;
}
},
//审核通过
onPassSave(){
let that = this;
//弹出确认
wx.showModal({
title: '提示',
content: '是否确定确认复检通过?',
success: function (sm) {
if (sm.confirm) {
// 用户点击了确定 可以调用了
that.setData({
reject:false
});
that.onSubmitSave(4);
} else if (sm.cancel) {
console.log('用户点击取消');
}
}
})
},
//展示图片
showImg:function(e){
var that=this;
wx.previewImage({
urls: that.data.imageList,
current: that.data.imageList[e.currentTarget.dataset.index]
})
},
//展示图片
showAuditinfoImg:function(e){
var that=this;
wx.previewImage({
urls: that.data.auditImageList,
current: that.data.auditImageList[e.currentTarget.dataset.index]
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
//驳回意见
onInputOpinion(e){
let rejectOpinion = e.detail.value
this.setData({
rejectOpinion
})
},
// list 上传图片
onImagesArr(e){
var data = this.data.imageInfoData
data = e.detail
this.setData({
imageInfoData:data
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,10 @@
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-collapse": "@vant/weapp/collapse",
"van-steps": "@vant/weapp/steps/index",
"van-collapse-item": "@vant/weapp/collapse-item",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,211 @@
<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>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" rejectNode="{{ active<100 && infoData.checkState=='3' ? active+1:0 }}" />
<view class="inspect_overview_max">
<view class="inspect_overview">
<view class="module_title module_title_padding">
<view>{{infoData.problemArea}}</view>
</view>
<view class="gk_open" style="margin-top: 20rpx;border: 1px solid transparent;">
<van-collapse value="{{activeName}}" bind:change="onChange">
<!-- <van-collapse-item title="申请流程" name="1">
<view class="left_manage2" wx:for="{{flowNodes}}" wx:key="index">
<text class="safety_issue_number {{item.state}}">{{item.name}}</text>
</view>
</van-collapse-item> -->
<van-collapse-item title="审批日志" name="2">
<view class="inspect_list">
<view class="inspect_for" wx:for="{{flowRecordList}}" 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">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
<view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}{{item.commentResult}}
<text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
<text wx:if="{{item.commentResult=='退回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
</view>
</view>
</view>
<view class="inspect_list_info gk_open_con">
<view wx:if="{{item.assigneeName}}">
<image src="/images/lw_3.png"></image>办理用户:<text>{{item.assigneeName}}</text>
</view>
<view wx:if="{{item.assigneeName}}">
<image src="/images/s_1.png"></image>办理单位:<text class="color_blue">{{item.deptName}}</text>
</view>
<view wx:if="{{item.candidate}}">
<image src="/images/s_2.png"></image>候选办理:<text>{{item.candidate}}</text>
</view>
<view wx:if="{{item.deleteReason}}">
<image src="/images/s_18.png"></image>驳回节点:<text>{{item.deleteReason}}</text>
</view>
<view>
<image src="/images/s_6.png"></image>接收时间:<text>{{item.startTime}}</text>
</view>
<view wx:if="{{item.endTime}}">
<image src="/images/lw_8.png"></image>处理时间:<text>{{item.endTime}}</text>
</view>
<view wx:if="{{item.duration}}">
<image src="/images/img_11.png"></image>处理耗时:<text>{{item.duration}}</text>
</view>
<view wx:if="{{item.message}}">
<image src="/images/s_7.png"></image>处理意见:<text>{{item.message}}</text>
</view>
</view>
</view>
</view>
</view>
</van-collapse-item>
</van-collapse>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{minImageList}}" wx:key="index">
<image bindtap='showImg' data-index="{{index}}" src='{{item}}'></image>
</view>
</view>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">问题类型</text></van-col>
<van-col span="18">
<text class="timeline_for_state_1" wx:if="{{infoData.problemType=='1'}}">常规检查</text>
<text class="timeline_for_state_2" wx:if="{{infoData.problemType=='2'}}">专项检查</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患类型</text></van-col>
<van-col span="18">{{infoData.dangerTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患描述</text></van-col>
<van-col span="18">{{infoData.workParts}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改要求</text></van-col>
<van-col span="18">{{infoData.changeInfo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查单位</text></van-col>
<van-col span="18">{{infoData.deptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查人</text></van-col>
<van-col span="18">{{infoData.createUserName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查时间</text></van-col>
<van-col span="18">{{infoData.createTime}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改人</text></van-col>
<van-col span="18" class="color_blue">{{infoData.lordSent}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">抄送人</text></van-col>
<van-col span="18">{{infoData.copySend}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检人</text></van-col>
<van-col span="18">{{infoData.recheckSend}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">截至时间</text></van-col>
<van-col span="18">{{infoData.nickedTime}}</van-col>
</van-row>
</view>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{infoData.checkState==1 || infoData.checkState==4}}">
<view class="module_title module_title_padding">
<view>问题整改</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改说明</text></van-col>
<van-col span="18">{{auditInfo.opinion}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改后图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{auditMinImageList}}" wx:key="index">
<image bindtap='showAuditinfoImg' data-index="{{index}}" src='{{item}}'></image>
</view>
</view>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{infoData.checkState==4}}">
<van-row>
<van-col span="6"><text class="color_purple">完成时间</text></van-col>
<van-col span="18" class="color_green">{{infoData.nickedTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="true">
<view class="module_title module_title_padding">
<view>整改复检意见</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_info_list">
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写整改复检意见" placeholder-style="color:#6777aa;" bindinput="onInputOpinion" maxlength="200" />
</view>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="onRejectSave">整改驳回</view>
<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onPassSave">整改通过</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="/../images/loding2.gif"></image>
<view>数据加载中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,22 @@
.in-img-max:after{
display:block;
clear:both;
content:"";
visibility:hidden;
height:0
}
.in-img-max{
width: auto;
zoom:1
}
.in-img-div{
position: relative;
margin: 0 8px 8px 0;
float: left;
}
.in-img-div image{
width: 180rpx;
height: 180rpx;
border-radius: 15rpx;
position: relative;
}

View File

@ -0,0 +1,368 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
maxDate: new Date(2088, 1, 1).getTime(),
minDate: new Date().getTime() + (3600 * 48 * 1000),
projectId: "",
projectName: "",
loginName: "",
userName: "",
rectifierData: [],
loadShow: false,
showHis: false,
inspectInfoData: [{
image_upload: []
}],
lordSent: "",
lordSentUser: "",
flowNodes: [{
text: '开始'
}, {
text: '提交隐患'
}, {
text: '隐患整改'
}, {
text: '隐患复检'
}, {
text: '结束'
}],
active: 0,
problemType: "1",
problemTypeList: [{
id: 1,
text: '常规检查'
}, {
id: 2,
text: '专项检查'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success: res => {
this.setData({
projectId: app.globalData.projectId,
projectName: app.globalData.projectName,
loginName: res.data.loginName,
userName: res.data.nickName
})
this.getAllProjectUserData();
this.getHisInfo();
}
})
},
//查询项目人员数据
getAllProjectUserData() {
let that = this
wx.request({
url: app.globalData.reqUrl + '/wechat/projectuserinfo/selectProjectUnitUser',
method: "get",
data: {
projectId: that.data.projectId,
loginName: that.data.loginName
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res) {
res = res.data
if (res.code == 200) {
that.setData({
rectifierData: res.data
})
}
}
})
},
getHisInfo() {
//这里查询当前登录人上次提交隐患,自动填充整改人,复检人,抄送人
let that = this
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/findDraftLastDataByParams',
method: "get",
data: {
projectId: that.data.projectId,
createUser: that.data.loginName,
infoType: 1
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res) {
res = res.data
if (res.code == 200 && res.data) {
that.setData({
showHis: true,
lordSent: res.data.lordSent,
lordSentUser: res.data.lordSentUser
})
}
}
})
},
// list 上传图片
onImagesArr(e) {
var index = e.currentTarget.dataset.index
var data = this.data.inspectInfoData
data[index].image_upload = e.detail
this.setData({
inspectInfoData: data
})
},
//添加整改人
onAddLordSent(e) {
if (e.detail.length > 0) {
this.setData({
lordSent: e.detail[0].userName,
lordSentUser: e.detail[0].phoneNumber
})
}
},
//取消页面
cancelSaveView() {
this.returnToPage()
},
//保存
onProblemSubmitSave() {
this.setData({
loadShow: true
})
let that = this
let {
projectId,
projectName,
problemType,
lordSent,
lordSentUser,
loginName,
inspectInfoData
} = that.data;
//数据效验
if (projectId == "" || loginName == "") {
app.toast("数据异常,请刷新页面重试!")
that.setData({
loadShow: false
})
return;
}
if (problemType == "") {
app.toast("请选择问题类型!")
that.setData({
loadShow: false
})
return;
}
if (lordSent == "" || lordSentUser == "") {
app.toast("请选择整改人!")
that.setData({
loadShow: false
})
return;
}
let fileUrls = [];
inspectInfoData.forEach(async (item) => {
let beforeCheckUrl = [];
item.image_upload.forEach(async (it) => {
let uploadUrl = app.globalData.uploadUrl + '/common/upload'
let name = "file";
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(uploadUrl, it, name);
beforeCheckUrl.push(obj.data.fileName);
if (beforeCheckUrl.length >= item.image_upload.length) {
fileUrls.push(beforeCheckUrl);
}
//验证图片上传完毕
if (fileUrls.length >= inspectInfoData.length) {
let params = {
projectId,
infoType: "1",
problemArea: projectName,
problemType,
lordSent,
lordSentUser,
checkState: 0,
fileUrls: fileUrls,
createUser: loginName
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/addQualityDraft',
method: "POST",
data: params,
header: {
"Username": loginName,
"Content-Type": "application/json"
},
success(res) {
that.setData({
loadShow: false
})
res = res.data
if (res.code == 200) {
app.toast("添加成功!")
setTimeout(() => {
if (wx.getStorageSync('nav-menu') == "list") {
wx.redirectTo({
url: '../list/index',
})
} else {
wx.redirectTo({
url: '../../../../pages/quality_manage/index',
})
}
}, 200);
}
}
})
}
});
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
syncUploadImage(url, uploadFile, name) {
return new Promise((resolve, reject) => {
wx.uploadFile({
url, // 上传的服务器接口地址
filePath: uploadFile,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
},
name, //上传的所需字段,后端提供
formData: {
user: 'test'
},
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)
}
});
})
},
/**
* 选择问题类型
* @param {*} e
*/
onSelectProblemType(e) {
this.setData({
problemType: e.detail.id,
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
if (wx.getStorageSync('nav-menu') == "list") {
wx.redirectTo({
url: '../list/index',
})
} else {
wx.redirectTo({
url: '../../../../pages/quality_manage/index',
})
}
},
//新增问题
onNewIssues() {
var data = this.data.inspectInfoData
if (data.length == 5) {
app.toast("一次最多只能提交5个问题!");
return false;
}
data.push({
image_upload: []
})
this.setData({
inspectInfoData: data
})
},
//删除
onNewIssuesDelete(e) {
var index = e.currentTarget.dataset.index
var data = this.data.inspectInfoData
data.splice(index, 1)
this.setData({
inspectInfoData: data
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-steps": "@vant/weapp/steps/index",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,113 @@
<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>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" />
<view class="inspect_info ">
<view class="module_title_2 module_title_flex">
<view>{{projectName}}</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">问题类型</view>
<view class="inspect_info_content">
<voucher-select columns="{{problemTypeList}}" placeholder="请选择问题类型" bindchange="onSelectProblemType" selectValue="{{problemType}}"></voucher-select>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">整改人员</view>
<view class="inspect_info_content">
<select-group-person rectifierData="{{rectifierData}}" multiple="{{fales}}" bindselected="onAddLordSent" index="1" title="请选择整改人员" choose="{{lordSent}}">
</select-group-person>
</view>
</view>
<view class="safety_inspect_title module_title_flex" wx:if="{{showHis}}">
<text class="color_orange">已自动填充上次选择的隐患整改人员。</text>
</view>
<view class="inspect_info_list" wx:for="{{inspectInfoData}}" wx:key="index">
<view class="module_title module_title_flex">
<view>问题 {{index + 1}}</view>
<view class="module_see_info_delete" wx:if="{{index != 0}}" bindtap="onNewIssuesDelete" data-index="{{index}}"><van-icon name="delete" /> 删除</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 20rpx;">检查图片</view>
<view class="problem_list_info_con">
<file-uploader bindimages="onImagesArr" data-index="{{index}}" fileUrlArray="{{item.image_upload}}"></file-uploader>
</view>
</view>
</view>
<view class="inspect_new_issues_max">
<view class="inspect_new_issues" bindtap="onNewIssues"><van-icon name="add-o" style="position: relative;top:5rpx"/> 新增问题</view>
</view>
<view class="safety_prop module_title_flex" wx:if="{{showHis}}">
<text class="color_orange">草稿添加的数据在电脑端提交后生效!</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="onProblemSubmitSave">保存草稿</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="/../images/loding2.gif"></image>
<view>数据加载中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,6 @@
.van-popup{
background: none !important;
}
.van-image__img{
border-radius: 10rpx !important;
}

View File

@ -0,0 +1,252 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id: "",
infoData: {},
loadShow: false,
auditInfo: {},
loginName: "",
showDel: false,
imageList: [],
minImageList: [],
auditImageList: [],
auditMinImageList: [],
request: app.globalData.reqUrl,
flowNodes: [{
text: '开始'
}, {
text: '提交隐患'
}, {
text: '隐患整改'
}, {
text: '隐患复检'
}, {
text: '结束'
}],
active: 100
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {
id
} = options
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success: res => {
this.setData({
id,
loginName: res.data.loginName
})
this.getInfo();
this.getAuditinfo();
}
})
},
/**
* 获取安全检查详情信息
*
*/
getInfo() {
let {
id
} = this.data
let that = this
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/info',
method: "get",
data: {
id: id
},
success(res) {
res = res.data
if (res.code == 200) {
let state = that.data.active;
if (res.data.checkState == "0") {
state = 2;
} else if (res.data.checkState == "1") {
state = 3;
} else if (res.data.checkState == "3") {
state = 1;
}
that.setData({
active: state
})
let urls = [];
let minUrls = [];
if (res.data.smarkUrl) {
res.data.smarkUrl.split(',').forEach(element => {
urls.push(that.data.request + element);
minUrls.push(that.data.request + element + '.min.jpg');
});
}
that.setData({
infoData: res.data,
imageList: urls,
minImageList: minUrls,
loadShow: false
})
//判断当前能否删除
if (res.data.checkState != 4 && res.data.createUser == that.data.loginName) {
that.setData({
showDel: true
})
}
}
}
})
},
getAuditinfo() {
let {
id
} = this.data
let that = this
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/queryAuditInfo',
method: "get",
data: {
id: id
},
success(res) {
res = res.data
if (res.code == 200 && res.data) {
let urls = [];
let minUrls = [];
if (res.data.fileUrls) {
res.data.fileUrls.split(',').forEach(element => {
urls.push(that.data.request + element);
minUrls.push(that.data.request + element + '.min.jpg');
});
}
that.setData({
auditInfo: res.data,
auditImageList: urls,
auditMinImageList: minUrls
})
}
}
})
},
onDelete() {
//弹出确认
let that = this
wx.showModal({
title: '提示',
content: '是否确定删除此条数据?',
success: function (sm) {
if (sm.confirm) {
// 用户点击了确定 可以调用了
that.deleteData();
} else if (sm.cancel) {
console.log('用户点击取消');
}
}
})
},
deleteData() {
let {
id
} = this.data
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/removeQuality',
header: {
"Username": this.data.loginName,
},
data: {
id: id
},
method: "get",
success(res) {
app.toast("删除成功!")
wx.redirectTo({
url: `../list/index`,
})
}
})
},
//展示图片
showImg: function (e) {
var that = this;
wx.previewImage({
urls: that.data.imageList,
current: that.data.imageList[e.currentTarget.dataset.index]
})
},
//展示图片
showAuditinfoImg: function (e) {
var that = this;
wx.previewImage({
urls: that.data.auditImageList,
current: that.data.auditImageList[e.currentTarget.dataset.index]
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"van-collapse": "@vant/weapp/collapse",
"van-steps": "@vant/weapp/steps/index",
"van-collapse-item": "@vant/weapp/collapse-item"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,169 @@
<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>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" rejectNode="{{ active<100 && infoData.checkState=='3' ? active+1:0 }}" />
<view class="inspect_overview_max">
<view class="inspect_overview">
<view class="module_title module_title_padding">
<view>{{infoData.problemArea}}</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{minImageList}}" wx:key="index">
<image bindtap='showImg' data-index="{{index}}" src='{{item}}'></image>
</view>
</view>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">问题类型</text></van-col>
<van-col span="18">
<text class="timeline_for_state_1" wx:if="{{infoData.problemType=='1'}}">常规检查</text>
<text class="timeline_for_state_2" wx:if="{{infoData.problemType=='2'}}">专项检查</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患类型</text></van-col>
<van-col span="18">{{infoData.dangerTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患描述</text></van-col>
<van-col span="18">{{infoData.workParts}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改要求</text></van-col>
<van-col span="18">{{infoData.changeInfo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查单位</text></van-col>
<van-col span="18">{{infoData.deptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查人</text></van-col>
<van-col span="18">{{infoData.createUserName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查时间</text></van-col>
<van-col span="18">{{infoData.createTime}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改人</text></van-col>
<van-col span="18" class="color_blue">
{{infoData.lordSent}}
<text class="code_label_2 code_label_green" wx:if="{{infoData.zgDeptType=='1'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">集团公司</text>
<text class="code_label_2 code_label_green" wx:if="{{infoData.zgDeptType=='11'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">子公司</text>
<text class="code_label_2 code_label_green" wx:if="{{infoData.zgDeptType=='2'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">总包单位</text>
<text class="code_label_2 code_label_green" wx:if="{{infoData.zgDeptType=='3'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">分包单位</text>
<text class="code_label_2 code_label_green" wx:if="{{infoData.zgDeptType=='4'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">监理单位</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">抄送人</text></van-col>
<van-col span="18"> {{infoData.copySend}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检人</text></van-col>
<van-col span="18">{{infoData.recheckSend}}
<text class="code_label_2 code_label_green" wx:if="{{infoData.fjDeptType=='1'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">集团公司</text>
<text class="code_label_2 code_label_green" wx:if="{{infoData.fjDeptType=='11'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">子公司</text>
<text class="code_label_2 code_label_green" wx:if="{{infoData.fjDeptType=='2'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">总包单位</text>
<text class="code_label_2 code_label_green" wx:if="{{infoData.fjDeptType=='3'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">分包单位</text>
<text class="code_label_2 code_label_green" wx:if="{{infoData.fjDeptType=='4'}}" style="padding: 5rpx 50rpx;font-size: 25rpx;">监理单位</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">截至时间</text></van-col>
<van-col span="18">{{infoData.nickedTime}}</van-col>
</van-row>
</view>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{infoData.checkState=='1' || infoData.checkState=='4'}}">
<view class="module_title module_title_padding">
<view>问题整改</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改说明</text></van-col>
<van-col span="18">{{auditInfo.opinion}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改后图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{auditMinImageList}}" wx:key="index">
<image bindtap='showAuditinfoImg' data-index="{{index}}" src='{{item}}'></image>
</view>
</view>
</van-row>
</view>
<view class="inspect_overview_list" wx:if="{{infoData.checkState==4}}">
<van-row>
<van-col span="6"><text class="color_purple">完成时间</text></van-col>
<van-col span="18" class="color_green">{{infoData.nickedTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{infoData.checkState==3}}">
<view class="module_title module_title_padding">
<view>问题整改驳回</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">驳回意见</text></van-col>
<van-col span="18">{{auditInfo.opinion}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">驳回时间</text></van-col>
<van-col span="18" class="color_orange">{{auditInfo.createTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="problem_submit_to" wx:if="{{showDel}}">
<view class="problem_submit_to_btn problem_submit_to_delete" bindtap="onDelete">删除</view>
</view>
</view>

View File

@ -0,0 +1,22 @@
.in-img-max:after{
display:block;
clear:both;
content:"";
visibility:hidden;
height:0
}
.in-img-max{
width: auto;
zoom:1
}
.in-img-div{
position: relative;
margin: 0 8px 8px 0;
float: left;
}
.in-img-div image{
width: 180rpx;
height: 180rpx;
border-radius: 15rpx;
position: relative;
}

View File

@ -0,0 +1,293 @@
import {
getToken
} from '../../../utils/auth'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
type:"",
typeName:"",
addFlag:false,
addDraftFlag:false,
deptId:"",
loginName:"",
userName:"",
projectId:"",
projectData:{},
projectNameArgs:"",
initData: {},
show:false,
listData:[],
activeState:"zg",
dzgCount:0,
dfjCount:0,
yclCount:0,
zgcsCOunt:0,
request:app.globalData.reqUrl,
pageNum:1,
pageSize:10,
lastDataSize:10,
minRoleId:"",
list:[],
},
skipAdd(){
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=`+this.data.initData.text,
})
},
skipAddDarft(){
wx.setStorageSync('nav-menu', "list");
wx.redirectTo({
url: `../draft/index`,
})
},
getInfo(e){
let {id,checkState,lordSentUser,recheckSendUser} = e.currentTarget.dataset.set
if((checkState==0 || checkState==3) && lordSentUser==this.data.loginName){
//整改页面(状态时待整改&&整改人是当前登录人)
wx.redirectTo({
url: `../modify/index?id=${id}`,
})
}else if(checkState==1 && recheckSendUser==this.data.loginName){
//复检页面 (状态时待复检&&复检人是当前登录人)
wx.redirectTo({
url: `../check/index?id=${id}`,
})
}else{
wx.redirectTo({
url: `../info/index?id=${id}`,
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(!getToken()){
wx.redirectTo({
url: '../../login/index',
})
}
//获取缓存数据
wx.getStorage({
key: 'YanZhu-XD-App-UserInfoKey',
success:res=>{
console.log("YanZhu-XD-App-UserInfoKey");
this.setData({
type:options.type,
typeName:options.type==1?"质量":"安全",
deptId:res.data.deptId,
loginName:res.data.loginName,
userName:res.data.userName,
minRoleId:res.data.minRoleId,
projectId:app.globalData.projectId,
projectNameArgs:app.globalData.projectName,
initData:{id:app.globalData.useProjectId,text:app.globalData.useProjectName},
pageNum:1,
pageSize:10,
lastDataSize:10,
listData:[]
});
//this.getListData();
}
})
},
/**
* 查询项目质量隐患排查数据
*/
getListData() {
//进入这里说明数据加载完毕
if(this.data.lastDataSize<this.data.pageSize){
//app.toast("已经到底了,暂无可继续加载数据!")
return;
}
let nowRole = "99";
//判断角色,
if(this.data.minRoleId==2||this.data.minRoleId==3||this.data.minRoleId==4){
nowRole="-1";
}
let param = {
"infoType":"1",//1质量类0安全类
"projectId": this.data.projectId,
"nowRole":nowRole,//默认传普通角色,真实角色查看的数据量太大,这里只查看自己相关的数据
"nowUser":this.data.loginName,
"activeName":this.data.activeState
}
var that = this;
that.queryCount(param);
param.pageNum=that.data.pageNum;
param.pageSize=that.data.pageSize;
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/list',
data:param,
method: "get",
success: function (res) {
res = res.data;
if(res.code=="200"){
//这里处理this.data.lastDataSize=this.data.pageSize
if(that.data.list.length>0 && res.data.length>0 && that.data.list[0].id==res.data[0].id){
that.setData({
lastDataSize:0,
})
}else{
that.setData({
pageNum:that.data.pageNum+1,
lastDataSize:res.data.length,
list:res.data,
listData:that.data.listData.concat(res.data)
})
}
}
}
});
},
queryCount(param){
let that = this;
//查询统计数量
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/queryCount',
data: param,
method: "get",
success: function (res) {
let sum1=0;
let sumfj=0;
if(res.data.data.check0){
sum1+=res.data.data.check0;
}
if(res.data.data.check1){
sumfj+=res.data.data.check1;
}
if(res.data.data.check3){
sum1+=res.data.data.check3;
}
let sum4=0;
let sum99=0;
if(res.data.data.check4){
sum4+=res.data.data.check4;
}
if(res.data.data.check99){
sum99+=res.data.data.check99;
}
that.setData({
dzgCount:sum1,
dfjCount:sumfj,
yclCount:sum4,
zgcsCount:sum99
});
}
});
},
/**
* 标签切换
*/
trainingTypeJump(e){
let index = e.currentTarget.dataset.index;
let nav = "";
if(index == 1){
nav = 'zg';
}if(index == 2){
nav = 'fj';
}else if(index == 3){
nav = 'ycl';
}else if(index == 4){
nav = 'zgcs';
}
this.setData({
activeState:nav,
pageNum:1,
pageSize:10,
lastDataSize:10,
listData:[],
list:[]
});
this.getListData();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
if(wx.getStorageSync('nav-menu')=="gd"){
wx.redirectTo({
url: '../../../../pages/gengduogongneng/index',
})
}else{
wx.redirectTo({
url: '../../../../pages/quality_manage/index',
})
}
},
//项目切换 返回值
onProjectSelect(e){
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.projectId = projectId;
app.globalData.projectName = projectName;
this.onLoad();
},
onScrollToLower(){
console.log("滚动条到底了,开始加载新数据");
this.getListData();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"van-overlay": "@vant/weapp/overlay/index" ,
"van-popup": "@vant/weapp/popup/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,77 @@
<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">{{typeName}}隐患排查</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=='zg'?'active':''}}" bindtap="trainingTypeJump" data-index="1"><text>整改({{dzgCount}}</text></view>
<view class="{{activeState=='fj'?'active':''}}" bindtap="trainingTypeJump" data-index="2"><text>复检({{dfjCount}}</text></view>
<view class="{{activeState=='ycl'?'active':''}}" bindtap="trainingTypeJump" data-index="3"><text>完成({{yclCount}}</text></view>
<view class="{{activeState=='zgcs'?'active':''}}" bindtap="trainingTypeJump" data-index="4"><text>超时({{zgcsCount}}</text></view>
</view>
<view class="inspect_max_scroll">
<!--专项检查样式zxjc-->
<view class="inspect_for_scroll {{item.problemType=='2'?'':''}}" v-if="{{ listData.length>0 }}" wx:for="{{listData}}" wx:key="index" data-set="{{item}}" 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 < 9 ?'0'+(index+1):(index+1)}}</view>
<view class="module_title_3 module_title_flex inspect_list_title_text_2">
<view wx:if="{{item.checkState==0}}" class="code_label code_label_yellow">待整改</view>
<view wx:if="{{item.checkState==1}}" class="code_label code_label_blueviolet">待复检</view>
<view wx:if="{{item.checkState==3}}" class="code_label code_label_red">复检驳回</view>
<view wx:if="{{item.checkState==4}}" class="code_label code_label_green">整改完成</view>
</view>
<text class="timeline_for_state_1" wx:if="{{item.problemType=='1'}}">常规检查</text>
<text class="timeline_for_state_2" wx:if="{{item.problemType=='2'}}">专项检查</text>
</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="{{request+item.marksPicture+'.min.jpg'}}" />
</view>
<view class="inspect_list_info_data">
<view class="inspect_list_info_data_prop color_blue">隐患类型:<text>{{item.dangerTypeName}}</text></view>
<view class="inspect_list_info_data_prop">隐患描述:<text>{{item.workParts}}</text></view>
<view class="inspect_list_info_data_prop">检查单位:<text>{{item.deptName}}</text></view>
<view class="inspect_list_info_data_prop">检查时间:<text class="color_blue">{{item.createTime}}</text></view>
</view>
</view>
<view class="inspect_list_info_position">
整改要求:<text class="color_purple">{{item.changeInfo}}</text>
</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 wx:if="{{addDraftFlag}}" class="inspect_add_to_darft" bindtap="skipAddDarft">
<view style="padding-top: 22rpx;">
<image src="/images/new_add.png"></image>
<view>草稿</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 @@
/* pages/project_problemmodify/list/index.wxss */

View File

@ -0,0 +1,299 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id:"",
infoData:{},
loadShow:false,
auditInfo:{},
opinion:"",
imageInfoData:[],
loadShow:false,
loginName:"",
status:"0",
imageList:[],
minImageList:[],
request:app.globalData.reqUrl,
flowNodes:[{text:'开始'},{text:'提交隐患'},{text:'隐患整改'},{text:'隐患复检'},{text:'结束'}],
active: 2
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {id} = options
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
id,
loginName:res.data.loginName
})
this.getInfo();
this.getAuditinfo();
}
})
},
/**
* 获取安全检查详情信息
*
*/
getInfo(){
let {id} = this.data
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectProblemmodify/info',
method:"get",
data:{
id:id
},
success(res){
res = res.data
if(res.code == 200){
let urls = [];
let minUrls = [];
if(res.data.smarkUrl){
res.data.smarkUrl.split(',').forEach(element => {
urls.push(that.data.request+element);
minUrls.push(that.data.request+element+'.min.jpg');
});
}
that.setData({
infoData:res.data,
imageList:urls,
minImageList:minUrls,
loadShow:false
})
}
}
})
},
getAuditinfo(){
let {id} = this.data
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectProblemmodify/queryAuditInfo',
method:"get",
data:{
id:id
},
success(res){
res = res.data
if(res.code == 200 && res.data){
let urls = [];
if(res.data.fileUrls){
res.data.fileUrls.split(',').forEach(element => {
urls.push(element+'.min.jpg');
});
}
that.setData({
auditInfo:res.data,
auditImgs:urls
})
}
}
})
},
//取消页面
cancelSaveView(){
this.returnToPage()
},
//保存
onSubmitSave(){
this.setData({
loadShow:true
})
let that = this
let {id,opinion,status,imageInfoData,loginName} = that.data;
//数据效验
if(id==""){
app.toast("数据异常,请刷新页面重试!")
that.setData({
loadShow:false
})
return;
}
if(opinion==""){
app.toast("请填写整改说明!")
that.setData({
loadShow:false
})
return;
}
if(imageInfoData.length==0){
app.toast("请上传整改后图片!")
that.setData({
loadShow:false
})
return;
}
let fileUrls = [];
imageInfoData.forEach(async (item)=>{
let uploadUrl = app.globalData.uploadUrl+'/common/upload'
let name = "file"
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(uploadUrl,item,name);
fileUrls.push(obj.data.fileName);
//验证图片上传完毕
if(fileUrls.length == imageInfoData.length){
let params = {
mainId:id,
processState:status,
opinion,
createUser:loginName,
fileUrls:fileUrls.toString()
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectProblemmodify/modifyProblem',
method:"POST",
data:params,
header: {
"Username": loginName,
"Content-Type": "application/json"
},
success(res){
that.setData({
loadShow:false
})
res =res.data
if(res.code == 200){
app.toast("提交成功!")
setTimeout(()=>{
wx.redirectTo({
url: '../list/index',
})
},200)
}
}
})
}
})
},
/**
* 这里考虑上传图片异步问题封装为同步
*/
syncUploadImage(url,uploadFile,name) {
return new Promise((resolve, reject) => {
wx.uploadFile({
url, // 上传的服务器接口地址
filePath: uploadFile,
header: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
},
name, //上传的所需字段,后端提供
formData: { user: 'test' },
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)
}
});
})
},
//展示图片
showImg:function(e){
var that=this;
wx.previewImage({
urls: that.data.imageList,
current: that.data.imageList[e.currentTarget.dataset.index]
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
//验收描述
onInputOpinion(e){
let opinion = e.detail.value
this.setData({
opinion
})
},
// list 上传图片
onImagesArr(e){
var data = this.data.imageInfoData
data = e.detail
this.setData({
imageInfoData:data
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,10 @@
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-collapse": "@vant/weapp/collapse",
"van-steps": "@vant/weapp/steps/index",
"van-collapse-item": "@vant/weapp/collapse-item",
"van-overlay": "@vant/weapp/overlay/index"
},
"navigationStyle":"custom"
}

View File

@ -0,0 +1,154 @@
<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>
<view class="max_content">
<van-steps steps="{{ flowNodes }}" active="{{ active }}" rejectNode="{{ active<100 && infoData.checkState=='3' ? active+1:0 }}" />
<view class="inspect_overview_max">
<view class="inspect_overview">
<view class="module_title module_title_padding">
<view>{{infoData.problemArea}}</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患图片</text></van-col>
<view class="problem_list_info_con in-img-max">
<view class="in-img-div" wx:for="{{minImageList}}" wx:key="index">
<image bindtap='showImg' data-index="{{index}}" src='{{item}}'></image>
</view>
</view>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">问题类型</text></van-col>
<van-col span="18">
<text class="timeline_for_state_1" wx:if="{{infoData.problemType=='1'}}">常规检查</text>
<text class="timeline_for_state_2" wx:if="{{infoData.problemType=='2'}}">专项检查</text>
</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患类型</text></van-col>
<van-col span="18">{{infoData.dangerTypeName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">隐患描述</text></van-col>
<van-col span="18">{{infoData.workParts}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改要求</text></van-col>
<van-col span="18">{{infoData.changeInfo}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查单位</text></van-col>
<van-col span="18">{{infoData.deptName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查人</text></van-col>
<van-col span="18">{{infoData.createUserName}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">检查时间</text></van-col>
<van-col span="18">{{infoData.createTime}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">整改人</text></van-col>
<van-col span="18" class="color_blue">{{infoData.lordSent}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">抄送人</text></van-col>
<van-col span="18">{{infoData.copySend}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">复检人</text></van-col>
<van-col span="18">{{infoData.recheckSend}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">截至时间</text></van-col>
<van-col span="18">{{infoData.nickedTime}}</van-col>
</van-row>
</view>
</view>
</view>
</view>
<view class="inspect_overview" wx:if="{{infoData.checkState==3}}">
<view class="module_title module_title_padding">
<view>问题整改驳回</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">驳回意见</text></van-col>
<van-col span="18">{{auditInfo.opinion}}</van-col>
</van-row>
</view>
<view class="inspect_overview_list">
<van-row>
<van-col span="6"><text class="color_purple">驳回时间</text></van-col>
<van-col span="18" class="color_orange">{{auditInfo.createTime}}</van-col>
</van-row>
</view>
</view>
</view>
<view class="inspect_overview">
<view class="module_title module_title_padding">
<view>问题整改</view>
</view>
<view class="inspect_overview_list_max">
<view class="inspect_info_list" >
<view class="inspect_info_title">整改说明</view>
<view class="inspect_info_content">
<textarea class="add_textarea" placeholder="请填写整改说明"
placeholder-style="color:#6777aa;" bindinput="onInputOpinion" maxlength="200"/>
</view>
</view>
<view class="inspect_info_list">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">整改后图片</view>
<view class="problem_list_info_con">
<file-uploader bindimages="onImagesArr"></file-uploader>
</view>
</view>
</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="onSubmitSave">保存</view>
</view>
</view>
<van-overlay show="{{loadShow}}">
<view class="gif">
<image src="/../images/loding2.gif"></image>
<view>数据加载中!请稍后...</view>
</view>
</van-overlay>

View File

@ -0,0 +1,22 @@
.in-img-max:after{
display:block;
clear:both;
content:"";
visibility:hidden;
height:0
}
.in-img-max{
width: auto;
zoom:1
}
.in-img-div{
position: relative;
margin: 0 8px 8px 0;
float: left;
}
.in-img-div image{
width: 180rpx;
height: 180rpx;
border-radius: 15rpx;
position: relative;
}

View File

@ -2,6 +2,7 @@ import config from '../../config'
import {
setToken,
setUserInfo,
getUserInfo,
getOpenId,
setOpenId,
getSessionKey,
@ -20,7 +21,8 @@ import {
registerSubDeptsUsers,
findProSubDeptsUser,
findProSubDeptsInfo,
findProSubDeptsUserById
findProSubDeptsUserById,
findProSubDeptsUserInfo
} from '../../api/project'
import {
findBusExamInfos,
@ -2026,10 +2028,17 @@ if (this.data.userPost == "1") {
if(res.rows.length==1){
app.globalData.useProjectId = res.rows[0].id;
app.globalData.useProjectName = res.rows[0].projectName;
//单项目直接进入项目页面
wx.redirectTo({
url: '../project_info/index',
})
findProSubDeptsUserInfo(app.globalData.useProjectId).then(detail=>{
if(detail.code==200){
let userInfo = getUserInfo();
userInfo.projectUserInfo = detail.data;
setUserInfo(userInfo);
//单项目直接进入项目页面
wx.redirectTo({
url: '../project_info/index',
})
}
});
}else{
//多项目进入项目切换页面
wx.redirectTo({

View File

@ -18,9 +18,9 @@ export function getBusExamUser(id) {
}
// 查询用户试卷详细
export function getBusExamUserLast(userId) {
export function getBusExamUserLast(proId, userId) {
return request({
url: '/manage/busExamUser/last/' + userId,
url: '/manage/busExamUser/last/' + proId+'?userId='+userId,
method: 'get'
})
}

View File

@ -18,9 +18,9 @@ export function getBusTrainingVideoUser(id) {
}
// 查询用户培训视频详细
export function getBusTrainingVideoUserLast(userId) {
export function getBusTrainingVideoUserLast(proId, userId) {
return request({
url: '/manage/busTrainingVideoUser/last/' + userId,
url: '/manage/busTrainingVideoUser/last/' + proId+'?userId='+userId,
method: 'get'
})
}

View File

@ -159,7 +159,10 @@
<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'">
<el-form-item label="民族" v-if="dataOptions.category!='1'">
{{ initData.userInfos.nation }}
</el-form-item>
<el-form-item label="籍贯" v-if="dataOptions.category!='1'">
{{ initData.userInfos.nativePlace }}
</el-form-item>
<el-form-item label="详细地址" v-if="dataOptions.category!='1'">
@ -374,7 +377,7 @@
subDeptInfos:{}
},
initData: {
user: {}
userInfos: {}
},
});
@ -433,7 +436,7 @@
} else {
jdtitle.value = "已完成";
}
activeName.value = "base";
activeName.value = "users";
initFormValues();
getFlowRecordList(options.procInsId, options.deployId);
flowXmlAndNode({ procInsId: options.procInsId, deployId: options.deployId }).then(
@ -498,14 +501,14 @@
/** 用户视频培训 */
function findEduVideos(){
getBusTrainingVideoUserLast(dataOptions.value.startUserId).then(res =>{
getBusTrainingVideoUserLast(dataOptions.value.startProId, dataOptions.value.startUserId).then(res =>{
userEduVideoList.value = res.data||[]
});
}
/** 用户考试情况 */
function findEduExams(){
getBusExamUserLast(dataOptions.value.startUserId).then(res =>{
getBusExamUserLast(dataOptions.value.startProId, dataOptions.value.startUserId).then(res =>{
if(res.code==200 && res.data){
userEduExamInfos.value = res.data;
let list = res.data.busExamUserResultList;

View File

@ -159,7 +159,10 @@
<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'">
<el-form-item label="民族" v-if="dataOptions.category!='1'">
{{ initData.userInfos.nation }}
</el-form-item>
<el-form-item label="籍贯" v-if="dataOptions.category!='1'">
{{ initData.userInfos.nativePlace }}
</el-form-item>
<el-form-item label="详细地址" v-if="dataOptions.category!='1'">
@ -427,7 +430,7 @@
subDeptInfos:{}
},
initData: {
user: {}
userInfos: {}
},
form: {
@ -548,7 +551,7 @@
} else {
jdtitle.value = "已完成";
}
activeName.value = "base";
activeName.value = "users";
initFormDate();
initFormValues();
getFlowRecordList(options.procInsId, options.deployId);
@ -641,14 +644,14 @@
/** 用户视频培训 */
function findEduVideos(){
getBusTrainingVideoUserLast(dataOptions.value.startUserId).then(res =>{
getBusTrainingVideoUserLast(dataOptions.value.startProId, dataOptions.value.startUserId).then(res =>{
userEduVideoList.value = res.data||[]
});
}
/** 用户考试情况 */
function findEduExams(){
getBusExamUserLast(dataOptions.value.startUserId).then(res =>{
getBusExamUserLast(dataOptions.value.startProId, dataOptions.value.startUserId).then(res =>{
if(res.code==200 && res.data){
userEduExamInfos.value = res.data;
let list = res.data.busExamUserResultList;