页面等功能优化

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' 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,9 +358,42 @@ export default {
} }
if (name === '作业计划移动端') { if (name === '作业计划移动端') {
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({ uni.reLaunch({
url: '/pages/workPlan/index/index' 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'
})
}
})
} }
}, },
getDayNoticeAnnoByUserId() { getDayNoticeAnnoByUserId() {

View File

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

View File

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

View File

@ -35,7 +35,7 @@
size="20" size="20"
@tap="onCollection(item)" @tap="onCollection(item)"
:style="{ color: item.isCollect == 1 ? '#f9971e' : '' }" :style="{ color: item.isCollect == 1 ? '#f9971e' : '' }"
style="position: absolute;right: 1%;" style="position: absolute; right: 1%"
></uni-icons> ></uni-icons>
</view> </view>
<view class="item-2" @tap="onViewWorkDetails(item)"> <view class="item-2" @tap="onViewWorkDetails(item)">
@ -116,7 +116,7 @@ export default {
/* 获取作业计划列表 */ /* 获取作业计划列表 */
async getWorkPlantData() { async getWorkPlantData() {
uni.request({ uni.request({
url: config.loginBaseUrl + '/bmw/homeSubPage/getAppDayPlanMsg', url: config.realNewBmwUrl + '/bmw/homeSubPage/getAppDayPlanMsg',
method: 'POST', method: 'POST',
data: JSON.stringify(this.queryParams), data: JSON.stringify(this.queryParams),
header: { header: {
@ -178,7 +178,7 @@ export default {
type: 1 type: 1
} }
uni.request({ uni.request({
url: `${config.loginBaseUrl}${ url: `${config.realNewBmwUrl}${
row.isCollect == 0 ? '/app/offLine/insertCollect' : '/app/offLine/deleteCollect' row.isCollect == 0 ? '/app/offLine/insertCollect' : '/app/offLine/deleteCollect'
}`, }`,
method: 'POST', method: 'POST',
@ -208,7 +208,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
} }
.header-fixed { .header-fixed {
width: 94%; width: 94%;
margin: 20rpx auto; margin: 20rpx auto;
background-color: #fff; background-color: #fff;
@ -228,9 +228,9 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
} }
} }
} }
.data-container { .data-container {
width: 100%; width: 100%;
height: 75vh; height: 75vh;
@ -270,9 +270,9 @@ export default {
font-size: 24rpx; font-size: 24rpx;
justify-content: space-around; justify-content: space-around;
} }
} }
.bottom-content { .bottom-content {
height: 45vh; height: 45vh;
h1, h1,
@ -338,6 +338,5 @@ export default {
border: 1rpx solid #00337a; border: 1rpx solid #00337a;
} }
} }
} }
</style> </style>

View File

@ -22,7 +22,7 @@
</button> </button>
</view> </view>
<!-- 内容区域 --> <!-- 发起提交 -->
<view class="content-2" v-show="activeIndex === 1"> <view class="content-2" v-show="activeIndex === 1">
<view class="pages-add" id="pagesAddRef"> <view class="pages-add" id="pagesAddRef">
<view style="text-align: right; width: 30%"> <view style="text-align: right; width: 30%">
@ -33,10 +33,18 @@
></image> ></image>
</view> </view>
<view class="num-content"> <view class="num-content">
<uni-pagination :show-icon="true" :total="pagesTotal" :pageSize="1" v-model="currentPage" /> <!-- <uni-pagination :show-icon="true" :total="pagesTotal" :pageSize="1" /> -->
<!-- <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 scroll-x="true" class="scroll-x" scroll-with-animation="true">
</scroll-view> --> <view
:class="{ 'active-page': item == currentSwiper + 1 }"
v-for="item in pagesTotal"
:key="item"
@tap="onChangePages(item)"
>
{{ item }}
</view>
</scroll-view>
</view> </view>
<view style="text-align: left; width: 30%"> <view style="text-align: left; width: 30%">
<image <image
@ -117,21 +125,78 @@
</view> </view>
</view> </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> </view>
<!-- 弹框 --> <!-- 弹框 -->
<uni-popup ref="popup" background-color="#fff"> <uni-popup ref="popup" background-color="#fff">
<view class="popup-content" v-if="popupType === 'center'"> <view class="popup-content" v-if="popupType === 'center'">
<view class="flex-style" style="justify-content: space-between"> <view class="flex-style">
<text>选择工程</text> <text style="font-size: 16px">选择工程</text>
<text>X</text> <uni-icons type="closeempty" size="30" @tap="onClosePopup"></uni-icons>
</view> </view>
<view>2024-10-16</view> <view>{{ projectQueryParams.planTime }}</view>
<view class="search"> <view class="search">
<view class="select"> <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> </view>
<button>搜索</button> <button @tap="getProjectListData()">搜索</button>
</view> </view>
<view class="project-content">暂无数据</view> <view class="project-content">暂无数据</view>
</view> </view>
@ -155,6 +220,7 @@
<script> <script>
import TimeSelect from './components/time-select' import TimeSelect from './components/time-select'
import { getProjectListApi } from '../../../api/workPlan/monthPlan'
export default { export default {
components: { components: {
TimeSelect TimeSelect
@ -168,6 +234,8 @@ export default {
popupType: '', popupType: '',
scrollHeight: 500, scrollHeight: 500,
formData: {}, formData: {},
isType: false,
currentTime: this.$moment().format('YYYY-MM'),
btnList: [ btnList: [
{ btn_title: '工作待办' }, { btn_title: '工作待办' },
{ btn_title: '发起提交' }, { btn_title: '发起提交' },
@ -349,7 +417,22 @@ export default {
{ form_label: '备注', items_type: 'ipt' }, { form_label: '备注', items_type: 'ipt' },
{ 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() { mounted() {
@ -368,12 +451,18 @@ export default {
}) })
.exec() .exec()
console.log('this.scrollHeight', this.scrollHeight) // console.log('this.scrollHeight', this.scrollHeight)
this.getProjectListData()
}, },
methods: { methods: {
leftClick() { leftClick() {
uni.navigateBack() uni.navigateBack()
}, },
/* 获取工程数据 */
async getProjectListData() {
const res = await getProjectListApi(this.projectQueryParams)
console.log('工程数据res', res)
},
onTapCheck(i) { onTapCheck(i) {
this.activeIndex = i this.activeIndex = i
}, },
@ -396,16 +485,53 @@ export default {
} }
}, },
onSwiperChange(e) { onSwiperChange(e) {
this.currentPage = e.detail.current + 1 // this.currentPage = e.detail.current + 1
this.currentSwiper = e.detail.current
}, },
onCheckAuditing(val) { onCheckAuditing(val) {
console.log(val, '----') console.log(val, '----')
} },
// onChangePages(num) { /* 保存提交 */
onSaveSubmit() {
console.log('保存提交')
},
onChangePages(num) {
this.currentSwiper = num - 1
// if (num > 1) { // if (num > 1) {
// console.log('') // 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
}
}, },
onLoad(options) { onLoad(options) {
if (options.type == 1) { if (options.type == 1) {
@ -473,6 +599,9 @@ export default {
line-height: 76rpx; line-height: 76rpx;
color: #003778; color: #003778;
} }
.active-page {
border-bottom: 1px solid #003778;
}
} }
} }
} }
@ -492,12 +621,90 @@ export default {
} }
} }
.common-style {
padding: 15rpx;
}
.time-container {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 38rpx;
}
// //
.popup-content { .popup-content {
width: 90vw; width: 90vw;
padding: 20rpx; padding: 20rpx;
background-color: #eeeeee; background-color: #eeeeee;
.search {
width: 100%;
height: 90rpx;
margin-bottom: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff;
.select {
height: 68rpx;
width: 65%;
margin-left: 10rpx;
}
button {
height: 60rpx;
width: 25%;
line-height: 60rpx;
font-size: 28rpx;
background-color: #003777;
color: #fff;
border-radius: 12rpx;
}
}
.project-content {
height: 460rpx;
width: 97%;
margin: 0 auto;
background-color: #fff;
text-align: center;
}
}
}
.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 { .search {
width: 100%; width: 100%;
height: 70rpx; height: 70rpx;
@ -527,8 +734,40 @@ export default {
width: 97%; width: 97%;
margin: 0 auto; margin: 0 auto;
background-color: #fff; background-color: #fff;
text-align: center;
} }
}
.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> </style>