diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 9b0d791..4ccd172 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -13,7 +13,7 @@ "type" : "uniCloud" }, { - "playground" : "standard", + "playground" : "custom", "type" : "uni-app:app-android" } ] diff --git a/pages.json b/pages.json index 90ba57b..e9a281b 100644 --- a/pages.json +++ b/pages.json @@ -254,7 +254,8 @@ "style": { "navigationStyle": "custom" } - },{ + }, + { //首页二级跳转页面 -- 人员列表 "path": "pages/realName/index/pages/personList", "style": { @@ -267,6 +268,13 @@ "navigationStyle": "custom" } }, + { + //首页三级级跳转页面 -- 人员信息 + "path": "pages/realName/index/pages/personDetail", + "style": { + "navigationStyle": "custom" + } + }, { //工作台 "path": "pages/realName/workbench/index", diff --git a/pages/realName/index/components/bar-charts-model.vue b/pages/realName/index/components/bar-charts-model.vue index 6509fab..db0e866 100644 --- a/pages/realName/index/components/bar-charts-model.vue +++ b/pages/realName/index/components/bar-charts-model.vue @@ -1,6 +1,6 @@ @@ -150,7 +150,7 @@ export default { categories: ['基建线路', '基建变电', '生产线路', '生成变电', '配网', '其他'], series: [ { - name: '目标值', + name: '', data: [constructionLine, infrastructureSubstation, productionLine, productionSubstation, network, other] } ] @@ -158,6 +158,13 @@ export default { this.chartData = JSON.parse(JSON.stringify(data)) }, 500) }) + }, + handleChartClick(index) { + // console.log('index', index) + const currentIndex = index.currentIndex.index // 获取当前点击的图表索引 + const currenName = this.chartData.categories[currentIndex] + console.log('currenName选中的工程类型', currenName) + uni.navigateTo({ url: `/pages/realName/index/pages/project?xxx=${currenName}` }) } } } diff --git a/pages/realName/index/components/pie-charts-model-ring-two.vue b/pages/realName/index/components/pie-charts-model-ring-two.vue index 50ce55a..58dac3e 100644 --- a/pages/realName/index/components/pie-charts-model-ring-two.vue +++ b/pages/realName/index/components/pie-charts-model-ring-two.vue @@ -1,6 +1,6 @@ @@ -145,6 +145,13 @@ export default { this.chartData = JSON.parse(JSON.stringify(data)) }, 500) }) + }, + handleChartClick(index) { + const { currentIndex } = index // 获取当前点击的图表索引 + const chartsData = this.chartData.series[0].data + const currenRows = chartsData[currentIndex] + console.log('currenRows选中的工种类型', currenRows.name) + uni.navigateTo({ url: `/pages/realName/index/pages/personList?xxx=${currenRows.name}` }) } } } diff --git a/pages/realName/index/components/pie-charts-model-ring.vue b/pages/realName/index/components/pie-charts-model-ring.vue index fa11c90..fdfa327 100644 --- a/pages/realName/index/components/pie-charts-model-ring.vue +++ b/pages/realName/index/components/pie-charts-model-ring.vue @@ -1,6 +1,6 @@ @@ -145,6 +145,13 @@ export default { this.chartData = JSON.parse(JSON.stringify(data)) }, 500) }) + }, + handleChartClick(index) { + const { currentIndex } = index // 获取当前点击的图表索引 + const chartsData = this.chartData.series[0].data + const currenRows = chartsData[currentIndex] + console.log('currenRows选中的人员类型(这个应该时年龄范围)', currenRows.name) + uni.navigateTo({ url: `/pages/realName/index/pages/personList?xxx=${currenRows.name}` }) } } } diff --git a/pages/realName/index/components/pie-charts-model.vue b/pages/realName/index/components/pie-charts-model.vue index 32b37f3..bf8f631 100644 --- a/pages/realName/index/components/pie-charts-model.vue +++ b/pages/realName/index/components/pie-charts-model.vue @@ -1,6 +1,6 @@ @@ -133,6 +133,13 @@ export default { this.chartData = JSON.parse(JSON.stringify(data)) }, 500) }) + }, + handleChartClick(index) { + const { currentIndex } = index // 获取当前点击的图表索引 + const chartsData = this.chartData.series[0].data + const currenRows = chartsData[currentIndex] + console.log('currenRows选中的工程类型', currenRows.name) + uni.navigateTo({ url: `/pages/realName/index/pages/project?xxx=${currenRows.name}` }) } } } diff --git a/pages/realName/index/index.vue b/pages/realName/index/index.vue index 26bfd5f..347f60b 100644 --- a/pages/realName/index/index.vue +++ b/pages/realName/index/index.vue @@ -127,7 +127,7 @@

人员考勤率

- + {{ item.progress_title }} {{ item.progress_proportion }}% @@ -146,7 +146,7 @@

工程概况

- + {{ item.project_title }} {{ item.project_num }} @@ -172,17 +172,17 @@

在场人员概况

- + {{ ((greenNum / colorAmount) * 100).toFixed(2) }}% {{ greenNum }} - + {{ ((yellowNum / colorAmount) * 100).toFixed(2) }}% {{ yellowNum }} - + {{ ((redNum / colorAmount) * 100).toFixed(2) }}% {{ redNum }} @@ -196,10 +196,18 @@ 男({{ maleNum }}) - + - + {{ ((femaleNum / sexAmount) * 100).toFixed(2) }}% 女({{ femaleNum }}) @@ -210,7 +218,7 @@
固定、临时人员
- + {{ formalPersonNum }} - + - - - - - - - - 选择工程 - - - - {{item.abbreviation}} - - - + + + + + + + 选择工程 + + + + + + {{ item.abbreviation }} + + + + @@ -293,10 +319,10 @@ export default { return { userId: uni.getStorageSync('userId'), tabbar: TabbarConfig, - type:uni.getStorageSync('realNameUser').type, - subId:uni.getStorageSync('realNameUser').subId, - showPopup:false, - proList:[], + type: uni.getStorageSync('realNameUser').type, + subId: uni.getStorageSync('realNameUser').subId, + showPopup: false, + proList: [], msgList: [], dataOverviewList: [ { @@ -427,7 +453,9 @@ export default { maleNum: 0, femaleNum: 0, - sexAmount: 0 + sexAmount: 0, + + colorAmount: 0 // planProNum: 0, // redPersonNum: 0, @@ -444,17 +472,19 @@ export default { console.log('?? ~ mounted ~ mounted-index:') this.getLogin() this.getHomePageListData() - if(this.type.indexOf("4")>-1){//监督端 - this.getPro() - } + if (this.type.indexOf('4') > -1) { + //监督端 + this.getPro() + } }, onShow() { - if(this.type.indexOf("4")>-1){ //监督端 - let hasChosenPro=uni.getStorageSync('hasChosenPro') - if(!hasChosenPro){ - this.showPopup=true - } - } + if (this.type.indexOf('4') > -1) { + //监督端 + let hasChosenPro = uni.getStorageSync('hasChosenPro') + if (!hasChosenPro) { + this.showPopup = true + } + } }, methods: { getLogin() { @@ -495,57 +525,57 @@ export default { } }) }, - - //监督端获取工程列表 - getPro(){ - let param={ - id:-1, - subId:this.subId - } - console.log(param) - uni.request({ - url: config.realAppUrl + '/offLine/getPro', - method: 'post', - data: param, - header: { - 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: uni.getStorageSync('realNameToken') - }, - success: res => { - console.log(res) - res = res.data; - if(res.code==200){ - this.proList = res.data; - } - }, - fail: err => { - console.log(err) - } - }) - }, - //展示工程选择弹窗 - leftClick() { - console.log('返回') - if(this.type.indexOf("4")>-1){ - this.showPopup=true; - } + + //监督端获取工程列表 + getPro() { + let param = { + id: -1, + subId: this.subId + } + console.log(param) + uni.request({ + url: config.realAppUrl + '/offLine/getPro', + method: 'post', + data: param, + header: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: uni.getStorageSync('realNameToken') + }, + success: res => { + console.log(res) + res = res.data + if (res.code == 200) { + this.proList = res.data + } + }, + fail: err => { + console.log(err) + } + }) + }, + //展示工程选择弹窗 + leftClick() { + console.log('返回') + if (this.type.indexOf('4') > -1) { + this.showPopup = true + } + }, + //选择工程 + chosenPro(item) { + let obj = uni.getStorageSync('realNameUser') + obj.proId = item.id + uni.setStorageSync('realNameUser', obj) + uni.setStorageSync('hasChosenPro', '1') + this.showPopup = false + }, + closePopup() { + this.showPopup = false + }, + openFaceScan() { + face.open(['a', 'c'], function (e) { + face.close() + }) }, - //选择工程 - chosenPro(item){ - let obj = uni.getStorageSync('realNameUser') - obj.proId=item.id - uni.setStorageSync('realNameUser', obj) - uni.setStorageSync('hasChosenPro', "1") - this.showPopup=false; - }, - closePopup() { - this.showPopup=false; - }, - openFaceScan() { - face.open(['a', 'c'], function (e) { - face.close() - }) - }, /* 获取首页数据 */ async getHomePageListData() { @@ -643,30 +673,111 @@ export default { uni.navigateTo({ url: '/pages/realName/workPlan/index' }) }, - //数据概览跳转 - godataView(item) { - console.log(item) - if(item.data_title=='在建工程'){ - uni.navigateTo({ url: '/pages/realName/index/pages/project' }) - } - if(item.data_title=='在用分包单位'){ - uni.navigateTo({ url: '/pages/realName/index/pages/subList' }) - } - if(item.data_title=='在用班组'){ - uni.navigateTo({ url: '/pages/realName/index/pages/teamList' }) - } - if(item.data_title=='在场人数'){ - uni.navigateTo({ url: '/pages/realName/index/pages/personList' }) - } - if(item.data_title=='日计划打卡数'){ - uni.navigateTo({ url: '/pages/realName/index/pages/personList?isAtt=0&isPlanWorker=1' }) - } - if(item.data_title=='今日打卡'){ - uni.navigateTo({ url: '/pages/realName/index/pages/personList?isAtt=0' }) - } - - }, - }, + //数据概览跳转 + godataView(item) { + console.log(item) + if(item.data_title=='在建工程'){ + uni.navigateTo({ url: '/pages/realName/index/pages/project' }) + } + if(item.data_title=='在用分包单位'){ + uni.navigateTo({ url: '/pages/realName/index/pages/subList' }) + } + if(item.data_title=='在用班组'){ + uni.navigateTo({ url: '/pages/realName/index/pages/teamList' }) + } + if(item.data_title=='在场人数'){ + uni.navigateTo({ url: '/pages/realName/index/pages/personList' }) + } + if(item.data_title=='日计划打卡数'){ + uni.navigateTo({ url: '/pages/realName/index/pages/personList?isAtt=0&isPlanWorker=1' }) + } + if(item.data_title=='今日打卡'){ + uni.navigateTo({ url: '/pages/realName/index/pages/personList?isAtt=0' }) + } + + }, + /* 人员考勤等跳转 */ + onJumpPersonList(title) { + let params = '' + // 跳转人员列表 + switch (title) { + case '在场考勤率': + params = '在场考勤率' + break + case '作业考勤率': + params = '作业考勤率' + break + case '在场人员(固定)': + params = '在场人员(固定)' + break + case '在场人员(临时)': + params = '在场人员(临时)' + break + case '考勤率(固定人员)': + params = '考勤率(固定人员)' + break + case '考勤率(临时人员)': + params = '考勤率(临时人员)' + break + } + + console.log('params路由参数考勤固定等··', params) + uni.navigateTo({ url: `/pages/realName/index/pages/personList?xxx=${params}` }) + }, + /* 工程概况跳转 */ + onJumpProjectList(title) { + let params = '' + // 跳转人员列表 + switch (title) { + case '在建': + params = '在建' + break + case '筹建': + params = '筹建' + break + case '停工': + params = '停工' + break + case '完工': + params = '完工' + break + } + + console.log('params路由参数工程概况', params) + uni.navigateTo({ url: `/pages/realName/index/pages/project?xxx=${params}` }) + }, + /* 在场人员概况跳转人员信息 */ + onJumpColorLight(type) { + let params = '' + // 跳转人员列表 + switch (type) { + case 1: + params = '绿灯' + break + case 2: + params = '黄灯' + break + case 3: + params = '红灯' + break + case 4: + params = '男性' + break + case 5: + params = '女性' + break + case 6: + params = '固定人员' + break + case 7: + params = '临时人员' + break + } + + console.log('params路由参数红黄灯以及性别··和固定、临时', params) + uni.navigateTo({ url: `/pages/realName/index/pages/personList?xxx=${params}` }) + } + } } diff --git a/pages/realName/workPlan-details/index.vue b/pages/realName/workPlan-details/index.vue index 25d4740..1f7485a 100644 --- a/pages/realName/workPlan-details/index.vue +++ b/pages/realName/workPlan-details/index.vue @@ -24,7 +24,9 @@ - + @@ -53,7 +55,14 @@ - {{ item.name }} + + {{ item.name }} + @@ -62,10 +71,10 @@ {{ item.certificateName }}({{ item.certificateNum }}) @@ -79,9 +88,61 @@ - 站班会照片 + + + + + {{ item.times }} + + + + + + + 持证信息 + + + + + + + + + 持证名称 + 持证人姓名 + 工种 + + + + + + {{ item.certificateName }} + {{ item.name }} + {{ item.gz }} + + + + + @@ -99,14 +160,45 @@ export default { todayWorkList: [], // 今日计划 workPersonList: [], // 作业人员 holdCardList: [], // 持证信息 - standGuardList: [], // 站班信息 + holdCardTitle: '', + holdCardDetailsList: [], // 持证信息详情 + standGuardList: [ + { img_src: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg', times: '9:20:06' }, + { img_src: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', times: '9:20:06' } + ], // 站班信息 contentId: '', + loading: false, commonParams: { proName: '', day: this.$moment().format('YYYY-MM-DD') } } }, + computed: { + getItemClass() { + return index => { + const styleIndex = index % 3 + switch (styleIndex) { + case 0: + return 'blue-border' + case 1: + return 'orange-border' + case 2: + return 'green-border' + } + } + }, + getPersonStyle() { + return item => { + const { kqState, userState } = item + + if (userState == 1 && kqState == 1) return 'style_1' // 固定人员 打卡 + if (userState == 1 && kqState != 1) return 'style_2' // 固定人员 未打卡 + if (userState != 1 && kqState == 1) return 'style_3' // 临时人员 打卡 + if (userState != 1 && kqState != 1) return 'style_4' // 临时人员 未打卡 + } + } + }, methods: { leftClick() { uni.navigateTo({ url: '/pages/realName/workPlan/index' }) @@ -126,6 +218,7 @@ export default { const response = await getStandGuardImgApi(params) this.workPersonList = res.data + console.log('人员信息---', res.data) this.holdCardList = res.datac this.standGuardList = response.data }, @@ -135,10 +228,43 @@ export default { this.getWorkPersonnelData() }, /* 查询持证信息 */ - async onQueryCardDetails(name) { - const params = Object.assign(this.commonParams, { certificateName: name }) + async onQueryCardDetails(item) { + this.holdCardTitle = `${item.certificateName}(${item.certificateNum})` + this.$refs.popup.open() + const params = Object.assign(this.commonParams, { certificateName: item.certificateName }) + uni.showLoading({ + title: '数据加载中' + }) const res = await getHoldCardInfoApi(params) - console.log('resresres持证信息详情--', res) + uni.hideLoading() + // console.log('resresres持证信息详情--', res) + this.holdCardDetailsList = res.data + }, + /* 关闭持证信息弹框 */ + onClosePopup() { + uni.hideLoading() + this.$refs.popup.close() + }, + /* 持证详情列表点击事件 */ + onClickTableTr(id) { + // 跳转人员信息页面 + uni.navigateTo({ url: `/pages/realName/index/pages/personDetail?idNumber=${id}` }) + }, + /* 全部人员按钮 */ + onSearchAllPerson() { + this.contentId = '' + this.getWorkPersonnelData() + }, + /* 预览图片 */ + onPreviewImage(index) { + uni.previewImage({ + urls: [ + 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg', + 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg' + ], + current: index, + loop: true + }) } }, onLoad(options) { @@ -177,11 +303,27 @@ export default { view { width: 18%; margin: 12rpx 0 12rpx calc(10% / 4); + box-sizing: border-box; color: #fff; text-align: center; border-radius: 12rpx; + // background-color: #3f9dfd; + } + + .style_1 { background-color: #3f9dfd; } + .style_2 { + border: 1px solid #3f9dfd; + color: #000; + } + .style_3 { + background-color: #fb1515; + } + .style_4 { + border: 1px solid #fb1515; + color: #000; + } } .work-person view:nth-child(5n + 1) { @@ -221,4 +363,81 @@ export default { .person-card view:nth-child(3n + 1) { margin-left: 0; } + +.popup-center { + width: 90vw; + height: 50vh; + background-color: #fff; + overflow: hidden; + .popup-title { + position: relative; + background-color: #3f9dfd; + height: 100rpx; + line-height: 100rpx; + text-align: center; + color: #fff; + font-size: 38rpx; + + .close-icon { + position: absolute; + right: 30rpx; + top: 0; + } + } + + .scroll-container { + width: 100%; + height: calc(100% - 100rpx); + } + + .table-th { + display: flex; + view { + padding: 5rpx 0; + flex: 1; + text-align: center; + font-size: 32rpx; + font-weight: bold; + } + } + + .table-tr { + padding: 8rpx 0; + display: flex; + border-bottom: 1px solid #ccc; + view { + padding: 5rpx 0; + flex: 1; + font-size: 30rpx; + text-align: center; + } + } + + .table-tr view:first-child { + text-align: left; + } +} + +.img-container { + width: 100%; + display: flex; + flex-wrap: wrap; + + view { + width: 31%; + margin: 12rpx 0 12rpx calc(6% / 2); + display: flex; + flex-direction: column; + align-items: center; + + .image-content { + width: 100%; + height: 160rpx; + } + } +} + +.img-container view:nth-child(3n + 1) { + margin-left: 0; +} diff --git a/pages/realName/workPlan/index.vue b/pages/realName/workPlan/index.vue index 1f213f5..bdf3440 100644 --- a/pages/realName/workPlan/index.vue +++ b/pages/realName/workPlan/index.vue @@ -26,12 +26,7 @@ - + {{ index + 1 }} {{ item.proName }} @@ -42,16 +37,17 @@ :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }" > - + {{ item.subComName }} - 可接受风险:{{ item.kjsfx }} - 低风险:{{ item.dfx }} - 中风险:{{ item.zfx }} - 高风险:{{ item.gfx }} + 可接受风险:{{ item.kjsfx }} + 低风险:{{ item.dfx }} + 中风险:{{ item.zfx }} + 高风险:{{ item.gfx }} + 特高风险:{{ item.tgfx }} - + 作业人数 {{ item.personNum }} @@ -118,7 +114,6 @@ export default { methods: { /* 获取作业计划列表 */ async getWorkPlantData() { - console.log('this.queryParams参数', this.queryParams) uni.request({ url: config.loginBaseUrl + '/bmw/homeSubPage/getAppDayPlanMsg', method: 'POST', @@ -128,9 +123,10 @@ export default { // token: this.token }, success: res => { - console.log('res****', res) this.recordsTotal = res.data.recordsTotal this.companyInfoList = res.data.data + + console.log('resssss作业计划列表信息', res) }, fail: err => {} }) @@ -193,6 +189,7 @@ export default { success: res => { if (res.data.code === 200) { uni.showToast({ icon: 'none', title: ` ${row.isCollect == 0 ? '收藏成功' : '已取消收藏'}` }) + this.getWorkPlantData() } }, fail: err => {}