diff --git a/miniprogram/api/login.js b/miniprogram/api/login.js index 9e00f76..80082a7 100644 --- a/miniprogram/api/login.js +++ b/miniprogram/api/login.js @@ -29,7 +29,7 @@ export function updatePwd(data) { // 用户退出方法 export function loginOut() { return request({ - 'url': '/wxApi/loginOut', + 'url': '/wechat/loginOut', 'method': 'get' }) } diff --git a/miniprogram/api/projectFiles.js b/miniprogram/api/projectFiles.js index f140c10..113ba06 100644 --- a/miniprogram/api/projectFiles.js +++ b/miniprogram/api/projectFiles.js @@ -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' + }) } \ No newline at end of file diff --git a/miniprogram/app.js b/miniprogram/app.js index 67d968f..5c72ef6 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -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 diff --git a/miniprogram/app.json b/miniprogram/app.json index 8e7c1fa..695fb65 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -1,6 +1,7 @@ { "pages": [ "pages/login/index", + "pages/wx-auth/index", "pages/gongchengliebiao/index", "pages/gengduogongneng/index", "pages/xiangmugaikuang/index", diff --git a/miniprogram/config.js b/miniprogram/config.js index a5cb815..1091789 100644 --- a/miniprogram/config.js +++ b/miniprogram/config.js @@ -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'] }; \ No newline at end of file diff --git a/miniprogram/newComponents/safety-bar-chart/index.js b/miniprogram/newComponents/safety-bar-chart/index.js index b651c2f..c9dc4f4 100644 --- a/miniprogram/newComponents/safety-bar-chart/index.js +++ b/miniprogram/newComponents/safety-bar-chart/index.js @@ -19,7 +19,7 @@ Component({ }, observers: { data: function (val) { - console.log(val) + //console.log(val) this.initChart() }, }, diff --git a/miniprogram/newComponents/safety-pie-chart/index.js b/miniprogram/newComponents/safety-pie-chart/index.js index 7329cfe..3c9b284 100644 --- a/miniprogram/newComponents/safety-pie-chart/index.js +++ b/miniprogram/newComponents/safety-pie-chart/index.js @@ -18,7 +18,7 @@ Component({ }, observers: { chartData: function (val) { - console.log(val) + //console.log(val) this.initChart() }, }, diff --git a/miniprogram/pageage/project_checkDetection/info/index.js b/miniprogram/pageage/project_checkDetection/info/index.js index 8e37622..068a5db 100644 --- a/miniprogram/pageage/project_checkDetection/info/index.js +++ b/miniprogram/pageage/project_checkDetection/info/index.js @@ -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] }) }, diff --git a/miniprogram/pageage/project_checkDetection/info/index.wxml b/miniprogram/pageage/project_checkDetection/info/index.wxml index bd69588..b165adf 100644 --- a/miniprogram/pageage/project_checkDetection/info/index.wxml +++ b/miniprogram/pageage/project_checkDetection/info/index.wxml @@ -141,7 +141,7 @@ 检测报告 - + diff --git a/miniprogram/pageage/project_checkDetection/list/index.js b/miniprogram/pageage/project_checkDetection/list/index.js index 934deb8..9023d3f 100644 --- a/miniprogram/pageage/project_checkDetection/list/index.js +++ b/miniprogram/pageage/project_checkDetection/list/index.js @@ -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() { - } + } }) \ No newline at end of file diff --git a/miniprogram/pageage/project_checking/add/index.js b/miniprogram/pageage/project_checking/add/index.js index 544ca4e..177831c 100644 --- a/miniprogram/pageage/project_checking/add/index.js +++ b/miniprogram/pageage/project_checking/add/index.js @@ -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}); } diff --git a/miniprogram/pageage/project_checking/edit/index.js b/miniprogram/pageage/project_checking/edit/index.js index fb2e67e..207198f 100644 --- a/miniprogram/pageage/project_checking/edit/index.js +++ b/miniprogram/pageage/project_checking/edit/index.js @@ -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}); } diff --git a/miniprogram/pageage/project_checking/info/index.js b/miniprogram/pageage/project_checking/info/index.js index ca31ace..2f7acc8 100644 --- a/miniprogram/pageage/project_checking/info/index.js +++ b/miniprogram/pageage/project_checking/info/index.js @@ -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}`, }) }, diff --git a/miniprogram/pageage/project_checking/list/index.js b/miniprogram/pageage/project_checking/list/index.js index 6357172..9db4f5f 100644 --- a/miniprogram/pageage/project_checking/list/index.js +++ b/miniprogram/pageage/project_checking/list/index.js @@ -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() { - } + } }) \ No newline at end of file diff --git a/miniprogram/pageage/project_files/index.js b/miniprogram/pageage/project_files/index.js index a3263b2..d80f327 100644 --- a/miniprogram/pageage/project_files/index.js +++ b/miniprogram/pageage/project_files/index.js @@ -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, diff --git a/miniprogram/pageage/project_files/index.wxml b/miniprogram/pageage/project_files/index.wxml index 04d342e..1baa98f 100644 --- a/miniprogram/pageage/project_files/index.wxml +++ b/miniprogram/pageage/project_files/index.wxml @@ -28,7 +28,7 @@ {{index < 9 ?'0'+(index+1):(index+1)}} 上级部门 集团公司 - 子公司 + {{item.deptName}} diff --git a/miniprogram/pageage/project_materialSeal/info/index.js b/miniprogram/pageage/project_materialSeal/info/index.js index f64a231..0586be5 100644 --- a/miniprogram/pageage/project_materialSeal/info/index.js +++ b/miniprogram/pageage/project_materialSeal/info/index.js @@ -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] }) }, diff --git a/miniprogram/pageage/project_materialSeal/list/index.js b/miniprogram/pageage/project_materialSeal/list/index.js index 57ca912..9e9f165 100644 --- a/miniprogram/pageage/project_materialSeal/list/index.js +++ b/miniprogram/pageage/project_materialSeal/list/index.js @@ -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() { - } + } }) \ No newline at end of file diff --git a/miniprogram/pageage/project_measure/add/index.js b/miniprogram/pageage/project_measure/add/index.js index 0ad86db..9252d80 100644 --- a/miniprogram/pageage/project_measure/add/index.js +++ b/miniprogram/pageage/project_measure/add/index.js @@ -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', + }) + }, /** * 生命周期函数--监听页面初次渲染完成 diff --git a/miniprogram/pageage/project_measure/add/index.wxml b/miniprogram/pageage/project_measure/add/index.wxml index a0f8329..9e96806 100644 --- a/miniprogram/pageage/project_measure/add/index.wxml +++ b/miniprogram/pageage/project_measure/add/index.wxml @@ -75,6 +75,14 @@ + + 测量附件 + [可上传PDF/图片/WORD/PPT/XLS格式] + + + + + 取消 diff --git a/miniprogram/pageage/project_measure/edit/index.js b/miniprogram/pageage/project_measure/edit/index.js index 0825184..060489f 100644 --- a/miniprogram/pageage/project_measure/edit/index.js +++ b/miniprogram/pageage/project_measure/edit/index.js @@ -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', + }) + }, /** * 生命周期函数--监听页面初次渲染完成 diff --git a/miniprogram/pageage/project_measure/edit/index.wxml b/miniprogram/pageage/project_measure/edit/index.wxml index 7fb925a..e1b5e5a 100644 --- a/miniprogram/pageage/project_measure/edit/index.wxml +++ b/miniprogram/pageage/project_measure/edit/index.wxml @@ -96,6 +96,14 @@ + + 测量附件 + [可上传PDF/图片/WORD/PPT/XLS格式] + + + + + 取消 diff --git a/miniprogram/pageage/project_measure/info/index.js b/miniprogram/pageage/project_measure/info/index.js index 8c191b9..e089dc0 100644 --- a/miniprogram/pageage/project_measure/info/index.js +++ b/miniprogram/pageage/project_measure/info/index.js @@ -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}`, }) }, diff --git a/miniprogram/pageage/project_measure/list/index.js b/miniprogram/pageage/project_measure/list/index.js index d3a997b..b057a85 100644 --- a/miniprogram/pageage/project_measure/list/index.js +++ b/miniprogram/pageage/project_measure/list/index.js @@ -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() { - } + } }) \ No newline at end of file diff --git a/miniprogram/pageage/project_train/add/index.js b/miniprogram/pageage/project_train/add/index.js index f185f38..e1f4616 100644 --- a/miniprogram/pageage/project_train/add/index.js +++ b/miniprogram/pageage/project_train/add/index.js @@ -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"] }, /** diff --git a/miniprogram/pages/components/curve-echarts/index.js b/miniprogram/pages/components/curve-echarts/index.js index 0525c50..1b9724e 100644 --- a/miniprogram/pages/components/curve-echarts/index.js +++ b/miniprogram/pages/components/curve-echarts/index.js @@ -23,7 +23,7 @@ Component({ }, observers: { chartData: function (val) { - console.log(val) + //console.log(val) this.initChart() }, }, diff --git a/miniprogram/pages/components/pie-chart/index.js b/miniprogram/pages/components/pie-chart/index.js index 53d748e..1a47775 100644 --- a/miniprogram/pages/components/pie-chart/index.js +++ b/miniprogram/pages/components/pie-chart/index.js @@ -15,7 +15,7 @@ Component({ }, observers: { chartData: function (val) { - console.log(val) + //console.log(val) this.initChart() }, }, diff --git a/miniprogram/pages/components/pz-screen-training-index/index.js b/miniprogram/pages/components/pz-screen-training-index/index.js index 1ad5090..c65c9cf 100644 --- a/miniprogram/pages/components/pz-screen-training-index/index.js +++ b/miniprogram/pages/components/pz-screen-training-index/index.js @@ -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 diff --git a/miniprogram/pages/components/user-infos/index.js b/miniprogram/pages/components/user-infos/index.js index 81de267..f44d00a 100644 --- a/miniprogram/pages/components/user-infos/index.js +++ b/miniprogram/pages/components/user-infos/index.js @@ -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({ // 切换图标 diff --git a/miniprogram/pages/components/user-infos/index.json b/miniprogram/pages/components/user-infos/index.json index 0fb4abc..e45b507 100644 --- a/miniprogram/pages/components/user-infos/index.json +++ b/miniprogram/pages/components/user-infos/index.json @@ -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" } \ No newline at end of file diff --git a/miniprogram/pages/components/user-infos/index.wxml b/miniprogram/pages/components/user-infos/index.wxml index 3c7f4e8..a1723e5 100644 --- a/miniprogram/pages/components/user-infos/index.wxml +++ b/miniprogram/pages/components/user-infos/index.wxml @@ -20,9 +20,20 @@ + + 关注公众号才能成功开启消息通知 + + + + + + 开启消息通知 + + + - + 修改密码 @@ -38,7 +49,7 @@ - + diff --git a/miniprogram/pages/components/user-infos/index.wxss b/miniprogram/pages/components/user-infos/index.wxss index f1c7d2b..55f3be1 100644 --- a/miniprogram/pages/components/user-infos/index.wxss +++ b/miniprogram/pages/components/user-infos/index.wxss @@ -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; diff --git a/miniprogram/pages/gongchengliebiao/index.js b/miniprogram/pages/gongchengliebiao/index.js index 0105980..a7d9a99 100644 --- a/miniprogram/pages/gongchengliebiao/index.js +++ b/miniprogram/pages/gongchengliebiao/index.js @@ -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({ diff --git a/miniprogram/pages/gongchengliebiao/index.wxml b/miniprogram/pages/gongchengliebiao/index.wxml index c1f3398..a861664 100644 --- a/miniprogram/pages/gongchengliebiao/index.wxml +++ b/miniprogram/pages/gongchengliebiao/index.wxml @@ -92,9 +92,6 @@ {{item.text}} - - - @@ -102,7 +99,6 @@ {{value1}}/{{value2}}/{{value3}} - 总工程数({{proCount}}) diff --git a/miniprogram/pages/login/index.js b/miniprogram/pages/login/index.js index 9aaa282..860ed02 100644 --- a/miniprogram/pages/login/index.js +++ b/miniprogram/pages/login/index.js @@ -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', }) diff --git a/miniprogram/pages/map/map.js b/miniprogram/pages/map/map.js index ab2d648..d045219 100644 --- a/miniprogram/pages/map/map.js +++ b/miniprogram/pages/map/map.js @@ -4,124 +4,175 @@ const app = getApp() Page({ data: { - userInfo:{}, - deptId:'', - height:"auto", - scale:'10', - initialLon:'108.90975705669825', - initialLat:'34.53095652639473', + userInfo: {}, + deptId: '', + height: "auto", + scale: '10', + initialLon: '108.90975705669825', + initialLat: '34.53095652639473', markers: [], - value1:'省', - value2:'市/区', - value3:'公司', + value1: '省', + value2: '市/区', + value3: '公司', show1: false, show2: false, show3: false, sheng: [], - citys:{}, - companys:{}, + citys: {}, + companys: {}, cityArea: [], - company:[], - projectData:[], - environProjectData:[], - projectCount:'0', - ifSonCompany:'', - ifDeptId:false, - monitoringCount:'0', - videoNum:'0', - mechanicsNum:'0', - environCount:'0', - logCompanyName:'', - popUp1:false, - popUp2:false, - popUp3:false, - companyId:'', - paramPost:'', - loadShow:false, + company: [], + projectData: [], + environProjectData: [], + projectCount: '0', + ifSonCompany: '', + ifDeptId: false, + monitoringCount: '0', + videoNum: '0', + mechanicsNum: '0', + environCount: '0', + logCompanyName: '', + popUp1: false, + popUp2: false, + popUp3: false, + companyId: '', + paramPost: '', + loadShow: false, //省、市、区 - provinceId:'', - cityId:'', - areaId:'', - temDeptId:'', + provinceId: '', + cityId: '', + areaId: '', + temDeptId: '', //*******新版本*****/ - showTest:false, - tabActive:0, - jt:[], - shengGs:[], - ziGs:[], + showTest: false, + tabActive: 0, + jt: [], + shengGs: [], + ziGs: [], nav1: "0", nav2: "-1", nav3: "-1", - classA:"", - classB:"", - classC:"", - flag1:true, - flag2:false, - flag3:false, - Highlight1:"active", - Highlight2:"", - Highlight3:"", - title2:false, - title3:false, - dataclass1:0, - dataclass2:0, - dataclass3:0, - overall1:"", - overall2:"", - overall3:"", - newCompanyId:'', + classA: "", + classB: "", + classC: "", + flag1: true, + flag2: false, + flag3: false, + Highlight1: "active", + Highlight2: "", + Highlight3: "", + title2: false, + title3: false, + dataclass1: 0, + dataclass2: 0, + dataclass3: 0, + overall1: "", + overall2: "", + overall3: "", + newCompanyId: '', }, - onclassA(event){ - this.setData({nav1: event.target.dataset.index}); - this.setData({dataclass1: 1}); - if(this.data.dataclass1 == 1){ - this.setData({title2: true}); + onclassA(event) { + this.setData({ + nav1: event.target.dataset.index + }); + this.setData({ + dataclass1: 1 + }); + if (this.data.dataclass1 == 1) { + this.setData({ + title2: true + }); } - this.setData({classA: event.target.dataset.name}); - this.setData({overall1: event.target.dataset.name,newCompanyId:event.target.dataset.id}); - this.setData({value3:event.target.dataset.name}) + this.setData({ + classA: event.target.dataset.name + }); + this.setData({ + overall1: event.target.dataset.name, + newCompanyId: event.target.dataset.id + }); + this.setData({ + value3: event.target.dataset.name + }) //获取子公司信息 - this.setData({showTest:false}) + this.setData({ + showTest: false + }) wx.setStorageSync('select_dept_id', event.target.dataset.id) wx.setStorageSync('select_dept_name', event.target.dataset.name) wx.setStorageSync('select_dept_index', event.target.dataset.index) - this.selectProjectByCompanyId(event.target.dataset.id,'','',''); + this.selectProjectByCompanyId(event.target.dataset.id, '', '', ''); //this.selectCompanyJG(event.target.dataset.id,'SGS'); }, - onclassB(event){ - this.setData({nav2: event.target.dataset.index}); - this.setData({dataclass2: 1}); - if(this.data.dataclass2 == 1){ - this.setData({title3: true}); + onclassB(event) { + this.setData({ + nav2: event.target.dataset.index + }); + this.setData({ + dataclass2: 1 + }); + if (this.data.dataclass2 == 1) { + this.setData({ + title3: true + }); } - this.setData({classB: " / " + event.target.dataset.name }); - this.setData({overall2: event.target.dataset.name ,newCompanyId:event.target.dataset.id}); - this.setData({value3:this.data.overall1 + " / "+ event.target.dataset.name}) + this.setData({ + classB: " / " + event.target.dataset.name + }); + this.setData({ + overall2: event.target.dataset.name, + newCompanyId: event.target.dataset.id + }); + this.setData({ + value3: this.data.overall1 + " / " + event.target.dataset.name + }) //获取子公司信息 - this.selectCompanyJG(event.target.dataset.id,'GS'); + this.selectCompanyJG(event.target.dataset.id, 'GS'); }, - onclassC(event){ - this.setData({nav3: event.target.dataset.index}); - this.setData({dataclass3: 1}); - this.setData({classC: " / " + event.target.dataset.name }); - this.setData({overall3: event.target.dataset.name ,newCompanyId:event.target.dataset.id}); - this.setData({value3: this.data.overall1 + " / " + this.data.overall2 + " / " + event.target.dataset.name}); + onclassC(event) { + this.setData({ + nav3: event.target.dataset.index + }); + this.setData({ + dataclass3: 1 + }); + this.setData({ + classC: " / " + event.target.dataset.name + }); + this.setData({ + overall3: event.target.dataset.name, + newCompanyId: event.target.dataset.id + }); + this.setData({ + value3: this.data.overall1 + " / " + this.data.overall2 + " / " + event.target.dataset.name + }); }, - queren(event){ + queren(event) { //加载蒙版 - this.onClickShow(); - this.setData({ showTest: false}); - this.setData({ show3: false }); - if(this.data.overall1 == ""){ - this.setData({value3:""}); - }else if(this.data.overall2 == ""){ - this.setData({value3: this.data.overall1 + " / "}); - }else if(this.data.overall3 == ""){ - this.setData({value3: this.data.overall1 + " / " + this.data.overall2 + " / " }); - }else{ - this.setData({value3: this.data.overall1 + " / " + this.data.overall2 + " / " + this.data.overall3}); + //this.onClickShow(); + this.setData({ + showTest: false + }); + this.setData({ + show3: false + }); + if (this.data.overall1 == "") { + this.setData({ + value3: "" + }); + } else if (this.data.overall2 == "") { + this.setData({ + value3: this.data.overall1 + " / " + }); + } else if (this.data.overall3 == "") { + this.setData({ + value3: this.data.overall1 + " / " + this.data.overall2 + " / " + }); + } else { + this.setData({ + value3: this.data.overall1 + " / " + this.data.overall2 + " / " + this.data.overall3 + }); } let companyId = this.data.newCompanyId; @@ -129,133 +180,266 @@ Page({ let cityId = this.data.cityId; let areaId = this.data.areaId; - this.selectProjectByCompanyId(companyId,provinceId,cityId,areaId); - this.selectEarly(companyId,'',provinceId,cityId,areaId); - this.getEnvironCount(companyId,'',provinceId,cityId,areaId); + this.selectProjectByCompanyId(companyId, provinceId, cityId, areaId); + this.selectEarly(companyId, '', provinceId, cityId, areaId); + this.getEnvironCount(companyId, '', provinceId, cityId, areaId); }, - tabTltie(event){ + tabTltie(event) { var id = event.currentTarget.id; - if(id == 1){ - this.setData({flag1:true}) - this.setData({flag2:false}) - this.setData({flag3:false}) - this.setData({Highlight1:"active"}) - this.setData({Highlight2:""}) - this.setData({Highlight3:""}) - this.setData({title2:false}) - this.setData({title3:false}) - this.setData({classA:""}) - this.setData({classB:""}) - this.setData({classC:""}) - this.setData({nav2: "-1"}); - this.setData({nav3: "-1"}); - this.setData({overall1:"",overall2:"",overall3:""}) - }else if(id == 2){ - this.setData({flag1:false}) - this.setData({flag2:true}) - this.setData({flag3:false}) - this.setData({Highlight1:""}) - this.setData({Highlight2:"active"}) - this.setData({Highlight3:""}) - this.setData({title3:false}) - this.setData({classB:""}) - this.setData({classC:""}) - this.setData({nav3: "-1"}); - this.setData({overall2:"",overall3:""}) - }else{ - this.setData({flag1:false}) - this.setData({flag2:false}) - this.setData({flag3:true}) - this.setData({Highlight1:""}) - this.setData({Highlight2:""}) - this.setData({Highlight3:"active"}) - this.setData({overall3:""}) - this.setData({classC:""}) + if (id == 1) { + this.setData({ + flag1: true + }) + this.setData({ + flag2: false + }) + this.setData({ + flag3: false + }) + this.setData({ + Highlight1: "active" + }) + this.setData({ + Highlight2: "" + }) + this.setData({ + Highlight3: "" + }) + this.setData({ + title2: false + }) + this.setData({ + title3: false + }) + this.setData({ + classA: "" + }) + this.setData({ + classB: "" + }) + this.setData({ + classC: "" + }) + this.setData({ + nav2: "-1" + }); + this.setData({ + nav3: "-1" + }); + this.setData({ + overall1: "", + overall2: "", + overall3: "" + }) + } else if (id == 2) { + this.setData({ + flag1: false + }) + this.setData({ + flag2: true + }) + this.setData({ + flag3: false + }) + this.setData({ + Highlight1: "" + }) + this.setData({ + Highlight2: "active" + }) + this.setData({ + Highlight3: "" + }) + this.setData({ + title3: false + }) + this.setData({ + classB: "" + }) + this.setData({ + classC: "" + }) + this.setData({ + nav3: "-1" + }); + this.setData({ + overall2: "", + overall3: "" + }) + } else { + this.setData({ + flag1: false + }) + this.setData({ + flag2: false + }) + this.setData({ + flag3: true + }) + this.setData({ + Highlight1: "" + }) + this.setData({ + Highlight2: "" + }) + this.setData({ + Highlight3: "active" + }) + this.setData({ + overall3: "" + }) + this.setData({ + classC: "" + }) } }, showTest() { - if(this.data.popUp3 == false){ - this.setData({ showTest: true }); + if (this.data.popUp3 == false) { + this.setData({ + showTest: true + }); } }, onCloseTest() { - this.setData({ showTest: false }); + this.setData({ + showTest: false + }); }, - + onChangeSheng(event) { //加载蒙版 - this.onClickShow(); - var province = event.detail.value; + //this.onClickShow(); + var province = event.detail.value; this.setData({ - value1: province.text , - value2:"市/区", - value3:"公司", + value1: province.text, + value2: "市/区", + value3: "公司", company: {}, - ifDeptId:true, - provinceId:province.id, + ifDeptId: true, + provinceId: province.id, + }); + this.setData({ + flag1: true + }) + this.setData({ + flag2: false + }) + this.setData({ + flag3: false + }) + this.setData({ + Highlight1: "active" + }) + this.setData({ + Highlight2: "" + }) + this.setData({ + Highlight3: "" + }) + this.setData({ + title2: false + }) + this.setData({ + title3: false + }) + this.setData({ + classA: "" + }) + this.setData({ + classB: "" + }) + this.setData({ + classC: "" + }) + this.setData({ + nav2: "-1" + }); + this.setData({ + nav3: "-1" }); - this.setData({flag1:true}) - this.setData({flag2:false}) - this.setData({flag3:false}) - this.setData({Highlight1:"active"}) - this.setData({Highlight2:""}) - this.setData({Highlight3:""}) - this.setData({title2:false}) - this.setData({title3:false}) - this.setData({classA:""}) - this.setData({classB:""}) - this.setData({classC:""}) - this.setData({nav2: "-1"}); - this.setData({nav3: "-1"}); app.globalData.paramDeptId = province.id, - this.setData({ show1: false }); + this.setData({ + show1: false + }); this.getDeptSubordinate(province.id); - this.selectProjectByCompanyId(this.data.userInfo.deptId,province.id,'',''); - this.selectEarly(this.data.userInfo.deptId,'',province.id,'',''); - this.getEnvironCount(this.data.userInfo.deptId,'',province.id,'',''); + this.selectProjectByCompanyId(this.data.userInfo.deptId, province.id, '', ''); + this.selectEarly(this.data.userInfo.deptId, '', province.id, '', ''); + this.getEnvironCount(this.data.userInfo.deptId, '', province.id, '', ''); }, onChangeShiQu(event) { //加载蒙版 - this.onClickShow(); - var city = event.detail.value[0]; - var area = event.detail.value[1].text; - var sq = city+"/"+area - this.setData({ - value2: sq , - value3:"公司", - company:{}, - ifDeptId:true, - cityId:area == '全部'?event.detail.value[1].id:'', - areaId:area == '全部'?'':event.detail.value[1].id + //this.onClickShow(); + var city = event.detail.value[0]; + var area = event.detail.value[1].text; + var sq = city + "/" + area + this.setData({ + value2: sq, + value3: "公司", + company: {}, + ifDeptId: true, + cityId: area == '全部' ? event.detail.value[1].id : '', + areaId: area == '全部' ? '' : event.detail.value[1].id + }); + this.setData({ + flag1: true + }) + this.setData({ + flag2: false + }) + this.setData({ + flag3: false + }) + this.setData({ + Highlight1: "active" + }) + this.setData({ + Highlight2: "" + }) + this.setData({ + Highlight3: "" + }) + this.setData({ + title2: false + }) + this.setData({ + title3: false + }) + this.setData({ + classA: "" + }) + this.setData({ + classB: "" + }) + this.setData({ + classC: "" + }) + this.setData({ + nav2: "-1" + }); + this.setData({ + nav3: "-1" + }); + this.setData({ + show2: false }); - this.setData({flag1:true}) - this.setData({flag2:false}) - this.setData({flag3:false}) - this.setData({Highlight1:"active"}) - this.setData({Highlight2:""}) - this.setData({Highlight3:""}) - this.setData({title2:false}) - this.setData({title3:false}) - this.setData({classA:""}) - this.setData({classB:""}) - this.setData({classC:""}) - this.setData({nav2: "-1"}); - this.setData({nav3: "-1"}); - this.setData({ show2: false }); let deptId = this.data.userInfo.deptId; - this.selectProjectByCompanyId(deptId,'','',event.detail.value[1].id); + this.selectProjectByCompanyId(deptId, '', '', event.detail.value[1].id); //this.selectEarly(deptId,'','','',event.detail.value[1].id); //this.getEnvironCount(deptId,'','','',event.detail.value[1].id); }, onChange1(event) { - const { picker, value, index } = event.detail; + const { + picker, + value, + index + } = event.detail; picker.setColumnValues(1, this.data.citys[value[0]]); }, onChange2(event) { @@ -264,62 +448,82 @@ Page({ }, showPopup1() { - if(this.data.popUp1 == false){ - this.setData({ show1: true }); + if (this.data.popUp1 == false) { + this.setData({ + show1: true + }); } }, showPopup2() { - if(this.data.popUp2 == false){ - this.setData({ show2: true }); + if (this.data.popUp2 == false) { + this.setData({ + show2: true + }); } }, onCancel() { - this.setData({ show1: false }); - this.setData({ show2: false }); - this.setData({ show3: false }); + this.setData({ + show1: false + }); + this.setData({ + show2: false + }); + this.setData({ + show3: false + }); }, onClose() { - this.setData({ show1: false }); - this.setData({ show2: false }); - this.setData({ show3: false }); + this.setData({ + show1: false + }); + this.setData({ + show2: false + }); + this.setData({ + show3: false + }); }, onClickShow() { - this.setData({ loadShow: true }); + this.setData({ + loadShow: true + }); }, onClickHide() { - this.setData({ loadShow: false }); + this.setData({ + loadShow: false + }); }, //页面初始化 onLoad: function (option) { var that = this //加载蒙版 - that.onClickShow(); + //that.onClickShow(); //调用wx.getSystemInfo接口,然后动态绑定组件高度 wx.getSystemInfo({ - success: function (res) { - that.setData({ - height: res.windowHeight, - }) - } - }), - //获取缓存中数据 - wx.getStorage({ - key: 'userinfo', - success:function(res){ - console.log(res.data); - that.setData({ - userInfo:res.data - }) - app.globalData.deptId = res.data.deptId, - //加载用户组织架构信息 - that.getFilstDept(res.data.deptId,res.data.userId); - } - }) + success: function (res) { + that.setData({ + height: res.windowHeight, + }) + } + }), + //获取缓存中数据 + wx.getStorage({ + key: 'userinfo', + success: function (res) { + console.log(res.data); + that.setData({ + userInfo: res.data + }) + app.globalData.deptId = res.data.deptId, + //加载用户组织架构信息 + that.getFilstDept(res.data.deptId, res.data.userId); + } + }) }, /** @@ -327,81 +531,97 @@ Page({ * @param {*} deptId * @param {*} userId */ - getFilstDept:function(deptId,userId){ + getFilstDept: function (deptId, userId) { var that = this; wx.request({ - url: app.globalData.reqUrl+'/wechat/selectDeptAll', - data:{ - "deptId":deptId, - "userId":userId, - "minRoleId":that.data.userInfo?.minRoleId + url: app.globalData.reqUrl + '/wechat/selectDeptAll', + data: { + "deptId": deptId, + "userId": userId, + "minRoleId": that.data.userInfo?.minRoleId }, - method:"GET", - success:function(res){ + method: "GET", + success: function (res) { console.log(res.data); res = res.data; //判断登录是否项目人员 - if(res.data.projectId != undefined){ - var markers = [{id:0,projectId:res.data.projectId,longitude:res.data.longitude,latitude:res.data.latitude,projectName:res.data.projectName}]; - var projectData = [{projectId:res.data.projectId,projectName:res.data.projectName,projectAddress:res.data.projectAddress,companyName:res.data.companyName,streamNumber:res.data.streamNumber,projectCount:res.data.projectCount,videoNum:res.data.videoNum,towerCount:res.data.towerCount,monitoringCount:res.data.monitoringCount}] + if (res.data.projectId != undefined) { + var markers = [{ + id: 0, + projectId: res.data.projectId, + longitude: res.data.longitude, + latitude: res.data.latitude, + projectName: res.data.projectName + }]; + var projectData = [{ + projectId: res.data.projectId, + projectName: res.data.projectName, + projectAddress: res.data.projectAddress, + companyName: res.data.companyName, + streamNumber: res.data.streamNumber, + projectCount: res.data.projectCount, + videoNum: res.data.videoNum, + towerCount: res.data.towerCount, + monitoringCount: res.data.monitoringCount + }] that.setData({ - value1:res.data.shengName, - value2:res.data.shiName+'/'+res.data.quName, - value3:res.data.companyName, - markers:markers, - scale:12, - initialLon:res.data.longitude, - initialLat:res.data.latitude, - projectCount:1, - projectData:projectData, - logCompanyName:res.data.companyName, - popUp1:true, - popUp2:true, - popUp3:true, + value1: res.data.shengName, + value2: res.data.shiName + '/' + res.data.quName, + value3: res.data.companyName, + markers: markers, + scale: 12, + initialLon: res.data.longitude, + initialLat: res.data.latitude, + projectCount: 1, + projectData: projectData, + logCompanyName: res.data.companyName, + popUp1: true, + popUp2: true, + popUp3: true, }) //that.selectEarly(res.data.deptId,res.data.projectId,'','',''); //that.getEnvironCount(res.data.deptId,res.data.projectId,'','',''); - that.onClickHide(); - }else{ + //that.onClickHide(); + } else { var columns = []; columns.push(res.data.province_list); that.setData({ - value1:res.data.shengName, - value2:res.data.shiName+'/'+res.data.quName, - logCompanyName:res.data.logCompanyName, - value3:res.data.logCompanyName, - companyId:res.data.companyId, - paramPost:res.data.postId, - company:columns, - companys:columns, - jt:res.data.province_list, - popUp1:true, - popUp2:true + value1: res.data.shengName, + value2: res.data.shiName + '/' + res.data.quName, + logCompanyName: res.data.logCompanyName, + value3: res.data.logCompanyName, + companyId: res.data.companyId, + paramPost: res.data.postId, + company: columns, + companys: columns, + jt: res.data.province_list, + popUp1: true, + popUp2: true }) - if(res.data.province_list.length==1){ + if (res.data.province_list.length == 1) { that.setData({ - popUp3:true + popUp3: true }); - }else{ - if(wx.getStorageSync('select_dept_index')!="" && wx.getStorageSync('select_dept_name')!=""){ + } else { + if (wx.getStorageSync('select_dept_index') != "" && wx.getStorageSync('select_dept_name') != "") { that.setData({ - nav1:wx.getStorageSync('select_dept_index'), - value3:wx.getStorageSync('select_dept_name') + nav1: wx.getStorageSync('select_dept_index'), + value3: wx.getStorageSync('select_dept_name') }); } } //that.selectEarly(res.data.deptId,'','','',''); //that.getEnvironCount(res.data.deptId,'','','',''); - if(wx.getStorageSync('select_dept_id')==""){ - if(res.data.province_list.length==1){ - that.selectProjectByCompanyId(res.data.deptId,'','',''); - }else{ - that.selectProjectByCompanyId("0",'','',''); + if (wx.getStorageSync('select_dept_id') == "") { + if (res.data.province_list.length == 1) { + that.selectProjectByCompanyId(res.data.deptId, '', '', ''); + } else { + that.selectProjectByCompanyId("0", '', '', ''); } - }else{ - that.selectProjectByCompanyId(wx.getStorageSync('select_dept_id'),'','',''); + } else { + that.selectProjectByCompanyId(wx.getStorageSync('select_dept_id'), '', '', ''); } - that.onClickHide(); + //that.onClickHide(); } } }) @@ -411,21 +631,20 @@ Page({ * 获取市区信息 * @param {*} provinceId 省id */ - getDeptSubordinate:function(provinceId){ + getDeptSubordinate: function (provinceId) { var that = this; wx.request({ - url: app.globalData.reqUrl+'/wechat/project/selectDeptSubordinate', - data:{ - "userId":this.data.userInfo.userId, - "provinceId":provinceId, - "deptId":this.data.userInfo.deptId + url: app.globalData.reqUrl + '/wechat/project/selectDeptSubordinate', + data: { + "userId": this.data.userInfo.userId, + "provinceId": provinceId, + "deptId": this.data.userInfo.deptId }, - method:"GET", - success:function(res){ - that.onClickHide(); + method: "GET", + success: function (res) { + //that.onClickHide(); let citys = res.data; - let cityArea = [ - { + let cityArea = [{ values: Object.keys(citys), className: 'column1', }, @@ -434,10 +653,10 @@ Page({ className: 'column2', defaultIndex: 2, }, - ] + ] that.setData({ cityArea: cityArea, - citys:citys + citys: citys }) } }) @@ -450,40 +669,45 @@ Page({ * @param {*} cityId * @param {*} areaId */ - selectProjectByCompanyId:function(deptId,provinceId,cityId,areaId){ + selectProjectByCompanyId: function (deptId, provinceId, cityId, areaId) { var that = this; wx.request({ - url: app.globalData.reqUrl+'/wechat/project/selectProjectByCompanyId', - data:{ - "userId":that.data.userInfo.userId, - "deptId":deptId, - "provinceId":provinceId, - "cityId":cityId, - "areaId":areaId, - "minRoleId":that.data.userInfo.minRoleId + url: app.globalData.reqUrl + '/wechat/project/selectProjectByCompanyId', + data: { + "userId": that.data.userInfo.userId, + "deptId": deptId, + "provinceId": provinceId, + "cityId": cityId, + "areaId": areaId, + "minRoleId": that.data.userInfo.minRoleId }, - method:"GET", - success:function(res){ + method: "GET", + success: function (res) { //关闭蒙版 - that.onClickHide(); - if(res.data.length >0){ + //that.onClickHide(); + if (res.data.length > 0) { that.setData({ - markers:res.data, - projectCount:res.data.length, - projectData:res.data, - scale:12, - initialLon:res.data[0].longitude, - initialLat:res.data[0].latitude, + markers: res.data, + projectCount: res.data.length, + projectData: res.data, + scale: 12, + initialLon: res.data[0].longitude, + initialLat: res.data[0].latitude, }) - app.globalData.projectInfoList = res.data; - }else{ + //存入文件中 + wx.setStorage({ + key: 'projectInfoList', + data: res.data + }); + app.globalData.projectInfoList = res.data; + } else { that.setData({ - markers:res.data, - projectCount:res.data.length, - projectData:res.data, - scale:12, - }) - } + markers: res.data, + projectCount: res.data.length, + projectData: res.data, + scale: 12, + }) + } } }) }, @@ -493,25 +717,25 @@ Page({ * @param {*} deptId * @param {*} state */ - selectCompanyJG:function(deptId,state){ + selectCompanyJG: function (deptId, state) { var that = this; wx.request({ - url: app.globalData.reqUrl+'/wechat/project/selectCompanyJG', - data:{ - "deptId":deptId + url: app.globalData.reqUrl + '/wechat/project/selectCompanyJG', + data: { + "deptId": deptId }, - method:"GET", - success:function(res){ - that.onClickHide(); - if(state == "SGS"){ + method: "GET", + success: function (res) { + //that.onClickHide(); + if (state == "SGS") { that.setData({ - shengGs:res.data + shengGs: res.data }) - }else{ + } else { that.setData({ - ziGs:res.data + ziGs: res.data }) - } + } } }) }, @@ -524,27 +748,27 @@ Page({ * @param {*} cityId * @param {*} areaId */ - selectEarly:function(deptId,projectId,provinceId,cityId,areaId){ - var that = this; - wx.request({ - url: app.globalData.reqUrl+'/weixin/applets/selectYangchenCount', - method:"GET", - data:{ - "deptId":deptId, - "projectId":projectId, - "provinceId":provinceId, - "cityId":cityId, - "areaId":areaId, - }, - success:function(res){ - that.onClickHide(); - that.setData({ - monitoringCount:res.data.monitoringCount, - videoNum:res.data.videoNum, - mechanicsNum:res.data.machineEnvirCount - }) - } - }) + selectEarly: function (deptId, projectId, provinceId, cityId, areaId) { + var that = this; + wx.request({ + url: app.globalData.reqUrl + '/weixin/applets/selectYangchenCount', + method: "GET", + data: { + "deptId": deptId, + "projectId": projectId, + "provinceId": provinceId, + "cityId": cityId, + "areaId": areaId, + }, + success: function (res) { + //that.onClickHide(); + that.setData({ + monitoringCount: res.data.monitoringCount, + videoNum: res.data.videoNum, + mechanicsNum: res.data.machineEnvirCount + }) + } + }) }, /** @@ -555,23 +779,23 @@ Page({ * @param {*} cityId * @param {*} areaId */ - getEnvironCount:function(deptId,projectId,provinceId,cityId,areaId){ + getEnvironCount: function (deptId, projectId, provinceId, cityId, areaId) { var that = this; wx.request({ - url: app.globalData.reqUrl+'/weixin/applets/getEnvironCount', - method:'GET', - data:{ - "deptId":deptId, - "projectId":projectId, - "provinceId":provinceId, - "cityId":cityId, - "areaId":areaId, + url: app.globalData.reqUrl + '/weixin/applets/getEnvironCount', + method: 'GET', + data: { + "deptId": deptId, + "projectId": projectId, + "provinceId": provinceId, + "cityId": cityId, + "areaId": areaId, }, - success:function(res){ - that.onClickHide(); + success: function (res) { + //that.onClickHide(); that.setData({ - environProjectData:res.data, - environCount:res.data.length + environProjectData: res.data, + environCount: res.data.length }) } }) @@ -580,38 +804,38 @@ Page({ /** * 个人定位点 */ - selectUserLocation:function(){ + selectUserLocation: function () { let markers = this.data.markers; markers.push(app.globalData.markers[0]); this.setData({ - scale:5, - initialLon:app.globalData.initialLon, - initialLat:app.globalData.latitude, - markers:markers, + scale: 5, + initialLon: app.globalData.initialLon, + initialLat: app.globalData.latitude, + markers: markers, }) }, //点击项目点跳转到项目概况页面 - getProjectListById:function(even){ - if(even.markerId != '-1'){ - var projectData= this.data.projectData; + getProjectListById: function (even) { + if (even.markerId != '-1') { + var projectData = this.data.projectData; var value1 = ""; - if(this.data.value1 != ""){ + if (this.data.value1 != "") { value1 = this.data.value1; - }else{ + } else { value1 = '省'; } var value2 = ""; - if(this.data.value2 != ""){ + if (this.data.value2 != "") { value2 = this.data.value2; - }else{ + } else { value2 = '市/区'; } var value3 = ""; - if(this.data.value3 != ""){ - value3= this.data.value3; - }else{ + if (this.data.value3 != "") { + value3 = this.data.value3; + } else { value3 = '公司'; } //赋值到公共参数 @@ -625,30 +849,30 @@ Page({ wx.redirectTo({ url: '../xiangmugaikuang/index' }) - }else{ + } else { app.toast("本定位点为个人定位"); } }, //查看项目详情 - checkDetailsSY:function(even){ - var projectData= this.data.projectData; + checkDetailsSY: function (even) { + var projectData = this.data.projectData; var value1 = ""; - if(this.data.value1 != ""){ + if (this.data.value1 != "") { value1 = this.data.value1; - }else{ + } else { value1 = '省'; } var value2 = ""; - if(this.data.value2 != ""){ + if (this.data.value2 != "") { value2 = this.data.value2; - }else{ + } else { value2 = '市/区'; } var value3 = ""; - if(this.data.value3 != ""){ - value3= this.data.value3; - }else{ + if (this.data.value3 != "") { + value3 = this.data.value3; + } else { value3 = '公司'; } //添加数据到app.js文件固定参数 @@ -663,24 +887,24 @@ Page({ }, //查看预警详情 - checkDetailsYJ:function(even){ + checkDetailsYJ: function (even) { var environProjectData = this.data.environProjectData; var value1 = ""; - if(this.data.value1 != ""){ + if (this.data.value1 != "") { value1 = this.data.value1; - }else{ + } else { value1 = '省'; } var value2 = ""; - if(this.data.value2 != ""){ + if (this.data.value2 != "") { value2 = this.data.value2; - }else{ + } else { value2 = '市/区'; } var value3 = ""; - if(this.data.value3 != ""){ - value3= this.data.value3; - }else{ + if (this.data.value3 != "") { + value3 = this.data.value3; + } else { value3 = '公司'; } //添加数据到app.js文件固定参数 @@ -694,4 +918,4 @@ Page({ }) }, -}) +}) \ No newline at end of file diff --git a/miniprogram/pages/project_approve/approveCheckDetection/index.js b/miniprogram/pages/project_approve/approveCheckDetection/index.js index 075e88f..64bb2e7 100644 --- a/miniprogram/pages/project_approve/approveCheckDetection/index.js +++ b/miniprogram/pages/project_approve/approveCheckDetection/index.js @@ -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] }) }, diff --git a/miniprogram/pages/project_approve/approveMaterialSeal/index.js b/miniprogram/pages/project_approve/approveMaterialSeal/index.js index ce3523c..d3e7750 100644 --- a/miniprogram/pages/project_approve/approveMaterialSeal/index.js +++ b/miniprogram/pages/project_approve/approveMaterialSeal/index.js @@ -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] }) }, diff --git a/miniprogram/pages/project_flowable/await/index.js b/miniprogram/pages/project_flowable/await/index.js index 0fed09e..3382c29 100644 --- a/miniprogram/pages/project_flowable/await/index.js +++ b/miniprogram/pages/project_flowable/await/index.js @@ -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, } ], }, diff --git a/miniprogram/pages/project_flowable/editTask/index.js b/miniprogram/pages/project_flowable/editTask/index.js index 21ff18d..3d594b0 100644 --- a/miniprogram/pages/project_flowable/editTask/index.js +++ b/miniprogram/pages/project_flowable/editTask/index.js @@ -29,7 +29,6 @@ Page({ taskName:"", passState:true, backName:"", - filesData:[], ret:"", remark:"", filesData:[], diff --git a/miniprogram/pages/wx-auth/index.js b/miniprogram/pages/wx-auth/index.js new file mode 100644 index 0000000..ce4b7eb --- /dev/null +++ b/miniprogram/pages/wx-auth/index.js @@ -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() { + + } +}) \ No newline at end of file diff --git a/miniprogram/pages/wx-auth/index.json b/miniprogram/pages/wx-auth/index.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/miniprogram/pages/wx-auth/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/pages/wx-auth/index.wxml b/miniprogram/pages/wx-auth/index.wxml new file mode 100644 index 0000000..c230278 --- /dev/null +++ b/miniprogram/pages/wx-auth/index.wxml @@ -0,0 +1,2 @@ + + diff --git a/miniprogram/pages/wx-auth/index.wxss b/miniprogram/pages/wx-auth/index.wxss new file mode 100644 index 0000000..6bb3b58 --- /dev/null +++ b/miniprogram/pages/wx-auth/index.wxss @@ -0,0 +1 @@ +/* pages/wx-auth/index.wxss */ \ No newline at end of file diff --git a/miniprogram/pages/xiangmugaikuang/index.wxml b/miniprogram/pages/xiangmugaikuang/index.wxml index efc01c1..6e67958 100644 --- a/miniprogram/pages/xiangmugaikuang/index.wxml +++ b/miniprogram/pages/xiangmugaikuang/index.wxml @@ -21,9 +21,6 @@ - - -