页面等功能优化

This commit is contained in:
BianLzhaoMin 2024-10-24 16:53:53 +08:00
parent 5cfbb0d7f8
commit cbc27076a9
6 changed files with 469 additions and 172 deletions

View File

@ -1,3 +1,26 @@
import request_yn from '@/utils/request_new_yn'
// 获取
// 获取工程列表
export function getProjectListApi(data) {
return request_yn({
url: '/ynPlanApp/select/getProsByState',
method: 'post',
data: data
})
}
// 获取风险等级
export function getRiskLevelListApi(data) {
return request_yn({
url: '/ynPlanApp/select/getFXDJ',
method: 'get',
params: data
})
}
// 获取管控层级
export function getControlLevelListApi(data) {
return request_yn({
url: '/ynPlanApp/select/getGKCJ',
method: 'get',
params: data
})
}

View File

@ -358,8 +358,41 @@ export default {
}
if (name === '作业计划移动端') {
uni.reLaunch({
url: '/pages/workPlan/index/index'
uni.request({
url: config.realLoginUrl + 'login',
method: 'POST',
data: JSON.stringify(realParams),
header: {
'Content-Type': 'application/json'
},
success: res => {
console.log('🚀 ~ gotoYy ~ res:', res)
// console.log('🚀 ~ gotoYy ~ res:', res.data.token)
if (res.data.code == 200) {
// uni.setStorageSync('tjToken', res.data.token)
uni.setStorageSync('realNameToken', res.data.data.access_token)
uni.setStorageSync('realNameUser', res.data.data.loginUser.sysUser)
uni.setStorageSync('realNamePermissions', res.data.data.loginUser.permissions)
uni.removeStorageSync('hasChosenPro')
setTimeout(() => {
uni.reLaunch({
url: '/pages/workPlan/index/index'
})
}, 500)
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
},
fail: err => {
console.log('🚀 ~ gotoYy ~ err:', err)
uni.showToast({
title: '无权限访问',
icon: 'none'
})
}
})
}
},

View File

@ -56,7 +56,7 @@ export default {
{
name: '',
color: '#fc8483',
data: 0.9
data: dataGirl
}
]
}

View File

@ -1,19 +1,20 @@
<template>
<view class="page">
<u-navbar
class="u-navbar"
title="首页"
placeholder
@leftClick="leftClick"
leftIconColor="#fff"
rightIcon="list" @rightClick="onRefreshPages"
bgColor="#00337A"
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
>
<view class="u-nav-slot" slot="right">
<text style="color: #FFF;">刷新</text>
</view>
</u-navbar>
<u-navbar
class="u-navbar"
title="首页"
placeholder
@leftClick="leftClick"
leftIconColor="#fff"
rightIcon="list"
@rightClick="onRefreshPages"
bgColor="#00337A"
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
>
<view class="u-nav-slot" slot="right">
<text style="color: #fff" @tap="onRefreshPages">刷新</text>
</view>
</u-navbar>
<!-- <button class="refresh-btn" @tap="onRefreshPages">刷新</button> -->
<scroll-view scroll-y="true">
<!-- 轮播图区域 -->
@ -227,12 +228,12 @@
<view>({{ maleNum }})</view>
</view>
<view @tap="onJumpColorLight(4)" class="gender-img" style="margin-left: 30rpx">
<view @tap="onJumpColorLight(4)" class="gender-img">
<PieChartsModelMan />
</view>
</view>
<view class="girl-right">
<view @tap="onJumpColorLight(5)" class="gender-img" style="margin-right: 30rpx">
<view @tap="onJumpColorLight(5)" class="gender-img">
<PieChartsModelGirl />
</view>
@ -727,11 +728,13 @@ export default {
godataView(item) {
console.log(item)
if (item.data_title == '在建工程') {
let name = '在建';let currentIndex = 1;
const survey = {
name,currentIndex
}
uni.navigateTo({ url: `/pages/realName/index/pages/project?survey=${JSON.stringify(survey)}` })
let name = '在建'
let currentIndex = 1
const survey = {
name,
currentIndex
}
uni.navigateTo({ url: `/pages/realName/index/pages/project?survey=${JSON.stringify(survey)}` })
}
if (item.data_title == '在用分包单位') {
uni.navigateTo({ url: '/pages/realName/index/pages/subList' })
@ -1205,7 +1208,7 @@ export default {
align-items: center;
justify-content: center;
.gender-img {
width: 120rpx;
width: 160rpx;
height: 240rpx;
// background-color: orange;
}

View File

@ -35,7 +35,7 @@
size="20"
@tap="onCollection(item)"
:style="{ color: item.isCollect == 1 ? '#f9971e' : '' }"
style="position: absolute;right: 1%;"
style="position: absolute; right: 1%"
></uni-icons>
</view>
<view class="item-2" @tap="onViewWorkDetails(item)">
@ -116,7 +116,7 @@ export default {
/* 获取作业计划列表 */
async getWorkPlantData() {
uni.request({
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppDayPlanMsg',
url: config.realNewBmwUrl + '/bmw/homeSubPage/getAppDayPlanMsg',
method: 'POST',
data: JSON.stringify(this.queryParams),
header: {
@ -178,7 +178,7 @@ export default {
type: 1
}
uni.request({
url: `${config.loginBaseUrl}${
url: `${config.realNewBmwUrl}${
row.isCollect == 0 ? '/app/offLine/insertCollect' : '/app/offLine/deleteCollect'
}`,
method: 'POST',
@ -208,136 +208,135 @@ export default {
box-sizing: border-box;
}
.header-fixed {
width: 94%;
margin: 20rpx auto;
background-color: #fff;
border-radius: 10rpx;
padding: 20rpx;
.header-fixed {
width: 94%;
margin: 20rpx auto;
background-color: #fff;
border-radius: 10rpx;
padding: 20rpx;
.search-content {
display: flex;
align-items: center;
.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;
.search-icon {
width: 48rpx;
height: 40rpx;
margin-right: 60rpx;
margin-left: 30rpx;
background: url('../../../static/realName/screen.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;
.data-container {
width: 100%;
height: 75vh;
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;
}
.scroll-item {
padding: 14rpx 0;
background-color: #fff;
margin: 20rpx auto;
}
.company-container {
.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%;
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;
padding: 0 16rpx;
display: flex;
bottom: 0;
z-index: 9;
flex-wrap: wrap;
button {
flex: 1;
height: 80rpx;
line-height: 80rpx;
font-weight: normal;
border-radius: 20rpx;
border: 1rpx solid #00337a;
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

@ -22,7 +22,7 @@
</button>
</view>
<!-- 内容区域 -->
<!-- 发起提交 -->
<view class="content-2" v-show="activeIndex === 1">
<view class="pages-add" id="pagesAddRef">
<view style="text-align: right; width: 30%">
@ -33,10 +33,18 @@
></image>
</view>
<view class="num-content">
<uni-pagination :show-icon="true" :total="pagesTotal" :pageSize="1" v-model="currentPage" />
<!-- <scroll-view scroll-x="true" class="scroll-x" scroll-with-animation="true">
<view v-for="item in pagesNum" :key="item" @tap="onChangePages(item)">{{ item }}</view>
</scroll-view> -->
<!-- <uni-pagination :show-icon="true" :total="pagesTotal" :pageSize="1" /> -->
<scroll-view scroll-x="true" class="scroll-x" scroll-with-animation="true">
<view
:class="{ 'active-page': item == currentSwiper + 1 }"
v-for="item in pagesTotal"
:key="item"
@tap="onChangePages(item)"
>
{{ item }}
</view>
</scroll-view>
</view>
<view style="text-align: left; width: 30%">
<image
@ -117,21 +125,78 @@
</view>
</view>
</view>
<!-- 查看报表 -->
<view v-show="activeIndex === 2" class="common-style">
<uni-forms ref="form-b" label-position="top" label-width="200">
<uni-forms-item label="工程名称" required>
<view class="time-container" @tap="onSelectProject">
<view>请选择</view>
<text>&gt;</text>
</view>
</uni-forms-item>
</uni-forms>
<view class="icon-search-time">
<text style="fon-size: 30rpx; margin-right: 25rpx" @tap="onReduceMonth"></text>
<uni-icons type="left" size="20" @tap="onReduceDay"></uni-icons>
<view class="view-time">
<picker mode="date" @change="onChangeCurrentData" :value="currentTime">
<view class="date-picker">{{ currentTime }}</view>
</picker>
</view>
<uni-icons type="right" size="20" @tap="onAddDay"></uni-icons>
<text style="fon-size: 30rpx; margin-left: 25rpx" @tap="onAddMonth"></text>
<button @tap="onBackToday">返回本月</button>
</view>
</view>
<!-- 查看数据 -->
<view v-show="activeIndex === 3" class="common-style">
<uni-easyinput
prefixIcon="search"
v-model="searchValue"
placeholder="搜索"
@iconClick="iconClick"
></uni-easyinput>
<uni-forms ref="form-b" label-position="top" label-width="200">
<uni-forms-item label="工程名称" required>
<view class="time-container" @tap="onViewSelectProject">
<view>请选择</view>
<text>&gt;</text>
</view>
</uni-forms-item>
<uni-forms-item label="全部状态" required>
<view class="time-container" @tap="onSelectAllType">
<view>请选择</view>
<text>&gt;</text>
</view>
</uni-forms-item>
</uni-forms>
</view>
</view>
<!-- 弹框 -->
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content" v-if="popupType === 'center'">
<view class="flex-style" style="justify-content: space-between">
<text>选择工程</text>
<text>X</text>
<view class="flex-style">
<text style="font-size: 16px">选择工程</text>
<uni-icons type="closeempty" size="30" @tap="onClosePopup"></uni-icons>
</view>
<view>2024-10-16</view>
<view>{{ projectQueryParams.planTime }}</view>
<view class="search">
<view class="select">
<uni-data-select v-model="value" @change="onProjectChange" :localdata="range"></uni-data-select>
<uni-data-select
v-model="projectQueryParams.state"
@change="onProjectChange"
:localdata="projectRange"
></uni-data-select>
</view>
<button>搜索</button>
<button @tap="getProjectListData()">搜索</button>
</view>
<view class="project-content">暂无数据</view>
</view>
@ -155,6 +220,7 @@
<script>
import TimeSelect from './components/time-select'
import { getProjectListApi } from '../../../api/workPlan/monthPlan'
export default {
components: {
TimeSelect
@ -168,6 +234,8 @@ export default {
popupType: '',
scrollHeight: 500,
formData: {},
isType: false,
currentTime: this.$moment().format('YYYY-MM'),
btnList: [
{ btn_title: '工作待办' },
{ btn_title: '发起提交' },
@ -349,7 +417,22 @@ export default {
{ form_label: '备注', items_type: 'ipt' },
{ form_label: '计划数量', items_type: 'ipt' }
],
currentSwiper: 0
currentSwiper: 0,
projectQueryParams: {
planTime: this.$moment().format('YYYY-MM-DD'),
type: 3,
state: ''
},
projectRange: [
{ value: '', text: '全部' },
{ value: '0', text: '未填报' },
{ value: '1', text: '已填报' }
],
isAUditingList: [
{ title: '未审核', value: 0 },
{ title: '已审核', value: 1 }
],
searchValue: ''
}
},
mounted() {
@ -368,12 +451,18 @@ export default {
})
.exec()
console.log('this.scrollHeight', this.scrollHeight)
// console.log('this.scrollHeight', this.scrollHeight)
this.getProjectListData()
},
methods: {
leftClick() {
uni.navigateBack()
},
/* 获取工程数据 */
async getProjectListData() {
const res = await getProjectListApi(this.projectQueryParams)
console.log('工程数据res', res)
},
onTapCheck(i) {
this.activeIndex = i
},
@ -396,16 +485,53 @@ export default {
}
},
onSwiperChange(e) {
this.currentPage = e.detail.current + 1
// this.currentPage = e.detail.current + 1
this.currentSwiper = e.detail.current
},
onCheckAuditing(val) {
console.log(val, '----')
},
/* 保存提交 */
onSaveSubmit() {
console.log('保存提交')
},
onChangePages(num) {
this.currentSwiper = num - 1
// if (num > 1) {
// console.log('')
// }
},
onReduceMonth() {
this.currentTime = this.$moment(this.currentTime).subtract(1, 'year').format('YYYY-MM')
},
onReduceDay() {
this.currentTime = this.$moment(this.currentTime).subtract(1, 'months').format('YYYY-MM')
},
onAddMonth() {
this.currentTime = this.$moment(this.currentTime).add(1, 'year').format('YYYY-MM')
},
onAddDay() {
this.currentTime = this.$moment(this.currentTime).add(1, 'months').format('YYYY-MM')
},
onBackToday() {
this.currentTime = this.$moment().format('YYYY-MM')
},
iconClick() {
console.log('搜索')
},
onChangeCurrentData(e) {
this.currentTime = e.detail.value
},
onViewSelectProject() {
this.$refs.popup.open('bottom')
this.popupType = 'bottom'
},
onSelectAllType() {
this.$refs.popup.open('bottom')
this.popupType = 'bottom'
this.isType = true
}
// onChangePages(num) {
// if (num > 1) {
// console.log('')
// }
// }
},
onLoad(options) {
if (options.type == 1) {
@ -473,6 +599,9 @@ export default {
line-height: 76rpx;
color: #003778;
}
.active-page {
border-bottom: 1px solid #003778;
}
}
}
}
@ -492,6 +621,16 @@ export default {
}
}
.common-style {
padding: 15rpx;
}
.time-container {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 38rpx;
}
//
.popup-content {
width: 90vw;
@ -500,22 +639,23 @@ export default {
.search {
width: 100%;
height: 70rpx;
height: 90rpx;
margin-bottom: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #eeeeee;
background-color: #fff;
.select {
height: 68rpx;
width: 65%;
margin: 0;
margin-left: 10rpx;
}
button {
height: 68rpx;
width: 30%;
line-height: 68rpx;
font-size: 32rpx;
height: 60rpx;
width: 25%;
line-height: 60rpx;
font-size: 28rpx;
background-color: #003777;
color: #fff;
border-radius: 12rpx;
@ -531,4 +671,103 @@ export default {
}
}
}
.flex-style {
display: flex;
align-content: center;
justify-content: space-between;
}
.icon-search-time {
width: 100%;
height: 68rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-weight: bold;
button {
margin-right: 60rpx;
height: 65rpx;
background-color: #003777;
color: #fff;
line-height: 65rpx;
font-weight: normal;
font-size: 30rpx;
}
.view-time {
margin: 0 35rpx;
}
}
.popup-content {
width: 90vw;
padding: 20rpx;
background-color: #eeeeee;
.search {
width: 100%;
height: 70rpx;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #eeeeee;
.select {
height: 68rpx;
width: 65%;
margin: 0;
}
button {
height: 68rpx;
width: 30%;
line-height: 68rpx;
font-size: 32rpx;
background-color: #003777;
color: #fff;
border-radius: 12rpx;
}
}
.project-content {
height: 460rpx;
width: 97%;
margin: 0 auto;
background-color: #fff;
}
}
.select-item {
height: 90rpx;
line-height: 90rpx;
text-align: center;
border-bottom: 1px solid #ccc;
}
.select-item:hover {
background-color: rgb(224, 239, 249);
}
.popup-bottom-content {
height: 50vh;
.bottom-title {
height: 90rpx;
padding-right: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #ccc;
}
.bottom-title text:first-child {
color: transparent;
}
.select-item {
height: 90rpx;
line-height: 90rpx;
text-align: center;
border-bottom: 1px solid #ccc;
}
.select-item:hover {
background-color: rgb(224, 239, 249);
}
}
</style>