From 4db146875b54cd7f66606fab83a13f7c1f37aa52 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 4 Nov 2024 18:47:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=B7=B3=E8=BD=AC=E7=AD=89?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AE=8C=E5=96=84=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/workPlan/workPlan.js | 52 +++++++ pages/workPlan/index/components/calendar.vue | 33 ++-- .../index/components/home-notice-bar.vue | 1 + pages/workPlan/workPlan-details/index.vue | 141 +++++++++++++++++- pages/workPlan/workPlan/index.vue | 110 ++++++++------ 5 files changed, 277 insertions(+), 60 deletions(-) create mode 100644 api/workPlan/workPlan.js diff --git a/api/workPlan/workPlan.js b/api/workPlan/workPlan.js new file mode 100644 index 0000000..7b0b71d --- /dev/null +++ b/api/workPlan/workPlan.js @@ -0,0 +1,52 @@ +import request_yn from '@/utils/request_new_yn' // 测试环境 19191 +import request_yn_new from '@/utils/request_new_yn_home' // 测试环境 1918 + +/* 获取作业计划列表 */ +export function getWorkPlanListApi(data) { + return request_yn_new({ + url: '/ynPlan/home/getProFxByDayKq', + method: 'post', + data: data + }) +} +/* 作业计划列表 -- 收藏 */ +export function setInfoDaySetProApi(data) { + return request_yn({ + url: '/ynPlanApp/infDay/setPro', + method: 'post', + data: data + }) +} + +// 首页二级页面--作业计划详情-作业计划列表 +export function getWorkPlanDetailsApi(data) { + return request_yn_new({ + url: '/ynPlan/home/getjhxxq', + method: 'post', + data + }) +} +// 首页二级页面--作业计划详情-作业人员及持证信息 +export function getWorkPersonnelApi(data) { + return request_yn_new({ + url: '/ynPlan/home/getDayUser', + method: 'post', + data + }) +} +// 首页二级页面--作业计划详情-作业票、站班会照片 +export function getStandGuardImgApi(data) { + return request_yn_new({ + url: '/ynPlan/home/getZbhPhotos', + method: 'post', + data + }) +} +// 首页二级页面--作业计划详情-持证信息详情 +export function getHoldCardInfoApi(data) { + return request_yn_new({ + url: '/ynPlan/home/getDayUserCZ', + method: 'post', + data + }) +} diff --git a/pages/workPlan/index/components/calendar.vue b/pages/workPlan/index/components/calendar.vue index 2da00ef..45eaa34 100644 --- a/pages/workPlan/index/components/calendar.vue +++ b/pages/workPlan/index/components/calendar.vue @@ -88,16 +88,16 @@ 作业人数 {{ currentWeekDay }} - {{ currentDays }} + {{ currentDayInfo.day.slice(5) ? currentDayInfo.day.slice(5) : currentDays }} {{ currentDayInfo.proName || '' }} - - {{ currentDayInfo.rys || '' }} + + {{ currentDayInfo.rys || '' }} - + 可接受:{{ currentDayInfo.kjsfx }} 低:{{ currentDayInfo.dfx }} 中:{{ currentDayInfo.zfx }} @@ -167,7 +167,8 @@ export default { currentQueryDay: this.$moment().format('YYYY-MM'), currentPramsWeekDay: '', currentDayInfo: { - proName: '' + proName: '', + day: '' } } }, @@ -262,6 +263,7 @@ export default { this.currentDay = this.$moment(this.currentDay).subtract(1, 'days').format('YYYY-MM-DD') this.currentDays = this.$moment(this.currentDays).subtract(1, 'days').format('MM-DD') } + this.getProFxByDayFun() }, changeWeek(delta) { if (delta > 0) { @@ -381,10 +383,16 @@ export default { if (res.data.length > 0) { this.currentDayInfo = res.data[0] console.log('----------当日数据', res) + } else { + this.currentDayInfo = { + proName: '', + day: '' + } } }, - onViewPersonDetails(id) { - uni.navigateTo({ url: `/pages/realName/index/pages/personDetail?idNumber=${id}` }) + onViewPersonDetails(info) { + console.log('跳转前参数', info) + uni.navigateTo({ url: `/pages/workPlan/workPlan-details/index?query=${JSON.stringify(info)}` }) } } } @@ -603,6 +611,7 @@ export default { view { width: 33.33%; + height: 100%; display: flex; flex-direction: column; // align-items: center; @@ -615,12 +624,18 @@ export default { } } +.day-th { + height: 68rpx; + // background-color: orange; +} + .day-td { - // height: 180rpx; + height: 300rpx; + border-bottom: 1px solid #ccc; view { height: 100%; - padding: 30rpx 0; + // padding: 30rpx 0; } } diff --git a/pages/workPlan/index/components/home-notice-bar.vue b/pages/workPlan/index/components/home-notice-bar.vue index 0172825..ea25fb7 100644 --- a/pages/workPlan/index/components/home-notice-bar.vue +++ b/pages/workPlan/index/components/home-notice-bar.vue @@ -78,6 +78,7 @@ export default { }, onViewRiskDetails() { uni.navigateTo({ url: '/pages/workPlan/workPlan/index' }) + // uni.navigateTo({ url: `/pages/workPlan/workPlan/index?day=${this.$moment().format('YYYY-MM-DD')}` }) } }, mounted() { diff --git a/pages/workPlan/workPlan-details/index.vue b/pages/workPlan/workPlan-details/index.vue index 6fd11b0..69b266b 100644 --- a/pages/workPlan/workPlan-details/index.vue +++ b/pages/workPlan/workPlan-details/index.vue @@ -36,11 +36,11 @@ 作业人员 - {{ item.rys }} + {{ item.rys }} 风险等级 - {{ item.fxdj }} + {{ item.fxdj }} 执行情况 {{ item.state }} @@ -53,6 +53,16 @@ + + + + + 颜色标识意义 + + + 张三 + 蓝框白底: + 未打卡的固定人员; + + + 张三 + 红框白底: + 未打卡的临时人员; + + + 张三 + 蓝框蓝底: + 已打卡的固定人员; + + + 张三 + 红框红底: + 已打卡的临时人员; + + + 确定 + + @@ -157,7 +196,7 @@ import { getWorkPersonnelApi, getStandGuardImgApi, getHoldCardInfoApi -} from '../../../api/phaseTwo/homePage' +} from '../../../api/workPlan/workPlan' import config from '@/config' export default { data() { @@ -177,7 +216,7 @@ export default { loading: false, commonParams: { proName: '', - day: this.$moment().format('YYYY-MM-DD') + day: '' } } }, @@ -195,6 +234,7 @@ export default { } } }, + getPersonStyle() { return item => { const { kqState, userState } = item @@ -204,6 +244,14 @@ export default { if (userState != 1 && kqState == 1) return 'style_3' // 临时人员 打卡 if (userState != 1 && kqState != 1) return 'style_4' // 临时人员 未打卡 } + }, + setStyle() { + return item => { + const { fxdj } = item + if (fxdj == '可接受风险' || fxdj == '低风险') return 'color_1' + if (fxdj == '中风险') return 'color_2' + if (fxdj == '高风险' || fxdj == '特高风险') return 'color_3' + } } }, methods: { @@ -213,6 +261,7 @@ export default { /* 获取今日作业计划 */ async getTodayWorkPlan() { const res = await getWorkPlanDetailsApi(this.commonParams) + console.log('现场负责人数据', res) this.todayWorkList = res.data }, /* 获取人员信息 */ @@ -224,8 +273,14 @@ export default { const res = await getWorkPersonnelApi(params) const response = await getStandGuardImgApi(params) + console.log('response站班会照片', response) + this.workPersonList = res.data console.log('人员信息---', res) + + if (response.data.length < 1) { + uni.showToast({ title: '暂无作业票、站班会照片信息', icon: 'none' }) + } this.holdCardList = res.datac this.standGuardList = response.data @@ -277,13 +332,24 @@ export default { current: index, loop: true }) + }, + /* 作业人员备注说明 */ + onViewWorkPersonExplain() { + this.$refs.popupPerson.open() + }, + /* 确定关闭按钮 */ + onClosePopupPerson() { + this.$refs.popupPerson.close() } }, onLoad(options) { const query = JSON.parse(options.query) this.queryInfo = query - const { proName } = query + + console.log('携带的参数---', query) + const { proName, day } = query this.commonParams.proName = proName + this.commonParams.day = day this.getTodayWorkPlan().then(() => { this.getWorkPersonnelData() }) @@ -452,4 +518,69 @@ export default { .img-container view:nth-child(3n + 1) { margin-left: 0; } + +.color_1 { + color: #06bd36; +} +.color_2 { + color: #f28b00; +} +.color_3 { + color: #ff4e4b; +} + +.popup-person { + width: 83vw; + // height: ; + background-color: #fff; + + .title { + font-size: 38rpx; + font-weight: bold; + color: #000; + text-align: center; + padding: 26rpx 0; + letter-spacing: 1px; + } + + .container { + padding: 32rpx 0; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; + + .item { + width: 85%; + margin: 0 auto; + padding: 12rpx 0; + display: flex; + align-items: center; + justify-content: center; + + view { + box-sizing: border-box; + margin: 0 16rpx; + } + + .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; + } + } + + .item view:first-child { + padding: 8rpx 20rpx; + border-radius: 8rpx; + } + } +} diff --git a/pages/workPlan/workPlan/index.vue b/pages/workPlan/workPlan/index.vue index 763055b..eb770f8 100644 --- a/pages/workPlan/workPlan/index.vue +++ b/pages/workPlan/workPlan/index.vue @@ -15,7 +15,7 @@ @@ -31,15 +31,15 @@ {{ index + 1 }} {{ item.proName }} - {{ item.subComName }} + {{ item.orgName }} 可接受风险:{{ item.kjsfx }} 低风险:{{ item.dfx }} @@ -50,11 +50,11 @@ 作业人数 - {{ item.personNum }} + {{ item.rys }} 已考勤 - {{ item.planProNum }} + {{ item.onWorkNum }} 未考勤 - {{ item.planNum }} + {{ item.offWorkNum }} @@ -91,6 +91,8 @@