首页调试完善

This commit is contained in:
BianLzhaoMin 2024-11-03 15:24:43 +08:00
parent 32bbc24344
commit 0a5053f059
7 changed files with 833 additions and 3 deletions

View File

@ -754,6 +754,20 @@
"navigationStyle": "custom"
}
},
/* */
{
"path": "pages/workPlan/workPlan/index",
"style": {
"navigationStyle": "custom"
}
},
/* - */
{
"path": "pages/workPlan/workPlan-details/index",
"style": {
"navigationStyle": "custom"
}
},
/* */
{
"path": "pages/workPlan/workbench/index",

View File

@ -549,7 +549,7 @@ export default {
'Content-Type': 'application/json'
},
success: res => {
console.log('?? ~ gotoYy ~ res:', res)
console.log('?? ~ gotoYy ~ res------:', res)
// console.log('?? ~ gotoYy ~ res:', res.data.token)
if (res.data.code == 200) {
// uni.setStorageSync('tjToken', res.data.token)

View File

@ -97,7 +97,7 @@
<view>
<text>{{ currentDayInfo.rys }}</text>
</view>
<view>
<view @tap="onViewPersonDetails(currentDayInfo.idNumber)">
<text class="style_4" v-if="currentDayInfo.kjsfx > 0">可接受:{{ currentDayInfo.kjsfx }}</text>
<text class="style_3" v-if="currentDayInfo.dfx > 0">:{{ currentDayInfo.dfx }}</text>
<text class="style_2" v-if="currentDayInfo.zfx > 0">:{{ currentDayInfo.zfx }}</text>
@ -378,6 +378,9 @@ export default {
const res = await getProFxByDayApi({ day: this.currentDay })
this.currentDayInfo = res.data[0]
console.log('----------当日数据', res)
},
onViewPersonDetails(id) {
uni.navigateTo({ url: `/pages/realName/index/pages/personDetail?idNumber=${id}` })
}
}
}

View File

@ -3,7 +3,7 @@
<!-- <uni-notice-bar :showClose="showClose" :showIcon="showIcon" scrollable :text="noticeContent" /> -->
<image class="warning-img" src="../../../../static/images/img-phase-two/index_news.png" mode=""></image>
<text>今日风险</text>
<view class="uni-notice-bar">
<view class="uni-notice-bar" @tap="onViewRiskDetails">
<uni-notice-bar
style="height: 100%"
:speed="50"
@ -75,6 +75,9 @@ export default {
}
})
}
},
onViewRiskDetails() {
uni.navigateTo({ url: '/pages/workPlan/workPlan/index' })
}
},
mounted() {

View File

@ -0,0 +1,455 @@
<template>
<view class="work-plan-details">
<u-navbar
class="u-navbar"
title="作业计划详情"
placeholder
@leftClick="leftClick"
leftIconColor="#fff"
bgColor="#00337A"
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
/>
<uni-card :is-shadow="true" margin="6">
<view class="card-header">
<uni-icons type="list" size="16" style="color: #3f9dfd; margin-right: 8rpx"></uni-icons>
<text>
{{ queryInfo.proName }}
</text>
</view>
<view class="card-header">
<uni-icons type="calendar" size="16" style="margin-right: 8rpx"></uni-icons>
<view>{{ $moment().format('YYYY-MM-DD') }}</view>
</view>
</uni-card>
<uni-section title="今日作业计划" type="line">
<template v-slot:right>
<view @tap="onSearchAllPerson" style="color: #3f9dfd">全部人员</view>
</template>
<uni-card :is-shadow="true" margin="6">
<view v-for="item in todayWorkList" :key="item.contentId" @tap="onSearchWorkPerson(item.contentId)">
<view class="row-1">
<view>现场负责人</view>
<view>
<text>{{ item.xcfzr }}</text>
<!-- <text>{{ item.xcfzr.split('')[1] }}</text> -->
</view>
<view>作业人员</view>
<view>{{ item.rys }}</view>
</view>
<view class="row-2">
<view>风险等级</view>
<view>{{ item.fxdj }}</view>
<view>执行情况</view>
<view>{{ item.state }}</view>
</view>
<view class="row-3">
<view style="padding: 8rpx 0">作业内容</view>
<view style="color: #000">{{ item.zynr }}</view>
</view>
</view>
</uni-card>
</uni-section>
<uni-section title="作业人员" type="line">
<uni-card :is-shadow="true" margin="6" padding="0">
<view class="work-person">
<view
:class="getPersonStyle(item)"
v-for="item in workPersonList"
:key="item.idNumber"
@tap="onClickTableTr(item.idNumber)"
>
{{ item.name }}
</view>
</view>
</uni-card>
</uni-section>
<uni-section title="人员持证" type="line">
<uni-card :is-shadow="true" margin="6" padding="0">
<view class="person-card">
<view
:class="getItemClass(index)"
v-for="(item, index) in holdCardList"
:key="index"
@tap="onQueryCardDetails(item)"
>
{{ item.certificateName }}({{ item.certificateNum }})
</view>
<!-- <view class="orange-border">低压电工作业9</view>
<view class="green-border">低压电工作业9</view>
<view class="blue-border">低压电工作业9</view>
<view class="orange-border">低压电工作业9</view> -->
</view>
</uni-card>
</uni-section>
<uni-section title="作业票、站班会照片" type="line" style="padding-bottom: 10rpx">
<uni-card :is-shadow="true" margin="6" padding="0">
<view class="img-container">
<view @tap="onPreviewImage(index)" v-for="(item, index) in standGuardList" :key="index">
<image
class="image-content"
:src="`${config.loginBaseUrl}ynPlan${item.imgPath}`"
mode="scaleToFill"
lazy-load="true"
></image>
<uni-icons style="color: #ccc" type="calendar" size="14">{{ item.crateTime }}</uni-icons>
</view>
</view>
</uni-card>
</uni-section>
<uni-popup ref="popup" type="center" border-radius="10px 10px 0 0">
<view class="popup-center">
<view class="popup-title">
<view>持证信息</view>
<uni-icons class="close-icon" style="color: #fff" type="close" size="26" @tap="onClosePopup"></uni-icons>
</view>
<uni-section title="持证人员列表" type="line">
<template v-slot:right>
<view
style="
padding: 10rpx;
border-radius: 12rpx;
border: 1px solid #3f9dfd;
color: #3f9dfd;
background-color: #d5e7f9;
"
>
{{ holdCardTitle }}
</view>
</template>
</uni-section>
<view class="table-th">
<view>持证名称</view>
<view>持证人姓名</view>
<view>工种</view>
</view>
<view style="padding: 5rpx">
<scroll-view style="height: 400rpx" scroll-y="true">
<view
class="table-tr"
v-for="item in holdCardDetailsList"
:key="item.idNumber"
@tap="onClickTableTr(item.idNumber)"
>
<view>{{ item.certificateName }}</view>
<view>{{ item.name }}</view>
<view>{{ item.gz }}</view>
</view>
</scroll-view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {
getWorkPlanDetailsApi,
getWorkPersonnelApi,
getStandGuardImgApi,
getHoldCardInfoApi
} from '../../../api/phaseTwo/homePage'
import config from '@/config'
export default {
data() {
return {
queryInfo: {}, //
todayWorkList: [], //
workPersonList: [], //
holdCardList: [], //
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: '',
imgList: [], // 使
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.navigateBack()
},
/* 获取今日作业计划 */
async getTodayWorkPlan() {
const res = await getWorkPlanDetailsApi(this.commonParams)
this.todayWorkList = res.data
},
/* 获取人员信息 */
async getWorkPersonnelData() {
const contentIdParams = {
contentId: this.contentId
}
const params = Object.assign(this.commonParams, contentIdParams)
const res = await getWorkPersonnelApi(params)
const response = await getStandGuardImgApi(params)
this.workPersonList = res.data
console.log('人员信息---', res)
this.holdCardList = res.datac
this.standGuardList = response.data
this.imgList = this.standGuardList.map(e => {
return `${config.loginBaseUrl}ynPlan${e.imgPath}`
})
},
/* 点击作业计划时查询作业人员 */
onSearchWorkPerson(id) {
this.contentId = id
this.getWorkPersonnelData()
},
/* 查询持证信息 */
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)
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'
// ],
urls: this.imgList,
current: index,
loop: true
})
}
},
onLoad(options) {
const query = JSON.parse(options.query)
this.queryInfo = query
const { proName } = query
this.commonParams.proName = proName
this.getTodayWorkPlan().then(() => {
this.getWorkPersonnelData()
})
}
}
</script>
<style lang="scss" scoped>
.card-header {
display: flex;
align-items: center;
}
.row-1,
.row-2 {
padding: 25rpx 0;
display: flex;
border-bottom: 1px solid #eee;
view {
flex: 1;
text-align: center;
}
}
.work-person {
display: flex;
flex-wrap: wrap;
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) {
margin-left: 0;
}
.person-card {
display: flex;
flex-wrap: wrap;
view {
width: calc(32%);
margin: 12rpx 0 12rpx calc(4% / 2);
box-sizing: border-box;
border-radius: 12rpx;
text-align: center;
font-size: 12px;
}
.blue-border {
border: 1px solid #3f9dfd;
color: #3f9dfd;
background-color: #d5e7f9;
}
.orange-border {
border: 1px solid #f5a208;
color: #f5a208;
background-color: #f7e3bf;
}
.green-border {
border: 1px solid #03af03;
color: #03af03;
background-color: #c5f3c5;
}
}
.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;
}
</style>

View File

@ -0,0 +1,352 @@
<template>
<view class="page">
<u-navbar
class="u-navbar"
title="作业计划"
placeholder
@leftClick="leftClick"
leftIconColor="#fff"
bgColor="#00337A"
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
/>
<view class="header-fixed">
<view class="search-content">
<view style="width: 90%">
<uni-easyinput
suffixIcon="search"
v-model="queryParams.params.proName"
placeholder="请输入工程信息"
@iconClick="getWorkPlantData"
></uni-easyinput>
</view>
<view class="search-icon" @tap="onSearchFilter"></view>
</view>
<view style="margin-top: 20rpx; color: #3f9dfd; letter-spacing: 2rpx">已查询{{ recordsTotal }}条数据</view>
</view>
<view style="padding: 0 20rpx">
<scroll-view class="data-container" scroll-y="true">
<view class="scroll-item" v-for="(item, index) in companyInfoList" :key="item.proId">
<view class="item-1">
<view>{{ index + 1 }}</view>
<view>{{ item.proName }}</view>
<uni-icons
:type="item.isCollect == 1 ? 'star-filled' : 'star'"
size="20"
@tap="onCollection(item)"
:style="{ color: item.isCollect == 1 ? '#f9971e' : '' }"
style="position: absolute; right: 1%"
></uni-icons>
</view>
<view class="item-2" @tap="onViewWorkDetails(item)">
<view>{{ item.subComName }}</view>
<view>
<text v-if="item.kjsfx > 0" style="color: #6ff6d5; margin-right: 6rpx">可接受风险{{ item.kjsfx }}</text>
<text v-if="item.dfx > 0" style="color: #25c294; margin-right: 6rpx">低风险{{ item.dfx }}</text>
<text v-if="item.zfx > 0" style="color: #f9971e; margin-right: 6rpx">中风险{{ item.zfx }}</text>
<text v-if="item.gfx > 0" style="color: #f44d46; margin-right: 6rpx">高风险{{ item.gfx }}</text>
<text v-if="item.tgfx > 0" style="color: #f91008; margin-right: 6rpx">特高风险{{ item.tgfx }}</text>
</view>
</view>
<view class="item-3" @tap="onViewWorkDetails(item)">
<view>作业人数</view>
<view style="color: #3f9dfd; font-weight: bold">{{ item.personNum }}</view>
<view>已考勤</view>
<view style="color: #36aa76; font-weight: bold">{{ item.planProNum }}</view>
<view>未考勤</view>
<view style="color: #f91008; font-weight: bold">{{ item.planNum }}</view>
</view>
</view>
</scroll-view>
</view>
<!-- 底部弹框 -->
<uni-popup ref="popup" type="bottom" background-color="#fff">
<view class="bottom-content">
<h1>条件筛选</h1>
<h2>分公司</h2>
<view>
<scroll-view class="company-container" scroll-y="true">
<view class="company-items">
<view
:key="item.company_name"
v-for="(item, index) in companyList"
:class="{ active: index === activeIndex }"
@tap="onSelectCompany(index, item.name)"
>
{{ item.name }}
</view>
</view>
</scroll-view>
</view>
<view class="bottom-btn">
<button style="background-color: #fff; color: #00337a" @tap="onReset">重置</button>
<button style="background-color: #00337a; color: #fff" @tap="onQuery">查询</button>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { getHomePageSelectApi } from '../../../api/phaseTwo/homePage'
import config from '@/config'
export default {
data() {
return {
activeIndex: 0,
recordsTotal: 0,
// token: uni.getStorageSync('tjToken'),
token: uni.getStorageSync('wkToken'),
// token: uni.getStorageSync('tyToken'),
//
queryParams: {
offset: 0,
limit: 99999,
params: {
userId: uni.getStorageSync('realNameUser').userId + '',
proName: '',
subComName: ''
}
},
companyList: [{ name: '全部', id: '' }],
companyInfoList: []
}
},
mounted() {
this.getWorkPlantData()
this.getHomePageSelectData()
},
methods: {
/* 获取作业计划列表 */
async getWorkPlantData() {
uni.request({
url: config.realNewBmwUrl + '/bmw/homeSubPage/getAppDayPlanMsg',
method: 'POST',
data: JSON.stringify(this.queryParams),
header: {
'Content-Type': 'application/json'
// token: this.token
},
success: res => {
this.recordsTotal = res.data.recordsTotal
this.companyInfoList = res.data.data
console.log('resssss作业计划列表信息', res)
},
fail: err => {}
})
},
/* 获取公司数据 */
async getHomePageSelectData() {
const res = await getHomePageSelectApi()
this.companyList = this.companyList.concat(res.subList)
},
leftClick() {
uni.navigateBack()
},
onSearchFilter() {
//
this.$refs.popup.open()
},
/* 选择公司 */
onSelectCompany(index, name) {
this.activeIndex = index
if (index === 0) {
this.queryParams.params.subComName = ''
} else {
this.queryParams.params.subComName = name
}
},
/* 重置 */
onReset() {
this.activeIndex = 0
this.queryParams.params.subComName = ''
this.onQuery()
},
/* 查询 */
onQuery() {
this.getWorkPlantData().then(() => {
this.$refs.popup.close()
})
},
/* 点击跳转作业计划详情 */
onViewWorkDetails(row) {
uni.navigateTo({ url: `/pages/workPlan/workPlan-details/index?query=${JSON.stringify(row)}` })
},
/* 收藏与取消收藏 */
onCollection(row) {
console.log('收藏--', this.token)
const params = {
id: row.collectId,
userId: uni.getStorageSync('realNameUser').userId,
foreignId: row.proId,
type: 1
}
console.log('params参数', params)
uni.request({
url: `${config.realNewBmwUrl}${
row.isCollect == 0 ? '/app/offLine/insertCollect' : '/app/offLine/deleteCollect'
}`,
method: 'POST',
data: JSON.stringify(params),
header: {
'Content-Type': 'application/json',
token: this.token
},
success: res => {
console.log('收藏结果---', res)
if (res.data.code === 200) {
uni.showToast({ icon: 'none', title: ` ${row.isCollect == 0 ? '收藏成功' : '已取消收藏'}` })
this.getWorkPlantData()
}
},
fail: err => {}
})
}
}
}
</script>
<style lang="scss" scoped>
.page {
width: 100vw;
height: 100vh;
background-color: #efefef;
box-sizing: border-box;
}
.header-fixed {
width: 94%;
margin: 20rpx auto;
background-color: #fff;
border-radius: 10rpx;
padding: 20rpx;
.search-content {
display: flex;
align-items: center;
.search-icon {
width: 48rpx;
height: 40rpx;
margin-right: 60rpx;
margin-left: 30rpx;
background: url('../../../static/realName/screen.png') no-repeat;
background-size: 100% 100%;
}
}
}
.data-container {
width: 100%;
height: 75vh;
.scroll-item {
padding: 14rpx 0;
background-color: #fff;
margin: 20rpx auto;
}
.item-1,
.item-2,
.item-3 {
width: 96%;
margin: 0 auto;
padding: 20rpx 0;
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
position: relative;
}
.item-1 view:first-child {
width: 80rpx;
height: 56rpx;
margin-right: 16rpx;
text-align: center;
line-height: 56rpx;
background: url('../../../static/realName/serial.png') no-repeat;
background-size: 100% 100%;
color: #fff;
font-weight: bold;
font-size: 28rpx;
}
.item-2,
.item-3 {
font-size: 24rpx;
justify-content: space-around;
}
}
.bottom-content {
height: 45vh;
h1,
h2 {
padding: 15rpx 0;
font-size: 32rpx;
}
h1 {
margin-top: 10rpx;
border-top: 1px solid #ccc;
text-align: center;
}
h2 {
padding-left: 16rpx;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
.company-container {
width: 100%;
height: 400rpx;
.company-items {
width: 100%;
padding: 0 16rpx;
display: flex;
flex-wrap: wrap;
view {
width: 49%;
height: 48rpx;
margin-top: 10rpx;
line-height: 48rpx;
border-radius: 10rpx;
text-align: center;
background-color: #eee;
color: #656565;
}
.active {
background-color: #3f9dfd;
color: #fff;
}
}
.company-items view:nth-child(2n + 1) {
margin-right: 10rpx;
}
}
.bottom-btn {
width: 100%;
position: fixed;
display: flex;
bottom: 0;
z-index: 9;
button {
flex: 1;
height: 80rpx;
line-height: 80rpx;
font-weight: normal;
border-radius: 20rpx;
border: 1rpx solid #00337a;
}
}
}
</style>

View File

@ -59,6 +59,8 @@ const user = {
commit('SET_PHONE', user.phone)
uni.setStorageSync('userPhone', user.phone)
commit('SET_IS_FIRST_LOGIN', user.isFirstLogin)
uni.setStorageSync('tyToken', res.data.token)
resolve(res)
})
.catch(error => {
@ -81,6 +83,7 @@ const user = {
commit('SET_PHONE', user.phone)
uni.setStorageSync('userPhone', user.phone)
commit('SET_IS_FIRST_LOGIN', user.isFirstLogin)
uni.setStorageSync('tyToken', res.data.token)
resolve(res)
})
.catch(error => {