提交代码

dev_xd
姜玉琦 2025-03-04 22:59:09 +08:00
parent deca8b10fc
commit 248f3e1042
7 changed files with 145 additions and 145 deletions

View File

@ -0,0 +1,21 @@
import {
request
} from '../utils/request'
// 查询隐患列表
export function list(query) {
return request({
url: '/manage/problemmodify/list',
method: 'get',
params: query
})
}
// 查询隐患列表
export function list1(query) {
return request({
url: '/manage/problemmodify/list',
method: 'get',
params: query
})
}

View File

@ -44,7 +44,6 @@ Page({
this.setData({ this.setData({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
lastDataSize: 10,
listData: [], listData: [],
total: 0, total: 0,
dshCount: 0, dshCount: 0,

View File

@ -15,17 +15,12 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
active: 4, active: 0,
projectId: '', projectId: '',
projectName: '', projectName: '',
subDeptUserInfo:{}, subDeptUserInfo:{},
loginName: '',
remark: '',
roleId: '',
roleName: '',
menuList: [], menuList: [],
initData: {}, initData: {},
hiddenn: true,
todoDB: 0, todoDB: 0,
fbdwDB: 0, fbdwDB: 0,
fbrtDB: 0 fbrtDB: 0
@ -87,12 +82,23 @@ Page({
*/ */
getProSubDeptsUserInfo() { getProSubDeptsUserInfo() {
const proUserInfo = getUserInfo(); const proUserInfo = getUserInfo();
let _act = this.data.active;
let _projectUserInfo = proUserInfo.projectUserInfo;
if(_projectUserInfo.subDeptType=='1'){
_act = 4;
}else{
if(_projectUserInfo.userPost=='1' || _projectUserInfo.userPost=='2' || _projectUserInfo.userPost=='3'){
_act = 1;
}
}
this.setData({ this.setData({
subDeptUserInfo: proUserInfo.projectUserInfo active:_act,
subDeptUserInfo: _projectUserInfo,
}); });
}, },
goMenu: function (event) { goMenu: function (event) {
wx.setStorageSync('nav-menu', "gdgn");
wx.redirectTo({ wx.redirectTo({
url: event.currentTarget.dataset.url url: event.currentTarget.dataset.url
}) })

View File

@ -33,7 +33,7 @@
</view> </view>
</view> </view>
<van-tabbar wx:if="{{subDeptUserInfo.userPost!='3' && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6"> <van-tabbar wx:if="{{subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='5' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
<van-tabbar-item bindtap="XMGK"> <van-tabbar-item bindtap="XMGK">
<image <image
slot="icon" slot="icon"

View File

@ -1,6 +1,10 @@
import config from '../../../config'
import { import {
getToken getToken
} from '../../../utils/auth' } from '../../../utils/auth'
import {
list
} from '../../../api/problemmodify'
const app = getApp() const app = getApp()
Page({ Page({
@ -12,59 +16,28 @@ import {
typeName:"", typeName:"",
addFlag:false, addFlag:false,
addDraftFlag:false, addDraftFlag:false,
deptId:"",
loginName:"",
userName:"",
projectId:"", projectId:"",
projectData:{}, projectName:"",
projectNameArgs:"",
initData: {}, initData: {},
show:false, pageNum:1,
pageSize:10,
total:0,
listData:[], listData:[],
activeState:"zg", activeState:"dzg",
dzgCount:0, dzgCount:0,
dfjCount:0, dfjCount:0,
yclCount:0, yclCount:0,
zgcsCOunt:0, imgBaseUrl: config.baseImgUrl,
request:app.globalData.reqUrl,
pageNum:1,
pageSize:10,
lastDataSize:10,
minRoleId:"",
list:[],
}, },
skipAdd(){ //项目切换 返回值
wx.redirectTo({ onProjectSelect(e) {
url: `../add/index?projectId=${this.data.initData.id}&projectName=`+this.data.initData.text, let projectId = e.detail.id;
}) let projectName = e.detail.text;
}, app.globalData.useProjectId = projectId;
app.globalData.useProjectName = projectName;
skipAddDarft(){ this.onLoad({type:this.data.type});
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}`,
})
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -72,83 +45,76 @@ import {
onLoad(options) { onLoad(options) {
if(!getToken()){ if(!getToken()){
wx.redirectTo({ wx.redirectTo({
url: '../../login/index', url: '../../login/login',
}) })
} }
//获取缓存数据 this.setData({
wx.getStorage({ type:options.type,
key: 'YanZhu-XD-App-UserInfoKey', typeName:options.type==1?"质量":"安全",
success:res=>{ projectId:app.globalData.useProjectId,
console.log("YanZhu-XD-App-UserInfoKey"); projectName:app.globalData.useProjectName,
this.setData({ initData: {
type:options.type, id: app.globalData.useProjectId,
typeName:options.type==1?"质量":"安全", text: app.globalData.useProjectName,
deptId:res.data.deptId, },
loginName:res.data.loginName, pageNum:1,
userName:res.data.userName, pageSize:10,
minRoleId:res.data.minRoleId, listData: [],
projectId:app.globalData.projectId, total: 0
projectNameArgs:app.globalData.projectName, });
initData:{id:app.globalData.useProjectId,text:app.globalData.useProjectName}, this.getListData();
pageNum:1,
pageSize:10,
lastDataSize:10,
listData:[]
});
//this.getListData();
}
})
}, },
/**
* 添加隐患信息
*/
skipAdd(){
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=`+this.data.initData.text,
})
},
/**
* 添加隐患草稿
*/
skipAddDarft(){
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}`,
})
}
},
/** /**
* 查询项目质量隐患排查数据 * 查询项目质量隐患排查数据
*/ */
getListData() { getListData() {
//进入这里说明数据加载完毕 let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId" + app.globalData.useProjectId+"&infoType="+this.data.type;
if(this.data.lastDataSize<this.data.pageSize){ list(params).then(res =>{
//app.toast("已经到底了,暂无可继续加载数据!") if(res.data == 200){
return; this.setData({
} total: res.total,
let nowRole = "99"; listData: this.data.listData.concat(res.rows)
//判断角色, })
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){ queryCount(param){
@ -195,22 +161,17 @@ import {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
let nav = ""; let nav = "";
if(index == 1){ if(index == 1){
nav = 'zg'; nav = 'dzg';
}if(index == 2){ }if(index == 2){
nav = 'fj'; nav = 'dfj';
}else if(index == 3){ }else if(index == 3){
nav = 'ycl'; nav = 'ycl';
}else if(index == 4){
nav = 'zgcs';
} }
this.setData({ this.setData({
activeState:nav, activeState:nav,
pageNum:1, pageNum: 1,
pageSize:10, pageSize: 10,
lastDataSize:10, listData: [],
listData:[],
list:[]
}); });
this.getListData(); this.getListData();
}, },
@ -231,14 +192,20 @@ import {
returnToPage: function () { returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/ /*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
if(wx.getStorageSync('nav-menu')=="gd"){ if(wx.getStorageSync('nav-menu')=="gdgn"){
wx.redirectTo({ wx.redirectTo({
url: '../../../../pages/gengduogongneng/index', url: '../../project_more/index',
}) })
}else{ }else{
wx.redirectTo({ if(this.data.type==1){
url: '../../../../pages/quality_manage/index', wx.redirectTo({
}) url: '../../../../pages/quality_manage/index',
})
}else{
wx.redirectTo({
url: '../../../../pages/quality_manage/index',
})
}
} }
}, },
@ -252,8 +219,15 @@ import {
}, },
onScrollToLower(){ onScrollToLower(){
console.log("滚动条到底了,开始加载新数据"); let nal = Math.ceil(this.data.total / this.data.pageSize);
this.getListData(); if (this.data.pageNum < nal) {
this.setData({
pageNum: this.data.pageNum + 1
});
this.getListData();
}else{
console.log("已经到底了,没有数据可加载!!!");
}
}, },
/** /**

View File

@ -15,10 +15,9 @@
<scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower"> <scroll-view class="max_content_scroll" type="list" scroll-y bindscrolltolower="onScrollToLower">
<project-select init="{{initData}}" bindchange="onProjectSelect" id="projectSel"></project-select> <project-select init="{{initData}}" bindchange="onProjectSelect" id="projectSel"></project-select>
<view class="modify_video_nav" style="margin-top: 5rpx;"> <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=='dzg'?'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=='dfj'?'active':''}}" bindtap="trainingTypeJump" data-index="2"><text>复检({{dfjCount}}</text></view>
<view class="{{activeState=='ycl'?'active':''}}" bindtap="trainingTypeJump" data-index="3"><text>完成({{yclCount}}</text></view> <view 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>
<view class="inspect_max_scroll"> <view class="inspect_max_scroll">
<!--专项检查样式zxjc--> <!--专项检查样式zxjc-->

View File

@ -505,9 +505,10 @@ Page({
let videoSize = this.data.eduVideoItem.length; let videoSize = this.data.eduVideoItem.length;
let currentVideo = this.data.videoIdx + 1; let currentVideo = this.data.videoIdx + 1;
if (currentVideo >= videoSize) { if (currentVideo >= videoSize) {
finishEduVideo(this.data.eduVideoItem[this.data.videoIdx].remark); finishEduVideo(this.data.eduVideoItem[this.data.videoIdx].remark).then(res =>{
//视频学习完成... //视频学习完成...
app.toast("学习完成,您可以开始考试了。", "none", 3000); app.toast("学习完成,您可以开始考试了。", "none", 3000);
});
} else { } else {
endPlayUserEduVideo(this.data.eduVideoItem[this.data.videoIdx].remark); endPlayUserEduVideo(this.data.eduVideoItem[this.data.videoIdx].remark);
startPlayUserEduVideo(this.data.eduVideoItem[currentVideo].remark); startPlayUserEduVideo(this.data.eduVideoItem[currentVideo].remark);