提交代码

main
姜玉琦 2024-04-08 00:58:58 +08:00
parent 34ef6dd8f9
commit 366a897e54
47 changed files with 2682 additions and 1448 deletions

View File

@ -29,7 +29,7 @@ export function updatePwd(data) {
// 用户退出方法
export function loginOut() {
return request({
'url': '/wxApi/loginOut',
'url': '/wechat/loginOut',
'method': 'get'
})
}

View File

@ -16,4 +16,12 @@ export function findCountByType(data){
method: 'get',
data: data
})
}
// 文件阅读
export function readFile(id){
return request({
url: '/wechat/projectFiles/readFile/'+id,
method: 'get'
})
}

View File

@ -29,10 +29,10 @@ App({
userProjectId:'',
appId: "wx9997d071b4996f23",
// 智慧工地后台接口访问域名
//reqUrl:'https://szgcwx.jhncidg.com',
reqUrl:'http://127.0.0.1:8091',
//uploadUrl:"https://szgcwx.jhncidg.com/wechat",
uploadUrl:'http://127.0.0.1:8091/wechat',
reqUrl:'https://szgcwx.jhncidg.com',
//reqUrl:'http://127.0.0.1:8091',
uploadUrl:"https://szgcwx.jhncidg.com/wechat",
//uploadUrl:'http://127.0.0.1:8091/wechat',
//御景路数字化集成管控平台接口访问域名
szhUrl:'https://szh.makalu.cc',
@ -79,6 +79,7 @@ App({
}
this.autoUpdate();
},
onLoad(){
},
@ -93,6 +94,12 @@ App({
});
},
initWxAuth:function(){
wx.redirectTo({
url: '../wx-auth/index',
})
},
//版本自动更新
autoUpdate:function(){
var self = this

View File

@ -1,6 +1,7 @@
{
"pages": [
"pages/login/index",
"pages/wx-auth/index",
"pages/gongchengliebiao/index",
"pages/gengduogongneng/index",
"pages/xiangmugaikuang/index",

View File

@ -1,8 +1,9 @@
// 应用全局配置
module.exports = {
timeout: 60000,
appId: "wx9997d071b4996f23",
appId: "wx9997d071b4996f23",
//baseUrl: 'http://127.0.0.1:8091',
baseUrl: 'https://szgcwx.jhncidg.com',
baseUrl: 'http://127.0.0.1:8091',
manageUrl: 'https://szgc.jhncidg.com',
noSecuritys:['/wechat/captchaImage','/wxApi/login']
};

View File

@ -19,7 +19,7 @@ Component({
},
observers: {
data: function (val) {
console.log(val)
//console.log(val)
this.initChart()
},
},

View File

@ -18,7 +18,7 @@ Component({
},
observers: {
chartData: function (val) {
console.log(val)
//console.log(val)
this.initChart()
},
},

View File

@ -172,8 +172,8 @@ Page({
showImg:function(e){
var that=this;
wx.previewImage({
urls: that.data.imageList,
current: that.data.imageList[e.currentTarget.dataset.index]
urls: that.data.detectionImageList,
current: that.data.detectionImageList[e.currentTarget.dataset.index]
})
},

View File

@ -141,7 +141,7 @@
<van-col span="6"><text class="color_purple">检测报告</text></van-col>
<van-col span="18">
<view class="in-img-div" wx:if="{{minDetectionFileImages.length>0}}" wx:for="{{minDetectionFileImages}}" wx:key="index">
<image bindtap='showDetectionFileImg' data-index="{{index}}" src='{{item}}'></image>
<image bindtap='showImg' data-index="{{index}}" src='{{item}}'></image>
</view>
<view class="in-img-div" wx:if="{{detectionFiles.length>0}}">
<image src='https://szgcwx.jhncidg.com/staticFiles/icon/pdf.png'></image>

View File

@ -2,204 +2,284 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
deptId:"",
loginName:"",
projectId:"",
minRoleId:"",
projectData:{},
initData: {},
show:false,
listData:[],
activeState:"jxz",
jxzCount:0,
ywcCount:0,
request:app.globalData.reqUrl
},
/**
* 页面的初始数据
*/
data: {
deptId: "",
loginName: "",
projectId: "",
minRoleId: "",
projectData: {},
initData: {},
show: false,
listData: [],
activeState: "jxz",
jxzCount: 0,
ywcCount: 0,
request: app.globalData.reqUrl
},
skipAdd(){
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=`+this.data.initData.text,
})
},
skipAdd() {
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=` + this.data.initData.text,
})
},
getInfo(e){
let {id,checkState,approveStatus,witnessUser} = e.currentTarget.dataset.set
if(approveStatus=="1" && witnessUser==this.data.loginName){
wx.redirectTo({
url: `../../../pages/project_approve/approveCheckDetection/index?id=${id}`
})
}else{
if(checkState=="1"){
wx.redirectTo({
url: `../check/index?id=${id}`,
})
}else{
wx.redirectTo({
url: `../info/index?id=${id}`,
})
}
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
deptId:res.data.deptId,
loginName:res.data.loginName,
projectId:app.globalData.projectId,
minRoleId:res.data.minRoleId,
initData:{text:app.globalData.projectName,id:app.globalData.projectId}
})
this.getListData(app.globalData.projectId,res.data.deptId,res.data.minRoleId);
}
getInfo(e) {
let {
id,
checkState,
approveStatus,
witnessUser
} = e.currentTarget.dataset.set
if (approveStatus == "1" && witnessUser == this.data.loginName) {
wx.redirectTo({
url: `../../../pages/project_approve/approveCheckDetection/index?id=${id}`
})
},
} else {
if (checkState == "1") {
wx.redirectTo({
url: `../check/index?id=${id}`,
})
} else {
wx.redirectTo({
url: `../info/index?id=${id}`,
})
}
}
},
/**
* 查询项目材料进场验收数据
*/
getListData(projectId,deptId,minRoleId) {
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options && options.barProId) {
//数据未加载完毕,从文件读取数据
if (app.globalData.projectInfoList.length == 0) {
wx.getStorage({
key: 'projectInfoList',
success: res => {
app.globalData.projectInfoList = res.data;
app.globalData.projectInfoList.forEach(item => {
if (item.projectId == options.barProId) {
app.globalData.projectId = item.projectId;
app.globalData.projectName = item.projectName;
}
});
//未查询到项目信息
if (!app.globalData.projectId) {
app.globalData.projectInfoList.push({
projectId: options.barProId,
projectId: options.barProName
});
app.globalData.projectId = options.barProId;
app.globalData.projectName = options.barProName;
}
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
},
fail: err => {
//未获取用户信息时,重新登录
wx.redirectTo({
url: '../pages/login/index',
})
}
})
} else {
app.globalData.projectInfoList.forEach(item => {
if (item.projectId == options.barProId) {
app.globalData.projectId = item.projectId;
app.globalData.projectName = item.projectName;
}
});
//未查询到项目信息
if (!app.globalData.projectId) {
app.globalData.projectInfoList.push({
projectId: options.barProId,
projectId: options.barProName
});
app.globalData.projectId = options.barProId;
app.globalData.projectName = options.barProName;
}
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
}
} else {
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
}
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success: res => {
this.setData({
deptId: res.data.deptId,
loginName: res.data.loginName,
projectId: app.globalData.projectId,
minRoleId: res.data.minRoleId,
})
this.getListData(app.globalData.projectId, res.data.deptId, res.data.minRoleId);
},
fail: err => {
//未获取用户信息时,重新登录
wx.redirectTo({
url: '../pages/login/index',
})
}
})
},
/**
* 查询项目材料进场验收数据
*/
getListData(projectId, deptId, minRoleId) {
var that = this;
//判断角色,
if(minRoleId==2||minRoleId==3||minRoleId==4){
deptId=0;
if (minRoleId == 2 || minRoleId == 3 || minRoleId == 4) {
deptId = 0;
}
let param = {
"projectId": projectId,
"deptId":deptId,
"nowUserName":this.data.loginName,
"activeName":that.data.activeState
"projectId": projectId,
"deptId": deptId,
"nowUserName": this.data.loginName,
"activeName": that.data.activeState
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectDetection/list',
data:param,
data: param,
method: "get",
success: function (res) {
that.setData({
listData:res.data.data
listData: res.data.data
})
}
});
this.queryCount(projectId,deptId);
},
this.queryCount(projectId, deptId);
},
//查询统计
queryCount(projectId,deptId){
//查询统计数量
let param = {
"projectId": projectId,
"deptId":deptId,
"activeName":this.data.activeState
}
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/projectDetection/findGroupCountByApprove',
data: param,
method: "get",
success: function (res) {
that.setData({
jxzCount:res.data.data.jxz,
ywcCount:res.data.data.ywc
});
}
});
},
//查询统计
queryCount(projectId, deptId) {
//查询统计数量
let param = {
"projectId": projectId,
"deptId": deptId,
"activeName": this.data.activeState
}
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/projectDetection/findGroupCountByApprove',
data: param,
method: "get",
success: function (res) {
that.setData({
jxzCount: res.data.data.jxz,
ywcCount: res.data.data.ywc
});
}
});
},
/**
* 标签切换
*/
typeJump(e){
typeJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if(index == 1){
if (index == 1) {
nav = 'jxz';
}else if(index == 2){
} else if (index == 2) {
nav = 'ywc';
}
this.setData({
activeState:nav
activeState: nav
});
this.getListData(this.data.projectId,this.data.deptId,this.data.minRoleId);
this.getListData(this.data.projectId, this.data.deptId, this.data.minRoleId);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
if(wx.getStorageSync('nav-menu')=="gd"){
wx.redirectTo({
url: '../../../pages/gengduogongneng/index',
})
}else{
wx.redirectTo({
url: '../../../pages/quality_manage/index',
})
}
},
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){
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.projectId = projectId;
app.globalData.projectName = projectName;
app.globalData.projectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}
})

View File

@ -168,7 +168,7 @@ Page({
dataTypeLvl1:e.detail.id
})
let tempData = []
this.dataTypeLvl2AllList.forEach(it =>{
this.data.dataTypeLvl2AllList.forEach(it =>{
if(it.remark==e.detail.id){
tempData.push({"id":it.dictValue,"text":it.dictLabel});
}

View File

@ -150,6 +150,7 @@ Page({
if(res.code == 200){
let tempData = []
res.data.forEach(it =>{
console.log(that.data.dt1,"xxxxxxxxxxxxxxxx");
if(it.remark==that.data.dt1){
tempData.push({"id":it.dictValue,"text":it.dictLabel});
}
@ -176,7 +177,7 @@ Page({
dataTypeLvl1:e.detail.id
})
let tempData = []
this.dataTypeLvl2AllList.forEach(it =>{
this.data.dataTypeLvl2AllList.forEach(it =>{
if(it.remark==e.detail.id){
tempData.push({"id":it.dictValue,"text":it.dictLabel});
}

View File

@ -117,9 +117,9 @@ Page({
//跳转修改页面
onUpdate:function(){
let id = this.data.id;
let dt1= this.data.dataTypeLvl1
let dataTypeLvl1= this.data.infoData.dataTypeLvl1;
wx.redirectTo({
url: `../edit/index?id=${id}&dt1=${dt1}`,
url: `../edit/index?id=${id}&dt1=${dataTypeLvl1}`,
})
},

View File

@ -2,88 +2,171 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
deptId:"",
loginName:"",
userName:"",
minRoleId:"",
projectId:"",
projectData:{},
projectNameArgs:"",
initData: {},
show:false,
listData:[],
jxzCount:0,
ywcCount:0,
activeState:"jxz",
request:app.globalData.reqUrl
},
/**
* 页面的初始数据
*/
data: {
deptId: "",
loginName: "",
userName: "",
minRoleId: "",
projectId: "",
projectData: {},
projectNameArgs: "",
initData: {},
show: false,
listData: [],
jxzCount: 0,
ywcCount: 0,
activeState: "jxz",
request: app.globalData.reqUrl
},
onClose(){
this.setData({ show: false });
},
showPopup() {
this.setData({ show: true });
},
onClose() {
this.setData({
show: false
});
},
showPopup() {
this.setData({
show: true
});
},
skipAdd(){
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=`+this.data.initData.text,
})
},
skipAdd() {
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=` + this.data.initData.text,
})
},
getInfo(e){
let {id,approveStatus,superviseUser} = e.currentTarget.dataset.set
if(approveStatus=="1" && superviseUser==this.data.loginName){
wx.redirectTo({
url: `../../../pages/project_approve/approveChecking/index?id=${id}`
})
}else{
wx.redirectTo({
url: `../info/index?id=${id}`
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
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:{text:app.globalData.projectName,id:app.globalData.projectId}
})
this.getProjectCheckingData(app.globalData.projectId,res.data.loginName,res.data.deptId,res.data.minRoleId);
}
getInfo(e) {
let {
id,
approveStatus,
superviseUser
} = e.currentTarget.dataset.set
if (approveStatus == "1" && superviseUser == this.data.loginName) {
wx.redirectTo({
url: `../../../pages/project_approve/approveChecking/index?id=${id}`
})
},
} else {
wx.redirectTo({
url: `../info/index?id=${id}`
})
}
},
/**
* 查询项目举牌验收数据
*/
getProjectCheckingData(projectId,loginName,deptId,minRoleId) {
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options && options.barProId) {
//数据未加载完毕,从文件读取数据
if (app.globalData.projectInfoList.length == 0) {
wx.getStorage({
key: 'projectInfoList',
success: res => {
app.globalData.projectInfoList = res.data;
app.globalData.projectInfoList.forEach(item => {
if (item.projectId == options.barProId) {
app.globalData.projectId = item.projectId;
app.globalData.projectName = item.projectName;
}
});
//未查询到项目信息
if (!app.globalData.projectId) {
app.globalData.projectInfoList.push({
projectId: options.barProId,
projectId: options.barProName
});
app.globalData.projectId = options.barProId;
app.globalData.projectName = options.barProName;
}
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
},
fail: err => {
//未获取用户信息时,重新登录
wx.redirectTo({
url: '../pages/login/index',
})
}
})
} else {
app.globalData.projectInfoList.forEach(item => {
if (item.projectId == options.barProId) {
app.globalData.projectId = item.projectId;
app.globalData.projectName = item.projectName;
}
});
//未查询到项目信息
if (!app.globalData.projectId) {
app.globalData.projectInfoList.push({
projectId: options.barProId,
projectId: options.barProName
});
app.globalData.projectId = options.barProId;
app.globalData.projectName = options.barProName;
}
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
}
} else {
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
}
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success: res => {
this.setData({
deptId: res.data.deptId,
loginName: res.data.loginName,
userName: res.data.userName,
minRoleId: res.data.minRoleId,
projectId: app.globalData.projectId,
projectNameArgs: app.globalData.projectName,
})
this.getProjectCheckingData(app.globalData.projectId, res.data.loginName, res.data.deptId, res.data.minRoleId);
},
fail: err => {
//未获取用户信息时,重新登录
wx.redirectTo({
url: '../pages/login/index',
})
}
})
},
/**
* 查询项目举牌验收数据
*/
getProjectCheckingData(projectId, loginName, deptId, minRoleId) {
var that = this;
//判断角色,
if(minRoleId==2||minRoleId==3||minRoleId==4){
deptId=0;
if (minRoleId == 2 || minRoleId == 3 || minRoleId == 4) {
deptId = 0;
}
let param = {
"projectId": projectId,
"nowUserName":loginName,
"deptId":deptId,
"activeName":this.data.activeState
"nowUserName": loginName,
"deptId": deptId,
"activeName": this.data.activeState
}
this.queryCount(param);
wx.request({
@ -92,114 +175,114 @@ Page({
method: "get",
success: function (res) {
that.setData({
listData:res.data.data
listData: res.data.data
})
}
})
},
},
//查询统计
queryCount(param){
//查询统计数量
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/projectchecking/findGroupCountByApprove',
data: param,
method: "get",
success: function (res) {
that.setData({
jxzCount:res.data.data.jxz,
ywcCount:res.data.data.ywc
});
}
});
},
//查询统计
queryCount(param) {
//查询统计数量
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/projectchecking/findGroupCountByApprove',
data: param,
method: "get",
success: function (res) {
that.setData({
jxzCount: res.data.data.jxz,
ywcCount: res.data.data.ywc
});
}
});
},
/**
* 标签切换
*/
typeJump(e){
typeJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if(index == 1){
if (index == 1) {
nav = 'jxz';
}else if(index == 2){
} else if (index == 2) {
nav = 'ywc';
}
this.setData({
activeState:nav
activeState: nav
});
this.getProjectCheckingData(this.data.projectId,this.data.loginName,this.data.deptId,this.data.minRoleId)
this.getProjectCheckingData(this.data.projectId, this.data.loginName, this.data.deptId, this.data.minRoleId)
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
if(wx.getStorageSync('nav-menu')=="gd"){
wx.redirectTo({
url: '../../../pages/gengduogongneng/index',
})
}else{
wx.redirectTo({
url: '../../../pages/quality_manage/index',
})
}
},
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){
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.projectId = projectId;
app.globalData.projectName = projectName;
app.globalData.projectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}
})

View File

@ -1,5 +1,6 @@
import {
fileList,
readFile,
findCountByType,
} from '../../api/projectFiles'
@ -21,6 +22,7 @@ Page({
pageSize: 10,
lastDataSize: 10,
list: [],
deptIds:"",
},
/**
@ -37,7 +39,26 @@ Page({
lastDataSize: 10,
listData: []
})
this.getListData();
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success: res => {
let fileDepts = "";
if(res.data.minRoleId>3){
if(res.data.minRoleId==4){
fileDepts += app.globalData.projectInfoList[0].projectInfoList[0].deptId;
}else{
app.globalData.projectInfoList.forEach(pro =>{
fileDepts += pro.projectInfoList[0].deptId;
});
}
}
this.setData({
deptIds:fileDepts
})
this.getListData();
}
})
},
/**
@ -50,11 +71,13 @@ Page({
return;
}
let that = this;
this.queryCount();
fileList({
fileBelong: this.data.activeState,
pageNum: this.data.pageNum,
pageSize: this.data.pageSize
pageSize: this.data.pageSize,
remark:this.data.deptIds
}).then(res => {
//这里处理this.data.lastDataSize=this.data.pageSize
if (that.data.list.length > 0 && res.rows.length > 0 && that.data.list[0].id == res.rows[0].id) {
@ -72,12 +95,12 @@ Page({
});
},
/**
/**
* 统计文件传达
*/
queryCount() {
let that = this;
findCountByType({}).then(res => {
findCountByType({remark:this.data.deptIds}).then(res => {
if (res.data.length > 0) {
let sjbm = 0,
jtgs = 0,
@ -114,8 +137,9 @@ Page({
*/
openFile: function (e) {
let {
filePath
id,filePath
} = e.currentTarget.dataset.set
readFile(id);
wx.downloadFile({
// 示例 url并非真实存在
url: app.globalData.uploadUrl + '/common/download/resource?resource=' + filePath,

View File

@ -28,7 +28,7 @@
<view class="inspect_list_title_number">{{index < 9 ?'0'+(index+1):(index+1)}}</view>
<view class="module_title module_title_flex inspect_list_title_text" wx:if="{{item.fileBelong=='1'}}">上级部门</view>
<view class="module_title module_title_flex inspect_list_title_text" wx:if="{{item.fileBelong=='2'}}">集团公司</view>
<view class="module_title module_title_flex inspect_list_title_text" wx:if="{{item.fileBelong=='3'}}">子公司</view>
<view class="module_title module_title_flex inspect_list_title_text" wx:if="{{item.fileBelong=='3'}}">{{item.deptName}}</view>
</view>
</view>
<view class="inspect_list_info">

View File

@ -222,8 +222,8 @@ Page({
showSignFileImg:function(e){
var that=this;
wx.previewImage({
urls: that.data.sifnFileImages,
current: that.data.sifnFileImages[e.currentTarget.dataset.index]
urls: that.data.signFileImages,
current: that.data.signFileImages[e.currentTarget.dataset.index]
})
},

View File

@ -2,74 +2,157 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
deptId:"",
loginName:"",
projectId:"",
initData: {},
show:false,
listData:[],
jxzCount:0,
ywcCount:0,
activeState:"jxz",
request:app.globalData.reqUrl
},
/**
* 页面的初始数据
*/
data: {
deptId: "",
loginName: "",
projectId: "",
initData: {},
show: false,
listData: [],
jxzCount: 0,
ywcCount: 0,
activeState: "jxz",
request: app.globalData.reqUrl
},
skipAdd(){
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=${this.data.initData.text}`
})
},
skipAdd() {
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=${this.data.initData.text}`
})
},
getInfo(e){
let {id,approveStatus,witnessUser} = e.currentTarget.dataset.set
if(approveStatus=="1" && witnessUser==this.data.loginName){
wx.redirectTo({
url: `../../../pages/project_approve/approveMaterialSeal/index?id=${id}`
})
}else{
wx.redirectTo({
url: `../info/index?id=${id}`
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
deptId:res.data.deptId,
loginName:res.data.loginName,
projectId:app.globalData.projectId,
minRoleId:res.data.minRoleId,
initData:{text:app.globalData.projectName,id:app.globalData.projectId}
})
this.getListData(app.globalData.projectId,res.data.deptId,res.data.minRoleId);
}
getInfo(e) {
let {
id,
approveStatus,
witnessUser
} = e.currentTarget.dataset.set
if (approveStatus == "1" && witnessUser == this.data.loginName) {
wx.redirectTo({
url: `../../../pages/project_approve/approveMaterialSeal/index?id=${id}`
})
},
} else {
wx.redirectTo({
url: `../info/index?id=${id}`
})
}
},
/**
* 查询项目材料封样数据
*/
getListData(projectId,deptId,minRoleId) {
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options && options.barProId) {
//数据未加载完毕,从文件读取数据
if (app.globalData.projectInfoList.length == 0) {
wx.getStorage({
key: 'projectInfoList',
success: res => {
app.globalData.projectInfoList = res.data;
app.globalData.projectInfoList.forEach(item => {
if (item.projectId == options.barProId) {
app.globalData.projectId = item.projectId;
app.globalData.projectName = item.projectName;
}
});
//未查询到项目信息
if (!app.globalData.projectId) {
app.globalData.projectInfoList.push({
projectId: options.barProId,
projectId: options.barProName
});
app.globalData.projectId = options.barProId;
app.globalData.projectName = options.barProName;
}
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
},
fail: err => {
//未获取用户信息时,重新登录
wx.redirectTo({
url: '../pages/login/index',
})
}
})
} else {
app.globalData.projectInfoList.forEach(item => {
if (item.projectId == options.barProId) {
app.globalData.projectId = item.projectId;
app.globalData.projectName = item.projectName;
}
});
//未查询到项目信息
if (!app.globalData.projectId) {
app.globalData.projectInfoList.push({
projectId: options.barProId,
projectId: options.barProName
});
app.globalData.projectId = options.barProId;
app.globalData.projectName = options.barProName;
}
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
}
} else {
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
}
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success: res => {
this.setData({
deptId: res.data.deptId,
loginName: res.data.loginName,
projectId: app.globalData.projectId,
minRoleId: res.data.minRoleId,
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
this.getListData(app.globalData.projectId, res.data.deptId, res.data.minRoleId);
},
fail: err => {
//未获取用户信息时,重新登录
wx.redirectTo({
url: '../pages/login/index',
})
}
})
},
/**
* 查询项目材料封样数据
*/
getListData(projectId, deptId, minRoleId) {
var that = this;
//判断角色,
if(minRoleId==2||minRoleId==3||minRoleId==4){
deptId=0;
if (minRoleId == 2 || minRoleId == 3 || minRoleId == 4) {
deptId = 0;
}
let param = {
"deptId":deptId,
"deptId": deptId,
"projectId": projectId,
"nowUserName":this.data.loginName,
"nowUserName": this.data.loginName,
"activeName": this.data.activeState,
}
this.queryCount(param);
@ -79,114 +162,114 @@ Page({
method: "get",
success: function (res) {
that.setData({
listData:res.data.data
listData: res.data.data
})
}
})
},
},
//查询统计
queryCount(param){
//查询统计数量
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/projectMaterialSeal/findGroupCountByApprove',
data: param,
method: "get",
success: function (res) {
that.setData({
jxzCount:res.data.data.jxz,
ywcCount:res.data.data.ywc
});
}
});
},
//查询统计
queryCount(param) {
//查询统计数量
let that = this;
wx.request({
url: app.globalData.reqUrl + '/wechat/projectMaterialSeal/findGroupCountByApprove',
data: param,
method: "get",
success: function (res) {
that.setData({
jxzCount: res.data.data.jxz,
ywcCount: res.data.data.ywc
});
}
});
},
/**
* 标签切换
*/
typeJump(e){
typeJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if(index == 1){
if (index == 1) {
nav = 'jxz';
}else if(index == 2){
} else if (index == 2) {
nav = 'ywc';
}
this.setData({
activeState:nav
activeState: nav
});
this.getListData(this.data.projectId,this.data.deptId,this.data.minRoleId);
this.getListData(this.data.projectId, this.data.deptId, this.data.minRoleId);
},
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){
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;
app.globalData.projectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}
})

View File

@ -6,144 +6,166 @@ Page({
* 页面的初始数据
*/
data: {
maxDate:new Date(2088,1,1).getTime(),
currentDate:new Date().getTime(),
deptId:"",
projectId:"",
projectName:"",
loginName:"",
rectifierData:[],
rectifierData2:[],
imageInfoData:[],
loadShow:false,
measureType:"1",
measureTypeList:[],
measureInfo:"1",
measureInfoTypeList:[],
measurePosition:"",
measurePointPosition:"",
qualityUser:"",
qualityUserName:"",
superviseUser:"",
superviseUserName:"",
maxDate: new Date(2088, 1, 1).getTime(),
currentDate: new Date().getTime(),
deptId: "",
projectId: "",
projectName: "",
loginName: "",
rectifierData: [],
rectifierData2: [],
imageInfoData: [],
loadShow: false,
measureType: "1",
measureTypeList: [],
measureInfo: "1",
infoTypeList: [],
measureInfoTypeList: [],
measurePosition: "",
measurePointPosition: "",
qualityUser: "",
qualityUserName: "",
superviseUser: "",
superviseUserName: "",
//验收时间
measureTime:'',
measureResult:"1",
resultList:[{id:1,text:"合格"},{id:2,text:"不合格"}]
measureTime: '',
measureResult: "1",
limit: 9,
measureFiles: [],
resultList: [{
id: 1,
text: "合格"
}, {
id: 2,
text: "不合格"
}],
fileType: ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "png", "jpg", "jpeg"]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {projectId,projectName} = options
let {
projectId,
projectName
} = options
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
projectId,
projectName,
deptId:res.data.deptId,
loginName:res.data.loginName
})
this.getProjectUserData();
this.getMeasureTypeList();
this.getMeasureInfoTypeList();
}
})
key: 'userinfo',
success: res => {
this.setData({
projectId,
projectName,
deptId: res.data.deptId,
loginName: res.data.loginName
})
this.getProjectUserData();
this.getMeasureTypeList();
this.getMeasureInfoTypeList();
}
})
},
//查询项目人员数据
getProjectUserData(){
getProjectUserData() {
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectuserinfo/selectProjectUnitUser',
method:"get",
data:{
unitType:"4",
projectId:that.data.projectId
url: app.globalData.reqUrl + '/wechat/projectuserinfo/selectProjectUnitUser',
method: "get",
data: {
unitType: "4",
projectId: that.data.projectId
},
header:{
'content-type': 'application/x-www-form-urlencoded'
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
if (res.code == 200) {
that.setData({
rectifierData:res.data,
rectifierData: res.data,
})
}
}
})
wx.request({
url: app.globalData.reqUrl+'/wechat/projectuserinfo/selectProjectUnitUser',
method:"get",
data:{
unitType:"2",
projectId:that.data.projectId
url: app.globalData.reqUrl + '/wechat/projectuserinfo/selectProjectUnitUser',
method: "get",
data: {
unitType: "2",
projectId: that.data.projectId
},
header:{
'content-type': 'application/x-www-form-urlencoded'
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
if (res.code == 200) {
that.setData({
rectifierData2:res.data,
rectifierData2: res.data,
})
}
}
})
},
getMeasureTypeList(){
getMeasureTypeList() {
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectMeasure/queryDictType',
method:"get",
data:{
type:'project_measure_type'
url: app.globalData.reqUrl + '/wechat/projectMeasure/queryDictType',
method: "get",
data: {
type: 'project_measure_type'
},
header:{
'content-type': 'application/x-www-form-urlencoded'
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
let list=[];
res.data.forEach(it =>{
list.push({"id":it.dictValue,"text":it.dictLabel});
if (res.code == 200) {
let list = [];
res.data.forEach(it => {
list.push({
"id": it.dictValue,
"text": it.dictLabel
});
})
that.setData({
measureTypeList:list
measureTypeList: list
})
}
}
})
},
getMeasureInfoTypeList(){
getMeasureInfoTypeList() {
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectMeasure/queryDictType',
method:"get",
data:{
type:'project_measure_info_type'
url: app.globalData.reqUrl + '/wechat/projectMeasure/queryDictType',
method: "get",
data: {
type: 'project_measure_info_type'
},
header:{
'content-type': 'application/x-www-form-urlencoded'
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
let list=[];
res.data.forEach(it =>{
list.push({"id":it.dictValue,"text":it.dictLabel});
if (res.code == 200) {
let list = [];
res.data.forEach(it => {
if (!it.remark) {
list.push({
"id": it.dictValue,
"text": it.dictLabel
});
}
})
that.setData({
measureInfoTypeList:list
infoTypeList: res.data,
measureInfoTypeList: list
})
}
}
@ -151,7 +173,7 @@ Page({
},
//测量部位
onInputMeasurePosition(e){
onInputMeasurePosition(e) {
let measurePosition = e.detail.value
this.setData({
measurePosition
@ -159,7 +181,7 @@ Page({
},
//测量点位
onInputMeasurePointPosition(e){
onInputMeasurePointPosition(e) {
let measurePointPosition = e.detail.value
this.setData({
measurePointPosition
@ -167,7 +189,7 @@ Page({
},
//验收时间
onInputTime(e){
onInputTime(e) {
let measureTime = e.detail
this.setData({
measureTime
@ -175,123 +197,130 @@ Page({
},
// list 上传图片
onImagesArr(e){
onImagesArr(e) {
var data = this.data.imageInfoData
data = e.detail
this.setData({
imageInfoData:data
imageInfoData: data
})
},
//添加质量专员
onAddQualityUser(e){
if(e.detail.length>0){
onAddQualityUser(e) {
if (e.detail.length > 0) {
this.setData({
qualityUser:e.detail[0].phoneNumber,
qualityUserName:e.detail[0].userName
qualityUser: e.detail[0].phoneNumber,
qualityUserName: e.detail[0].userName
})
}
},
//添加监理专员
onAddSuperviseUser(e){
if(e.detail.length>0){
onAddSuperviseUser(e) {
if (e.detail.length > 0) {
this.setData({
superviseUser:e.detail[0].phoneNumber,
superviseUserName:e.detail[0].userName
superviseUser: e.detail[0].phoneNumber,
superviseUserName: e.detail[0].userName
})
}
},
//切换测量结果
onSelectType(e){
onSelectType(e) {
this.setData({
measureResult:e.detail.id
measureResult: e.detail.id
})
},
},
//取消页面
cancelSaveView(){
cancelSaveView() {
this.returnToPage()
},
//保存
onSave(){
onSave() {
this.setData({
loadShow:true
loadShow: true
})
let that = this
let {projectId,loginName, deptId,measureType,
measureInfo,
measurePosition,
measurePointPosition,
qualityUser,
qualityUserName,
superviseUser,
superviseUserName,
measureTime,
measureResult,imageInfoData} = that.data;
let {
projectId,
loginName,
deptId,
measureType,
measureInfo,
measurePosition,
measurePointPosition,
qualityUser,
qualityUserName,
superviseUser,
superviseUserName,
measureTime,
measureResult,
imageInfoData,
measureFiles
} = that.data;
//数据效验
if(projectId==""||loginName==""||deptId==""){
if (projectId == "" || loginName == "" || deptId == "") {
app.toast("数据异常,请刷新页面重试!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(imageInfoData.length==0){
if (imageInfoData.length == 0) {
app.toast("请上传测量现场图片!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(measureType==""){
if (measureType == "") {
app.toast("请选择测量类型!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(measureInfo==""){
if (measureInfo == "") {
app.toast("请选择测量内容!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(measurePosition==""){
if (measurePosition == "") {
app.toast("请填写测量部位!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(measurePointPosition==""){
if (measurePointPosition == "") {
app.toast("请填写测量点位!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(qualityUser==""||qualityUserName==""){
if (qualityUser == "" || qualityUserName == "") {
app.toast("请选择质量专员!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(superviseUser==""||superviseUserName==""){
if (superviseUser == "" || superviseUserName == "") {
app.toast("请选择监理专员!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(measureTime==""){
if (measureTime == "") {
app.toast("请选择测量时间!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
@ -302,120 +331,208 @@ Page({
// })
// return;
// }
if(superviseUser==qualityUser){
if (superviseUser == qualityUser) {
app.toast("质量专员和监理专员不能是同一人!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if (measureFiles.length > 0) {
for (let i = 0; i < measureFiles.length; i++) {
let _fileType = measureFiles[i].path.split('.');
_fileType = _fileType[_fileType.length - 1].toLowerCase();
//判断附件类型,如果是图片直接展示,非图片则显示附件
if (this.data.fileType.indexOf(_fileType) == -1) {
app.toast("当前 [ " + _fileType + " ] 文件不支持上传!")
that.setData({
loadShow: false
});
return;
}
}
}
let fileUrls = [];
imageInfoData.forEach(async (item)=>{
let uploadUrl = app.globalData.uploadUrl+'/common/upload'
let name = "file"
let _measureFiles = [];
imageInfoData.forEach(async (item) => {
let uploadUrl = app.globalData.uploadUrl + '/common/upload'
let name = "file"
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(uploadUrl,item,name);
let obj = await that.syncUploadImage(uploadUrl, item, name);
fileUrls.push(obj.data.fileName);
//验证图片上传完毕
if(fileUrls.length == imageInfoData.length){
let params = {
projectId,
deptId,
imageUrls:fileUrls.toString(),
measureType,
measureInfo,
measurePosition,
measurePointPosition,
qualityUser,
qualityUserName,
superviseUser,
superviseUserName,
measureTime:measureTime+":00",
//measureResult,
approveStatus:"1",
createBy:loginName
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectMeasure/add',
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)
if (fileUrls.length == imageInfoData.length) {
if(measureFiles.length>0){
measureFiles.forEach(async (_file) => {
let uploadUrl = app.globalData.uploadUrl + '/common/upload'
let name = "file"
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(uploadUrl, _file.path, name);
_measureFiles.push(obj.data.fileName);
if (_measureFiles.length == measureFiles.length) {
this.submitFroms(fileUrls,_measureFiles);
}
}
})
});
}else{
//不传入附件信息
this.submitFroms(fileUrls,"");
}
})
}
})
},
/**
* 表单提交
* @param {*} fileUrls
* @param {*} measureFiles
*/
submitFroms(fileUrls,measureFiles){
let that = this
let {
projectId,
loginName,
deptId,
measureType,
measureInfo,
measurePosition,
measurePointPosition,
qualityUser,
qualityUserName,
superviseUser,
superviseUserName,
measureTime,
} = that.data;
let params = {
projectId,
deptId,
imageUrls: fileUrls.toString(),
measureFiles: measureFiles.toString(),
measureType,
measureInfo,
measurePosition,
measurePointPosition,
qualityUser,
qualityUserName,
superviseUser,
superviseUserName,
measureTime: measureTime+":00",
approveStatus: "1",
createBy: loginName
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectMeasure/add',
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) {
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)
}
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)
}
});
})
},
//选择测量类型
onSelectMeasureType(e){
/**
* 文件上传
* @param {*} e
*/
fileUpload(e) {
this.setData({
measureType:e.detail.id
measureFiles: e.detail
});
},
//选择测量类型
onSelectMeasureType(e) {
let list = [];
if (e.detail.id == 6) {
this.data.infoTypeList.forEach(item => {
if (item.remark == "gjgc") {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
}
})
} else {
this.data.infoTypeList.forEach(item => {
if (!item.remark) {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
}
})
}
this.setData({
measureType: e.detail.id,
measureInfo: list[0].id,
measureInfoTypeList: list
})
},
//选择测量内容
onSelectMeasureInfo(e){
onSelectMeasureInfo(e) {
this.setData({
measureInfo:e.detail.id
measureInfo: e.detail.id
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成

View File

@ -75,6 +75,14 @@
<voucher-select columns="{{resultList}}" placeholder="请选择测量结果" bindchange="onSelectType" ></voucher-select>
</view>
</view>
<view class="inspect_info_list" style="width: 100%;">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">测量附件
<text style="font-size: small;">[可上传PDF/图片/WORD/PPT/XLS格式]</text>
</view>
<view class="problem_list_info_con">
<file-uploader-all bindfiles="fileUpload" limit="{{limit}}"></file-uploader-all>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>

View File

@ -6,448 +6,578 @@ Page({
* 页面的初始数据
*/
data: {
maxDate:new Date(2088,1,1).getTime(),
currentDate:new Date().getTime(),
id:"",
projectId:"",
projectName:"",
loginName:"",
rectifierData:[],
rectifierData2:[],
imageInfoData:[],
loadShow:false,
measureTypeList:[],
measureInfoTypeList:[],
activeName:"",
flowRecordList:[],
request:app.globalData.reqUrl
maxDate: new Date(2088, 1, 1).getTime(),
currentDate: new Date().getTime(),
id: "",
projectId: "",
projectName: "",
loginName: "",
rectifierData: [],
rectifierData2: [],
imageInfoData: [],
loadShow: false,
measureTypeList: [],
infoTypeList: [],
measureInfoTypeList: [],
activeName: "",
flowRecordList: [],
request: app.globalData.reqUrl,
limit: 9,
fileType: ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "png", "jpg", "jpeg"],
type: "",
info: "",
filesData: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let {id} = options
let {
id,
measureType,
measureInfo
} = options
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
id,
projectId:app.globalData.projectId,
projectName:app.globalData.projectName,
loginName:res.data.loginName
})
key: 'userinfo',
success: res => {
this.setData({
id,
type: measureType,
info: measureInfo,
projectId: app.globalData.projectId,
projectName: app.globalData.projectName,
loginName: res.data.loginName
})
this.getMeasureTypeList();
this.getMeasureInfoTypeList();
this.getProjectUserData();
this.getInfo();
this.getAuditinfo();
}
})
this.getMeasureTypeList();
this.getMeasureInfoTypeList();
this.getProjectUserData();
this.getInfo();
this.getAuditinfo();
}
})
},
//查询项目人员数据
getProjectUserData(){
getProjectUserData() {
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectuserinfo/selectProjectUnitUser',
method:"get",
data:{
unitType:"4",
projectId:that.data.projectId
url: app.globalData.reqUrl + '/wechat/projectuserinfo/selectProjectUnitUser',
method: "get",
data: {
unitType: "4",
projectId: that.data.projectId
},
header:{
'content-type': 'application/x-www-form-urlencoded'
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
if (res.code == 200) {
that.setData({
rectifierData:res.data,
rectifierData: res.data,
})
}
}
})
wx.request({
url: app.globalData.reqUrl+'/wechat/projectuserinfo/selectProjectUnitUser',
method:"get",
data:{
unitType:"2",
projectId:that.data.projectId
url: app.globalData.reqUrl + '/wechat/projectuserinfo/selectProjectUnitUser',
method: "get",
data: {
unitType: "2",
projectId: that.data.projectId
},
header:{
'content-type': 'application/x-www-form-urlencoded'
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
if (res.code == 200) {
that.setData({
rectifierData2:res.data,
rectifierData2: res.data,
})
}
}
})
},
getMeasureTypeList(){
getMeasureTypeList() {
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectMeasure/queryDictType',
method:"get",
data:{
type:'project_measure_type'
url: app.globalData.reqUrl + '/wechat/projectMeasure/queryDictType',
method: "get",
data: {
type: 'project_measure_type'
},
header:{
'content-type': 'application/x-www-form-urlencoded'
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
let list=[];
res.data.forEach(it =>{
list.push({"id":it.dictValue,"text":it.dictLabel});
if (res.code == 200) {
let list = [];
res.data.forEach(it => {
list.push({
"id": it.dictValue,
"text": it.dictLabel
});
})
that.setData({
measureTypeList:list
measureTypeList: list
})
}
}
})
},
getMeasureInfoTypeList(){
getMeasureInfoTypeList() {
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectMeasure/queryDictType',
method:"get",
data:{
type:'project_measure_info_type'
url: app.globalData.reqUrl + '/wechat/projectMeasure/queryDictType',
method: "get",
data: {
type: 'project_measure_info_type'
},
header:{
'content-type': 'application/x-www-form-urlencoded'
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success(res){
success(res) {
res = res.data
if(res.code == 200){
let list=[];
res.data.forEach(it =>{
list.push({"id":it.dictValue,"text":it.dictLabel});
if (res.code == 200) {
let list = [];
res.data.forEach(it => {
if (that.data.type == 6) {
if (it.remark) {
list.push({
"id": it.dictValue,
"text": it.dictLabel
});
}
} else {
if (!it.remark) {
list.push({
"id": it.dictValue,
"text": it.dictLabel
});
}
}
})
that.setData({
measureInfoTypeList:list
infoTypeList: res.data,
measureInfoTypeList: list
})
}
}
})
},
/**
/**
* 获取安全检查详情信息
*
*/
getInfo(){
let {id} = this.data
getInfo() {
let {
id
} = this.data
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectMeasure/info',
method:"get",
data:{
id:id
},
success(res){
res = res.data
if(res.code == 200){
let imageInfoData = [];
if(res.data.imageUrls){
res.data.imageUrls.split(',').forEach(element => {
imageInfoData.push(that.data.request+element+'.min.jpg');
});
}
that.setData({
infoData:res.data,
imageInfoData,
loadShow:false
})
url: app.globalData.reqUrl + '/wechat/projectMeasure/info',
method: "get",
data: {
id: id
},
success(res) {
res = res.data
if (res.code == 200) {
let imageInfoData = [];
if (res.data.imageUrls) {
res.data.imageUrls.split(',').forEach(element => {
imageInfoData.push(that.data.request + element + '.min.jpg');
});
}
let filesData = [];
if (res.data.measureFiles) {
res.data.measureFiles.split(',').forEach(element => {
let it = element.split('/');
filesData.push({
name: it[it.length - 1],
path: element
});
});
}
that.setData({
infoData: res.data,
imageInfoData,
filesData,
loadShow: false
})
}
}
}
})
},
/**
/**
* 查询流程日志
*/
getAuditinfo(){
getAuditinfo() {
let that = this
wx.request({
url: app.globalData.reqUrl+'/wechat/projectAuditinfo/selectProjectAuditinfo',
method:"get",
data:{
fromType:"2",
fromId:this.data.id
},
success(res){
res = res.data
if(res.code == 200){
that.setData({
flowRecordList:res.data
})
url: app.globalData.reqUrl + '/wechat/projectAuditinfo/selectProjectAuditinfo',
method: "get",
data: {
fromType: "2",
fromId: this.data.id
},
success(res) {
res = res.data
if (res.code == 200) {
that.setData({
flowRecordList: res.data
})
}
}
}
})
},
// 手风琴
onChange(event) {
this.setData({
activeName: event.detail,
});
this.setData({
activeName: event.detail,
});
},
//测量部位
onInputMeasurePosition(e){
onInputMeasurePosition(e) {
this.setData({
"infoData.measurePosition":e.detail.value
"infoData.measurePosition": e.detail.value
})
},
//测量点位
onInputMeasurePointPosition(e){
onInputMeasurePointPosition(e) {
this.setData({
"infoData.measurePointPosition":e.detail.value
"infoData.measurePointPosition": e.detail.value
})
},
//验收时间
onInputTime(e){
onInputTime(e) {
this.setData({
"infoData.measureTime":e.detail.value
"infoData.measureTime": e.detail.value + ":00"
})
},
// list 上传图片
onImagesArr(e){
onImagesArr(e) {
var data = this.data.imageInfoData
data = e.detail
this.setData({
imageInfoData:data
imageInfoData: data
})
},
//添加质量专员
onAddQualityUser(e){
if(e.detail.length>0){
onAddQualityUser(e) {
if (e.detail.length > 0) {
this.setData({
"infoData.qualityUser":e.detail[0].phoneNumber,
"infoData.qualityUserName":e.detail[0].userName
"infoData.qualityUser": e.detail[0].phoneNumber,
"infoData.qualityUserName": e.detail[0].userName
})
}
},
//添加监理专员
onAddSuperviseUser(e){
if(e.detail.length>0){
onAddSuperviseUser(e) {
if (e.detail.length > 0) {
this.setData({
"infoData.superviseUser":e.detail[0].phoneNumber,
"infoData.superviseUserName":e.detail[0].userName
"infoData.superviseUser": e.detail[0].phoneNumber,
"infoData.superviseUserName": e.detail[0].userName
})
}
},
//取消页面
cancelSaveView(){
cancelSaveView() {
this.returnToPage()
},
//保存
onSave(){
onSave() {
this.setData({
loadShow:true
loadShow: true
})
let that = this
let {id,loginName,imageInfoData,infoData} = that.data;
let {
id,
loginName,
imageInfoData,
infoData,
measureFiles
} = that.data;
//数据效验
if(id==""){
if (id == "") {
app.toast("数据异常,请刷新页面重试!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(imageInfoData.length==0){
if (imageInfoData.length == 0) {
app.toast("请上传测量现场图片!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(infoData.measureType==""){
if (infoData.measureType == "") {
app.toast("请选择测量类型!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(infoData.measureInfo==""){
if (infoData.measureInfo == "") {
app.toast("请选择测量内容!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(infoData.measurePosition==""){
if (infoData.measurePosition == "") {
app.toast("请填写测量部位!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(infoData.measurePointPosition==""){
if (infoData.measurePointPosition == "") {
app.toast("请填写测量点位!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(infoData.qualityUser==""||infoData.qualityUserName==""){
if (infoData.qualityUser == "" || infoData.qualityUserName == "") {
app.toast("请选择质量专员!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(infoData.superviseUser==""||infoData.superviseUserName==""){
if (infoData.superviseUser == "" || infoData.superviseUserName == "") {
app.toast("请选择监理专员!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(infoData.measureTime==""){
if (infoData.measureTime == "") {
app.toast("请选择测量时间!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if(infoData.superviseUser==infoData.qualityUser){
if (infoData.superviseUser == infoData.qualityUser) {
app.toast("质量专员和监理专员不能是同一人!")
that.setData({
loadShow:false
loadShow: false
})
return;
}
if (measureFiles.length > 0) {
for (let i = 0; i < measureFiles.length; i++) {
let _fileType = measureFiles[i].path.split('.');
_fileType = _fileType[_fileType.length - 1].toLowerCase();
//判断附件类型,如果是图片直接展示,非图片则显示附件
if (this.data.fileType.indexOf(_fileType) == -1) {
app.toast("当前 [ " + _fileType + " ] 文件不支持上传!")
that.setData({
loadShow: false
});
return;
}
}
}
let fileUrls = [];
imageInfoData.forEach(async (item)=>{
let _measureFiles = [];
imageInfoData.forEach(async (item) => {
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
if(item.indexOf(that.data.request)>-1){
fileUrls.push(item.replace(that.data.request,"").replace(".min.jpg",""));
}else{
let uploadUrl = app.globalData.uploadUrl+'/common/upload'
let name = "file"
let obj = await that.syncUploadImage(uploadUrl,item,name);
if (item.indexOf(that.data.request) > -1) {
fileUrls.push(item.replace(that.data.request, "").replace(".min.jpg", ""));
} else {
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 = {
id,
imageUrls:fileUrls.toString(),
measureType:infoData.measureType,
measureInfo:infoData.measureInfo,
measurePosition:infoData.measurePosition,
measurePointPosition:infoData.measurePointPosition,
qualityUser:infoData.qualityUser,
qualityUserName:infoData.qualityUserName,
superviseUser:infoData.superviseUser,
superviseUserName:infoData.superviseUserName,
measureTime:infoData.measureTime,
approveStatus:"1",
updateBy:loginName
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectMeasure/edit',
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)
if (fileUrls.length == imageInfoData.length) {
if (measureFiles.length > 0) {
measureFiles.forEach(async (_file) => {
if (_file.path.indexOf("/profile") > -1) {
_measureFiles.push(_file.path);
} else {
let uploadUrl = app.globalData.uploadUrl + '/common/upload'
let name = "file"
//这里复杂的图片上传,改为同步上传,因为小程序只能上传一张图片
let obj = await that.syncUploadImage(uploadUrl, _file.path, name);
_measureFiles.push(obj.data.fileName);
}
}
})
if (_measureFiles.length == measureFiles.length) {
this.submitFroms(fileUrls, _measureFiles);
}
});
} else {
//不传入附件信息
this.submitFroms(fileUrls, "");
}
})
}
})
},
/**
* 表单提交
*/
submitFroms(fileUlrs, measureFiles) {
let that = this
let {
id,
loginName,
infoData
} = that.data;
let params = {
id,
imageUrls: fileUlrs.toString(),
measureFiles: measureFiles.toString(),
measureType: infoData.measureType,
measureInfo: infoData.measureInfo,
measurePosition: infoData.measurePosition,
measurePointPosition: infoData.measurePointPosition,
qualityUser: infoData.qualityUser,
qualityUserName: infoData.qualityUserName,
superviseUser: infoData.superviseUser,
superviseUserName: infoData.superviseUserName,
measureTime: infoData.measureTime,
approveStatus: "1",
updateBy: loginName
}
wx.request({
url: app.globalData.reqUrl + '/wechat/projectMeasure/edit',
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) {
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)
}
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)
}
});
})
},
//选择测量类型
onSelectMeasureType(e){
/**
* 文件上传
* @param {*} e
*/
fileUpload(e) {
this.setData({
"infoData.measureType":e.detail.id
measureFiles: e.detail
});
},
//选择测量类型
onSelectMeasureType(e) {
let list = [];
if (e.detail.id == 6) {
this.data.infoTypeList.forEach(item => {
if (item.remark == "gjgc") {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
}
})
} else {
this.data.infoTypeList.forEach(item => {
if (!item.remark) {
list.push({
"id": item.dictValue,
"text": item.dictLabel
});
}
})
}
this.setData({
"infoData.measureType": e.detail.id,
"infoData.measureInfo": list[0].id,
measureInfoTypeList: list
})
},
//选择测量内容
onSelectMeasureInfo(e){
onSelectMeasureInfo(e) {
this.setData({
"infoData.measureInfo":e.detail.id
"infoData.measureInfo": e.detail.id
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
wx.redirectTo({
url: '../list/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成

View File

@ -96,6 +96,14 @@
<voucher-datetime counts="5" placeholder="请选择测量时间" maxDate="{{maxDate}}" currentDate="{{currentDate}}" bindchange="onInputTime" time="{{infoData.measureTime}}"></voucher-datetime>
</view>
</view>
<view class="inspect_info_list" style="width: 100%;">
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">测量附件
<text style="font-size: small;">[可上传PDF/图片/WORD/PPT/XLS格式]</text>
</view>
<view class="problem_list_info_con">
<file-uploader-all bindfiles="fileUpload" limit="{{limit}}" fileUrlArray="{{filesData}}"></file-uploader-all>
</view>
</view>
</view>
<view class="problem_submit_to">
<view class="problem_submit_to_btn" bindtap="cancelSaveView">取消</view>

View File

@ -150,7 +150,7 @@ Page({
onUpdate:function(){
let id = this.data.id;
wx.redirectTo({
url: `../edit/index?id=${id}`,
url: `../edit/index?id=${id}&measureType=${this.data.infoData.measureType}&measureInfo=${this.data.infoData.measureInfo}`,
})
},

View File

@ -2,94 +2,177 @@
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
deptId:"",
loginName:"",
projectId:"",
minRoleId:"",
projectData:{},
initData: {},
show:false,
listData:[],
jxzCount:0,
ywcCount:0,
activeState:"jxz",
request:app.globalData.reqUrl
},
/**
* 页面的初始数据
*/
data: {
deptId: "",
loginName: "",
projectId: "",
minRoleId: "",
projectData: {},
initData: {},
show: false,
listData: [],
jxzCount: 0,
ywcCount: 0,
activeState: "jxz",
request: app.globalData.reqUrl
},
skipAdd(){
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=`+this.data.initData.text,
})
},
skipAdd() {
wx.redirectTo({
url: `../add/index?projectId=${this.data.initData.id}&projectName=` + this.data.initData.text,
})
},
getInfo(e){
let {id,approveStatus,superviseUser} = e.currentTarget.dataset.set
if(approveStatus=="1" && superviseUser==this.data.loginName){
wx.redirectTo({
url: `../../../pages/project_approve/approveMeasure/index?id=${id}`
})
}else{
wx.redirectTo({
url: `../info/index?id=${id}`
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success:res=>{
this.setData({
deptId:res.data.deptId,
loginName:res.data.loginName,
userName:res.data.userName,
projectId:app.globalData.projectId,
minRoleId:res.data.minRoleId,
initData:{text:app.globalData.projectName,id:app.globalData.projectId}
})
this.getListData(app.globalData.projectId,res.data.deptId,res.data.minRoleId);
}
getInfo(e) {
let {
id,
approveStatus,
superviseUser
} = e.currentTarget.dataset.set
if (approveStatus == "1" && superviseUser == this.data.loginName) {
wx.redirectTo({
url: `../../../pages/project_approve/approveMeasure/index?id=${id}`
})
},
} else {
wx.redirectTo({
url: `../info/index?id=${id}`
})
}
},
/**
* 查询项目实测实量数据
*/
getListData(projectId,deptId,minRoleId) {
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options && options.barProId) {
//数据未加载完毕,从文件读取数据
if (app.globalData.projectInfoList.length == 0) {
wx.getStorage({
key: 'projectInfoList',
success: res => {
app.globalData.projectInfoList = res.data;
app.globalData.projectInfoList.forEach(item => {
if (item.projectId == options.barProId) {
app.globalData.projectId = item.projectId;
app.globalData.projectName = item.projectName;
}
});
//未查询到项目信息
if (!app.globalData.projectId) {
app.globalData.projectInfoList.push({
projectId: options.barProId,
projectId: options.barProName
});
app.globalData.projectId = options.barProId;
app.globalData.projectName = options.barProName;
}
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
},
fail: err => {
//未获取用户信息时,重新登录
wx.redirectTo({
url: '../pages/login/index',
})
}
})
} else {
app.globalData.projectInfoList.forEach(item => {
if (item.projectId == options.barProId) {
app.globalData.projectId = item.projectId;
app.globalData.projectName = item.projectName;
}
});
//未查询到项目信息
if (!app.globalData.projectId) {
app.globalData.projectInfoList.push({
projectId: options.barProId,
projectId: options.barProName
});
app.globalData.projectId = options.barProId;
app.globalData.projectName = options.barProName;
}
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
}
} else {
//从缓存读取项目信息
this.setData({
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
}
//获取缓存数据
wx.getStorage({
key: 'userinfo',
success: res => {
this.setData({
deptId: res.data.deptId,
loginName: res.data.loginName,
userName: res.data.userName,
projectId: app.globalData.projectId,
minRoleId: res.data.minRoleId,
initData: {
text: app.globalData.projectName,
id: app.globalData.projectId
}
})
this.getListData(app.globalData.projectId, res.data.deptId, res.data.minRoleId);
},
fail: err => {
//未获取用户信息时,重新登录
wx.redirectTo({
url: '../pages/login/index',
})
}
})
},
/**
* 查询项目实测实量数据
*/
getListData(projectId, deptId, minRoleId) {
var that = this;
//判断角色,
if(minRoleId==2||minRoleId==3||minRoleId==4){
deptId=0;
//判断角色,
if (minRoleId == 2 || minRoleId == 3 || minRoleId == 4) {
deptId = 0;
}
let param = {
"projectId": projectId,
"deptId":deptId,
"nowUserName":this.data.loginName,
"activeName": this.data.activeState,
"projectId": projectId,
"deptId": deptId,
"nowUserName": this.data.loginName,
"activeName": this.data.activeState,
}
this.queryCount(param);
wx.request({
url: app.globalData.reqUrl + '/wechat/projectMeasure/list',
data:param,
data: param,
method: "get",
success: function (res) {
that.setData({
listData:res.data.data
listData: res.data.data
})
}
});
},
},
//查询统计
queryCount(param){
//查询统计
queryCount(param) {
//查询统计数量
let that = this;
wx.request({
@ -98,8 +181,8 @@ Page({
method: "get",
success: function (res) {
that.setData({
jxzCount:res.data.data.jxz,
ywcCount:res.data.data.ywc
jxzCount: res.data.data.jxz,
ywcCount: res.data.data.ywc
});
}
});
@ -108,88 +191,88 @@ Page({
/**
* 标签切换
*/
typeJump(e){
typeJump(e) {
let index = e.currentTarget.dataset.index;
let nav = "";
if(index == 1){
if (index == 1) {
nav = 'jxz';
}else if(index == 2){
} else if (index == 2) {
nav = 'ywc';
}
this.setData({
activeState:nav
activeState: nav
});
this.getListData(this.data.projectId,this.data.deptId,this.data.minRoleId);
this.getListData(this.data.projectId, this.data.deptId, this.data.minRoleId);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
},
returnToPage: function () {
/*关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面*/
if(wx.getStorageSync('nav-menu')=="gd"){
wx.redirectTo({
url: '../../../pages/gengduogongneng/index',
})
}else{
wx.redirectTo({
url: '../../../pages/quality_manage/index',
})
}
},
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){
//项目切换 返回值
onProjectSelect(e) {
let projectId = e.detail.id;
let projectName = e.detail.text;
app.globalData.projectId = projectId;
app.globalData.projectName = projectName;
app.globalData.projectName = projectName;
this.onLoad();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}
})

View File

@ -28,7 +28,7 @@ Page({
deptNames:"",
dataType:"",
trainDataTypeList:[],
fileType:["doc","docx","xls","xlsx","ppt","pptx","txt","pdf","png","jpg","jpeg","mp4"]
fileType:["doc","docx","xls","xlsx","ppt","pptx","pdf","png","jpg","jpeg"]
},
/**

View File

@ -23,7 +23,7 @@ Component({
},
observers: {
chartData: function (val) {
console.log(val)
//console.log(val)
this.initChart()
},
},

View File

@ -15,7 +15,7 @@ Component({
},
observers: {
chartData: function (val) {
console.log(val)
//console.log(val)
this.initChart()
},
},

View File

@ -19,7 +19,7 @@ Component({
/**数据监听 */
observers: {
columns: function (val) {
console.log(val)
//console.log(val)
if(val.length > 0){
this.setData({
floorList:val[0].floorList

View File

@ -1,6 +1,9 @@
import {
removeToken
} from '../../../utils/auth'
import {
loginOut
} from '../../../api/login'
const app = getApp()
Component({
/**数据监听 */
@ -18,6 +21,7 @@ Component({
showOldPass: true,
showNewPass: true,
showPassWord: true,
binding: false,
},
created() {
@ -59,6 +63,11 @@ Component({
});
},
//绑定公众号
binding: function () {
app.initWxAuth();
},
/**
* 修改密码返回
*/
@ -68,9 +77,27 @@ Component({
});
},
/**
* 修改密码返回
*/
closeBinding: function () {
this.setData({
binding: false
});
},
bindingBuild: function () {
wx.previewImage({
urls: "https://szgcwx.jhncidg.com/staticFiles/qr.jpg".split(","),
current: 0
})
},
//退出登录
loginOut: function () {
removeToken();
loginOut({}).then(res => {
removeToken();
});
wx.clearStorageSync();
wx.setStorageSync('isReload', "1")
wx.redirectTo({
@ -79,7 +106,6 @@ Component({
},
seeTap1() {
debugger
let that = this;
that.setData({
// 切换图标

View File

@ -2,7 +2,10 @@
"usingComponents": {
"van-row": "@vant/weapp/row",
"van-col": "@vant/weapp/col",
"van-popup": "@vant/weapp/popup"
"van-popup": "@vant/weapp/popup",
"van-notice-bar": "@vant/weapp/notice-bar/index",
"van-grid": "@vant/weapp/grid/index",
"van-grid-item": "@vant/weapp/grid-item/index"
},
"navigationStyle":"custom"
}

View File

@ -20,9 +20,20 @@
</view>
</van-col>
</van-row>
<view class="left_manage_min" wx:if="{{true}}">
<view class="message-title">关注公众号才能成功开启消息通知</view>
</view>
<button wx:if="{{true}}" type="default" size="default" style="margin-top: 40rpx;background-color: #513ea7;color: #FFF;" bindtap="bindingBuild">立即关注公众号</button>
<view class="left_manage_min" wx:if="{{binding}}">
<view class="left_manage" bindtap="binding">
<image src="/images/img_1.png" class="left_icon"></image>
<text class="left_binding">开启消息通知</text>
<image src="/images/right.png" class="left_flaot"></image>
</view>
</view>
<view class="left_manage_min">
<view class="left_manage" bindtap="resPassword">
<image src="/images/set.png" class="left_icon"></image>
<image src="/images/img_5.png" class="left_icon"></image>
<text class="left_password">修改密码</text>
<image src="/images/right.png" class="left_flaot"></image>
</view>
@ -38,7 +49,7 @@
</van-popup>
<!--修改密码-->
<van-popup show="{{ resPas }}" position="left" class="passClass" custom-style="width: 100%;height:100%;background: #191d28 url(http://fileimg.makalu.cc/CORE_40247DD946964A15AA0D4000E1031E19.png) no-repeat bottom/100%;" bind:close="closeResPas">
<van-popup show="{{ resPas }}" position="left" class="passClass" custom-style="width: 100%;height:100%;background: #191d28 url(https://szgcwx.jhncidg.com/staticFiles/img/CORE_40247DD946964A15AA0D4000E1031E19.png) no-repeat bottom/100%;" bind:close="closeResPas">
<view class="bg_bg">
<image src="https://szgcwx.jhncidg.com/staticFiles/img/yanzhu_logo_blue.png"></image>
</view>

View File

@ -49,6 +49,15 @@
padding: 0 5%;
margin-top: 40rpx;
}
.message-title{
color: #FFFFFF;
font-weight: 600;
text-align: center;
}
.color_blue {
color: #45affb;
}
.left_manage {
padding: 20rpx 20rpx 15rpx;
@ -85,6 +94,12 @@
padding-bottom: 5rpx;
}
.left_binding {
text-align: center;
padding-bottom: 5rpx;
color: #45affb;
}
.left_sign {
text-align: center;
padding-bottom: 5rpx;

View File

@ -1,4 +1,9 @@
// pages/gongchengliebiao/index.js\
import {
removeToken
} from '../../utils/auth'
import {
loginOut
} from '../../api/login'
const app = getApp()
Page({
@ -289,6 +294,9 @@ Page({
this.setData({ loadShow: false });
},
onLogout(){
loginOut({}).then(res => {
removeToken();
});
wx.clearStorageSync();
wx.setStorageSync('isReload', "1")
wx.redirectTo({
@ -311,7 +319,6 @@ Page({
value3:app.globalData.value3
})
// let _dataList = app.globalData.projectInfoList;
// debugger
// if(app.globalData.type == "1"){
// that.setData({
// "type":'1',
@ -466,6 +473,11 @@ Page({
projectData:res.data,
projectInfoList:res.data
})
//存入文件中
wx.setStorage({
key: 'projectInfoList',
data: res.data
});
app.globalData.projectInfoList = res.data;
//if(that.data.type == 1){
// that.setData({

View File

@ -92,9 +92,6 @@
<view class="font_color {{ index == nav3 ? 'active3' :' ' }}" wx:for = "{{ziGs}}" wx:key="ziGs" data-index="{{index}}" bindtap="onclassC" data-name="{{item.text}}" data-id="{{item.id}}"> {{item.text}}</view>
</view>
</van-popup>
</van-row>
</view>
@ -102,7 +99,6 @@
{{value1}}/{{value2}}/{{value3}}
</view>
<view class="list_title">
总工程数<text>{{proCount}}</text>
</view>

View File

@ -133,6 +133,11 @@ Page({
app.globalData.value1 = rd.projectInfo.shengName;
app.globalData.value2 = rd.projectInfo.shiName + '/' + rd.projectInfo.quName;
app.globalData.value3 = rd.projectInfo.logCompanyName;
//存入文件中
wx.setStorage({
key: 'projectInfoList',
data: app.globalData.projectInfoList
});
wx.redirectTo({
url: '../xiangmugaikuang/index',
})
@ -225,6 +230,11 @@ Page({
app.globalData.value1 = rd.projectInfo.shengName;
app.globalData.value2 = rd.projectInfo.shiName + '/' + rd.projectInfo.quName;
app.globalData.value3 = rd.projectInfo.logCompanyName;
//存入文件中
wx.setStorage({
key: 'projectInfoList',
data: app.globalData.projectInfoList
});
wx.redirectTo({
url: '../xiangmugaikuang/index',
})

File diff suppressed because it is too large Load Diff

View File

@ -200,11 +200,11 @@ Page({
},
//展示图片
showImg:function(e){
showDetectionFileImg:function(e){
var that=this;
wx.previewImage({
urls: that.data.imageList,
current: that.data.imageList[e.currentTarget.dataset.index]
urls: that.data.detectionImageList,
current: that.data.detectionImageList[e.currentTarget.dataset.index]
})
},

View File

@ -275,8 +275,8 @@ Page({
showSignFileImg:function(e){
var that=this;
wx.previewImage({
urls: that.data.sifnFileImages,
current: that.data.sifnFileImages[e.currentTarget.dataset.index]
urls: that.data.signFileImages,
current: that.data.signFileImages[e.currentTarget.dataset.index]
})
},

View File

@ -56,6 +56,11 @@ Page({
name: '特殊事项确认',
icon: config.baseUrl + '/staticFiles/img/tssxqrl.png',
todoDB:0,
}, {
id: 8,
name: '专项验收审批',
icon: config.baseUrl + '/staticFiles/img/zxyssp.png',
todoDB:0,
}
],
},

View File

@ -29,7 +29,6 @@ Page({
taskName:"",
passState:true,
backName:"",
filesData:[],
ret:"",
remark:"",
filesData:[],

View File

@ -0,0 +1,68 @@
import config from '../../config'
Page({
/**
* 页面的初始数据
*/
data: {
url:""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
url:config.manageUrl+"/#/wxAuth?userOpenId=1111111111111111"
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

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

View File

@ -0,0 +1,2 @@
<!--pages/wx-auth/index.wxml-->
<web-view src="{{url}}"></web-view>

View File

@ -0,0 +1 @@
/* pages/wx-auth/index.wxss */

View File

@ -21,9 +21,6 @@
<!-- 中间内容 -->
<view class="max_content" >
<project-select init="{{initData}}" bindchange="onProjectSelect"></project-select>
<view class="official">
<official-account></official-account>
</view>
<!-- <view class="video_add">
<view class="video_address">
<view class="video_address_min" bindtap="GOMAP">

View File

@ -35,7 +35,7 @@ function doRequest(url, method = 'GET', data, header = {}) {
if (code === 401) {
removeToken();
wx.redirectTo({
url: '../login/index',
url: '../pages/login/index',
});
} else if (code === 500 || code === 403) {
app.toast(res.data.msg);

View File

@ -4,5 +4,233 @@
"setting": {
"compileHotReLoad": true,
"urlCheck": false
},
"condition": {
"miniprogram": {
"list": [
{
"name": "db guide",
"pathName": "pages/databaseGuide/databaseGuide",
"query": ""
},
{
"name": "pages/gongchengliebiao/index",
"pathName": "pages/gongchengliebiao/index",
"query": "",
"scene": null
},
{
"name": "pages/gengduogongneng/index",
"pathName": "pages/gengduogongneng/index",
"query": "",
"scene": null
},
{
"name": "pages/login/index",
"pathName": "pages/login/index",
"query": "",
"scene": null
},
{
"name": "pages/xiangmushipin/xiangmushipin",
"pathName": "pages/xiangmushipin/xiangmushipin",
"query": "",
"scene": null
},
{
"name": "pageage/project_checking/list/index",
"pathName": "pageage/project_checking/list/index",
"query": "barProId=645",
"launchMode": "default",
"scene": null
},
{
"name": "pages/gengduogongneng/index",
"pathName": "pages/gengduogongneng/index",
"query": "",
"scene": null
},
{
"name": "pages/xiangmugaikuang/index",
"pathName": "pages/xiangmugaikuang/index",
"query": "",
"scene": null
},
{
"name": "pages/xiangmuhuanjing/xiangmuhuanjing",
"pathName": "pages/xiangmuhuanjing/xiangmuhuanjing",
"query": "",
"scene": null
},
{
"name": "pages/xiangmuyujing/xiangmuyujing",
"pathName": "pages/xiangmuyujing/xiangmuyujing",
"query": "",
"scene": null
},
{
"name": "pages/gengduogongneng/index",
"pathName": "pages/gengduogongneng/index",
"query": "",
"scene": null
},
{
"name": "pages/xiangmugaikuang/index",
"pathName": "pages/xiangmugaikuang/index",
"query": "projectId=2&projectName=山西四建月亮湾Ⅱ湾住宅小区建设项目",
"scene": null
},
{
"name": "pages/shebieguanli-taji/taji",
"pathName": "pages/shebieguanli-taji/taji",
"query": "",
"scene": null
},
{
"name": "pages/shebieguanli-shajiangguan/shajiangguan",
"pathName": "pages/shebieguanli-shajiangguan/shajiangguan",
"query": "",
"scene": null
},
{
"name": "pages/xiangmugaikuang/index",
"pathName": "pages/xiangmugaikuang/index",
"query": "projectId=2&projectName=山西四建月亮湾Ⅱ湾住宅小区建设项目",
"scene": null
},
{
"name": "pages/xiangmuyujing/xiangmuyujing",
"pathName": "pages/xiangmuyujing/xiangmuyujing",
"query": "projectId=2&projectName=山西四建月亮湾Ⅱ湾住宅小区建设项目",
"scene": null
},
{
"name": "pages/map/map",
"pathName": "pages/map/map",
"query": "projectId=2&projectName=山西四建月亮湾Ⅱ湾住宅小区建设项目",
"scene": null
},
{
"name": "pages/map/map",
"pathName": "pages/map/map",
"query": "projectId=2&projectName=山西四建月亮湾Ⅱ湾住宅小区建设项目",
"scene": null
},
{
"name": "pages/yujingxinxi/yujingxinxi",
"pathName": "pages/yujingxinxi/yujingxinxi",
"query": "",
"scene": null
},
{
"name": "pages/yujingxinxi/yujingxinxi",
"pathName": "pages/yujingxinxi/yujingxinxi",
"query": "",
"scene": null
},
{
"name": "pages/xiangmushipin/xiangmushipin",
"pathName": "pages/xiangmushipin/xiangmushipin",
"query": "",
"scene": null
},
{
"name": "pages/xiangmushipin/xiangmushipin",
"pathName": "pages/xiangmushipin/xiangmushipin",
"query": "projectId=9&projectName=路桥龙锦花园东区",
"scene": null
},
{
"name": "pages/renyuanguanli/renyuanguanli",
"pathName": "pages/renyuanguanli/renyuanguanli",
"query": "projectId=9&projectName=路桥龙锦花园东区",
"scene": null
},
{
"name": "pages/renyuanguanli/renyuanguanli",
"pathName": "pages/renyuanguanli/renyuanguanli",
"query": "",
"scene": null
},
{
"name": "pages/ranyuanguanli-map/map",
"pathName": "pages/ranyuanguanli-map/map",
"query": "",
"scene": null
},
{
"name": "pages/renyuanguanli/renyuanguanli",
"pathName": "pages/renyuanguanli/renyuanguanli",
"query": "projectId=616",
"scene": null
},
{
"name": "pages/shebieguanli-shajiangguan/shajiangguan",
"pathName": "pages/shebieguanli-jxsb/shajiangguan",
"query": "",
"scene": null
},
{
"name": "pages/shebeiguanli-map/jixiedingwei",
"pathName": "pages/shebeiguanli-map/jixiedingwei",
"query": "",
"scene": null
},
{
"name": "pages/shebieguanli-tzsb/taji",
"pathName": "pages/shebieguanli-tzsb/taji",
"query": "",
"scene": null
},
{
"name": "pages/jinduguanli/jinduguanli",
"pathName": "pages/jinduguanli/jinduguanli",
"query": "",
"scene": null
},
{
"name": "pages/xiangmuyujing/xiangmuyujing",
"pathName": "pages/xiangmuyujing/xiangmuyujing",
"query": "projectId=616",
"scene": null
},
{
"name": "pages/anquanguankong/anquanguankong",
"pathName": "pages/anquanguankong/anquanguankong",
"query": "",
"scene": null
},
{
"name": "pages/nenghaoguanli/nenghaoguanli",
"pathName": "pages/nenghaoguanli/nenghaoguanli",
"query": "",
"scene": null
},
{
"name": "pages/wuliaoguanli/wuliaoguanli",
"pathName": "pages/wuliaoguanli/wuliaoguanli",
"query": "",
"scene": null
},
{
"name": "pages/jinduguanli/jinduguanli",
"pathName": "pages/jinduguanli/jinduguanli",
"query": "projectId=621",
"scene": null
},
{
"name": "pages/lw-jibenxinxi/lw-jibenxinxi",
"pathName": "pages/lw-jibenxinxi/lw-jibenxinxi",
"query": "",
"scene": null
},
{
"name": "pages/lw-gerenxinxi/lw-gerenxinxi",
"pathName": "pages/lw-gerenxinxi/lw-gerenxinxi",
"query": "register=1",
"scene": null
}
]
}
}
}