This commit is contained in:
cclu 2023-08-17 10:31:12 +08:00
parent 1c20c9b235
commit 79236a6ce1
7 changed files with 108 additions and 70 deletions

Binary file not shown.

View File

@ -1,5 +1,6 @@
<template> <template>
<view style="width: 56rpx;height: 56rpx"> <view style="width: 56rpx;height: 56rpx">
<!-- <image v-if="preferPath" style="width: 56rpx;height: 56rpx" :src="preferPath"></image>-->
<canvas style="width: 56rpx;height: 56rpx" canvas-id="month" id="month"/> <canvas style="width: 56rpx;height: 56rpx" canvas-id="month" id="month"/>
</view> </view>
</template> </template>
@ -11,7 +12,9 @@ var uChartsInstance = {};
export default { export default {
name: "YearCharts", name: "YearCharts",
data() { data() {
return {} return {
preferPath:''
}
}, },
props: { props: {
success: { success: {
@ -72,6 +75,26 @@ export default {
} }
} }
}); });
setTimeout( ()=>{
// this.canvasToTempImage('month')
},2000)
},
canvasToTempImage(id){
uni.canvasToTempFilePath({
canvasId:id,
complete:(res)=>{
if (res.tempFilePath){
uni.getFileSystemManager().readFile({
filePath: res.tempFilePath,
encoding: 'base64',
success: res => {
let base64 = 'data:image/png;base64,' + res.data;
this.preferPath = base64
}
})
}
}
},this)
}, },
} }
} }

View File

@ -86,10 +86,10 @@
<text class="itemLabel">未整改<text class="itemValue">/</text></text> <text class="itemLabel">未整改<text class="itemValue">/</text></text>
</view> </view>
<view class="otherItem"> <view class="otherItem">
<view class="otherLeft" v-show="rate"> <view class="otherLeft" v-show="!showPop">
<YearCharts :success="rate"/> <YearCharts :success="rate"/>
</view> </view>
<view class="otherLeft" v-show="!rate"></view> <view class="otherLeft" v-show="showPop"></view>
<view class="otherDetail"> <view class="otherDetail">
<text class="itemValue">{{dailyExamineObj.CompleteRate?dailyExamineObj.CompleteRate + '%' :'-' }}</text> <text class="itemValue">{{dailyExamineObj.CompleteRate?dailyExamineObj.CompleteRate + '%' :'-' }}</text>
<text class="itemLabel">达标率<text class="itemUnit">/全省</text></text> <text class="itemLabel">达标率<text class="itemUnit">/全省</text></text>
@ -194,12 +194,12 @@
<view class="areaList"> <view class="areaList">
<view class="popupDetail"> <view class="popupDetail">
<view v-if="selectTab===1" > <view v-if="selectTab===1" >
<scroll-view v-if="showPop" class="detailLeft" :show-scrollbar="false" scroll-with-animation scroll-y="true" enable-flex :scroll-into-view="'item' + selectMenu"> <scroll-view class="detailLeft" :show-scrollbar="false" scroll-y="true" enable-flex :scroll-into-view="'item' + selectMenu">
<view :id="'item'+index" :class="index===selectMenu?'serviceSelect currentSelect':'serviceSelect'" v-for="(item,index) in serviceList" :key="index" @click="handleChangeMenu(index)">{{item.SERVERPART_NAME.split('服务区')[0]}}</view> <view :id="'item'+index" :class="index===selectMenu?'serviceSelect currentSelect':'serviceSelect'" v-for="(item,index) in serviceList" :key="index" @click="handleChangeMenu(index)">{{item.SERVERPART_NAME.split('服务区')[0]}}</view>
</scroll-view> </scroll-view>
</view> </view>
<view v-if="selectTab===2" > <view v-if="selectTab===2" >
<scroll-view v-if="showPop" class="detailLeft" :show-scrollbar="false" scroll-with-animation scroll-y="true" enable-flex :scroll-into-view="'item' + selectMenu"> <scroll-view class="detailLeft" :show-scrollbar="false" scroll-y="true" enable-flex :scroll-into-view="'item' + selectMenu">
<view :id="'item'+index" :class="index===selectMenu?'serviceSelect currentSelect':'serviceSelect'" v-for="(item,index) in dailyServiceList" :key="index" @click="handleChangeMenu(index)">{{item.SERVERPART_NAME.split('服务区')[0]}}</view> <view :id="'item'+index" :class="index===selectMenu?'serviceSelect currentSelect':'serviceSelect'" v-for="(item,index) in dailyServiceList" :key="index" @click="handleChangeMenu(index)">{{item.SERVERPART_NAME.split('服务区')[0]}}</view>
</scroll-view> </scroll-view>
</view> </view>
@ -209,11 +209,22 @@
<view class="serviceDetailItem" v-for="(item,index) in currentObj.list" :key="index"> <view class="serviceDetailItem" v-for="(item,index) in currentObj.list" :key="index">
<view class="detailItemTop" > <view class="detailItemTop" >
<view class="fixedName">{{item.REGION_NAME}}</view> <view class="fixedName">{{item.REGION_NAME}}</view>
<view class="store" v-if="selectTab===1">{{item.EXAMINE_SCORE}}<text class="unit"></text></view>
</view> </view>
<view v-for="(subItem,subIndex) in item.SERVERPARTList" :key="index"> <view v-for="(subItem,subIndex) in item.SERVERPARTList" :key="index"
:style="{marginBottom:index===item.SERVERPARTList.length-1?'':'24rpx'}">
<view v-if="selectTab===1"> <view v-if="selectTab===1">
<view class="messageItem" style="align-items: flex-start;text-align: left">
<image class="itemIcon" style="margin-top: 4rpx" src="https://eshangtech.com/ShopICO/ahyd-BID/newExamine/userIcon.svg"/>
<text class="itemValue">{{subItem.EXAMINE_PERSON}}</text>
</view>
<view class="messageItem">
<image class="itemIcon" src="https://eshangtech.com/ShopICO/ahyd-BID/newExamine/timeIcon.svg"/>
<text class="itemValue">{{subItem.EXAMINE_DATE}}</text>
</view>
<view class="detailItemMessage" v-for="(thirdItem,thirdIndex) in subItem.DetailList" :key="thirdIndex"> <view class="detailItemMessage" v-for="(thirdItem,thirdIndex) in subItem.DetailList" :key="thirdIndex">
<view class="messageBox"> <view class="messageBox">
<view class="messageBoxTop"> <view class="messageBoxTop">
@ -355,31 +366,39 @@ export default {
// //
if (query.time){ if (query.time){
this.queryTime = query.time this.queryTime = query.time
//
const date = new Date(this.queryTime) const date = new Date(this.queryTime)
let y = date.getFullYear() let y = date.getFullYear()
this.selectMonth = date.getMonth() + 1 this.selectMonth = date.getMonth() + 1
this.single = this.queryTime this.single = this.queryTime
console.log('this.single',this.single) //
const realDate = new Date(this.lastDay)
//
if (this.selectMonth === realDate.getMonth() + 1){
let realDay = realDate.getDate()
this.singleDay = `${y}-${this.selectMonth<10?'0'+this.selectMonth:this.selectMonth}-${realDay}`
}else{
//
//
let day = this.$util.getThisMonthDay(`${y}-${this.selectMonth<10?'0'+this.selectMonth:this.selectMonth}`) let day = this.$util.getThisMonthDay(`${y}-${this.selectMonth<10?'0'+this.selectMonth:this.selectMonth}`)
this.singleDay = `${y}-${this.selectMonth<10?'0'+this.selectMonth:this.selectMonth}-${day<10?'0'+day:day}` this.singleDay = `${y}-${this.selectMonth<10?'0'+this.selectMonth:this.selectMonth}-${day<10?'0'+day:day}`
console.log('this.singleDay',this.singleDay) }
}else{ }else{
//
const date = new Date(this.lastDay) const date = new Date(this.lastDay)
this.selectMonth = date.getMonth() + 1 this.selectMonth = date.getMonth() + 1
}
// lastDay
// //
this.single = timestampToTimeMonth((new Date(this.lastDay).getTime())) this.single = timestampToTimeMonth((new Date(this.lastDay).getTime()))
// //
this.singleDay = this.lastDay this.singleDay = this.lastDay
}
// lastDay
// //
const start = new Date(this.lastDay) const start = new Date(this.lastDay)
this.startDate = `${start.getFullYear()}-01` this.startDate = `${start.getFullYear()}-01`
this.startDateDay = `${start.getFullYear()}-01-01` this.startDateDay = `${start.getFullYear()}-01-01`
// //
this.endData = new Date() this.endData = this.$util.cutDate(new Date(),'YYYY-MM-DD')
// //
let userInfo = uni.getStorageSync('vuex') let userInfo = uni.getStorageSync('vuex')
userInfo = JSON.parse(userInfo) userInfo = JSON.parse(userInfo)
@ -391,7 +410,7 @@ export default {
this.handleGetDailyPatrol() this.handleGetDailyPatrol()
// //
this.handleGetExamine() this.handleGetExamine()
// onLoad
if (this.selectTab===1){ if (this.selectTab===1){
this.handleNewGetExamine() this.handleNewGetExamine()
}else if(this.selectTab===2){ }else if(this.selectTab===2){
@ -400,6 +419,8 @@ export default {
}, },
methods:{ methods:{
handleSort(){ handleSort(){
// reverse sequence
//
if (this.sortType==='sequence'){ if (this.sortType==='sequence'){
this.sortType = 'reverse' this.sortType = 'reverse'
if (this.selectTab===1){ if (this.selectTab===1){
@ -416,12 +437,15 @@ export default {
} }
} }
}, },
//
handleDetail(item,index){ handleDetail(item,index){
this.selectMenu = index this.selectMenu = index
this.currentObj = item this.currentObj = item
this.showPop = true this.showPop = true
this.$forceUpdate() this.$forceUpdate()
}, },
//
//
handleOpenPopup(item,index){ handleOpenPopup(item,index){
this.selectMenu = index this.selectMenu = index
this.currentObj = item this.currentObj = item
@ -468,6 +492,7 @@ export default {
this.examineObj = obj this.examineObj = obj
}) })
}, },
//
handleNewGetExamine(){ handleNewGetExamine(){
const time = this.$util.cutDate(this.single,'YYYYMM') const time = this.$util.cutDate(this.single,'YYYYMM')
const req = { const req = {
@ -509,30 +534,13 @@ export default {
uni.hideLoading() uni.hideLoading()
}) })
}, },
//
handleNewGetPatrol(){ handleNewGetPatrol(){
// let obj = {
// start:null,
// end:null
// }
// const date = new Date(this.singleDay)
// let y = date.getFullYear()
// let m = date.getMonth() + 1
// if (this.selectMonth === m){
// obj.start = this.singleDay
// obj.end = this.singleDay
// }else{
// let day = this.$util.getThisMonthDay(`${y}-${m<10?'0'+m:m}`)
// obj.start = `${y}-${m<10?'0'+m:m}-01`
// obj.end = `${y}-${m<10?'0'+m:m}-${day}`
// }
const req = { const req = {
StartDate:this.singleDay, StartDate:this.singleDay,
EndDate:this.singleDay, EndDate:this.singleDay,
provinceCode:this.useInfo.userData.ProvinceCode || '340000' provinceCode:this.useInfo.userData.ProvinceCode || '340000'
} }
request.$webGet('CommercialApi/Examine/GetPatrolResultList',req).then(data=>{ request.$webGet('CommercialApi/Examine/GetPatrolResultList',req).then(data=>{
let list = JSON.parse(JSON.stringify(data.Result_Data.List)) let list = JSON.parse(JSON.stringify(data.Result_Data.List))
let noList = [] let noList = []
@ -567,13 +575,17 @@ export default {
uni.hideLoading() uni.hideLoading()
}) })
}, },
//
bindDateChange(e){ bindDateChange(e){
const date = new Date(e.detail.value) const date = new Date(e.detail.value)
//
this.selectContentTab = 1 this.selectContentTab = 1
//
this.selectMonth = date.getMonth() + 1 this.selectMonth = date.getMonth() + 1
uni.showLoading({ uni.showLoading({
title:'正在加载' title:'正在加载'
}) })
//
if (this.selectTab===1){ if (this.selectTab===1){
this.single = e.detail.value this.single = e.detail.value
this.handleGetExamine() this.handleGetExamine()
@ -584,9 +596,6 @@ export default {
this.handleNewGetPatrol() this.handleNewGetPatrol()
} }
}, },
handleChangeChild(subItem){
subItem.showChild = !subItem.showChild
},
// //
handleAddDate(type){ handleAddDate(type){
this.selectContentTab = 1 this.selectContentTab = 1
@ -597,6 +606,7 @@ export default {
uni.showLoading({ uni.showLoading({
title:'正在加载' title:'正在加载'
}) })
//
// 1 2 // 1 2
if (type===1){ if (type===1){
if (this.selectTab===1){ if (this.selectTab===1){
@ -685,16 +695,6 @@ export default {
} }
} }
}, },
//
handleShowImgDetail(subItem){
if (subItem.PATROL_SITUATION){
this.showImg = true
}
},
changeDetail(subItem){
this.showImgUrl = subItem
this.$forceUpdate()
},
previewImage(event,index){ previewImage(event,index){
// //
wx.previewImage({ wx.previewImage({
@ -702,25 +702,19 @@ export default {
urls: event.currentTarget.dataset.src // http urls: event.currentTarget.dataset.src // http
}) })
}, },
//
previewShowImage(event,subItem){
let _this = this
wx.previewImage({
current: event.currentTarget.dataset.src, // http
urls: _this.showImgUrl.PATROLDEAL_URL?[_this.showImgUrl.PATROLDETAIL_URL,_this.showImgUrl.PATROLDEAL_URL]:[_this.showImgUrl.PATROLDETAIL_URL] // http
})
},
// //
hidePopup(){ hidePopup(){
this.showPop = false this.showPop = false
// //
this.popupTabSelect = 0 this.popupTabSelect = 0
}, },
//
handleChangeContentTab(value){ handleChangeContentTab(value){
this.selectContentTab = value this.selectContentTab = value
this.sortType = 'sequence' this.sortType = 'sequence'
this.serviceList = this.serviceAllList[value - 1] this.serviceList = this.serviceAllList[value - 1]
}, },
//
handleChangeMenu(value){ handleChangeMenu(value){
this.selectMenu = value this.selectMenu = value
if (this.selectTab===1){ if (this.selectTab===1){
@ -729,6 +723,7 @@ export default {
this.currentObj = this.dailyServiceList[value] this.currentObj = this.dailyServiceList[value]
} }
}, },
//
handleChangeDailyTab(value){ handleChangeDailyTab(value){
this.sortType = 'sequence' this.sortType = 'sequence'
this.selectDaily = value this.selectDaily = value
@ -741,7 +736,7 @@ export default {
if (value===2){ if (value===2){
this.rate = null this.rate = null
setTimeout(()=>{ setTimeout(()=>{
this.rate = this.dailyExamineObj.CompleteRate this.rate = this.dailyExamineObj && this.dailyExamineObj.CompleteRate?this.dailyExamineObj.CompleteRate:0
},100) },100)
this.handleNewGetPatrol() this.handleNewGetPatrol()
}else if(value===1){ }else if(value===1){
@ -749,6 +744,7 @@ export default {
} }
}, },
// //
//
handleBack(){ handleBack(){
if (this.come==='index'){ if (this.come==='index'){
uni.switchTab({ uni.switchTab({
@ -761,10 +757,6 @@ export default {
} }
}, },
hideShowImg(){
this.showImg = false
this.showImgUrl = {}
},
} }
} }
@ -1472,20 +1464,21 @@ export default {
.detailLeft{ .detailLeft{
width: 184rpx; width: 184rpx;
height: calc(85vh - 148rpx); height: calc(85vh - 148rpx);
box-sizing: border-box;
.serviceSelect{ .serviceSelect{
padding:24rpx 32rpx; padding:24rpx 32rpx;
font-size: 32rpx; font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #160002; color: #160002;
line-height: 44rpx line-height: 44rpx;
box-sizing: border-box;
position: relative;
} }
.currentSelect{ .currentSelect{
font-size: 32rpx; box-sizing: border-box;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #EC6C00; color: #EC6C00;
line-height: 44rpx;
position: relative; position: relative;
} }
.currentSelect:before{ .currentSelect:before{
@ -1498,6 +1491,28 @@ export default {
left: 0;top: 50%; left: 0;top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
::-webkit-scrollbar {
width: 4px;
height: 4px;
color:transparent;
}
/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track {
border-radius: 10px;
background-color:transparent;
}
/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color:transparent;
}
.notice{
font-size: 12px;
color: gray;
}
} }
.serviceDetail{ .serviceDetail{

View File

@ -173,7 +173,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '/static/public/font/stylesheet.css'; //@import '/static/public/font/stylesheet.css';
.main{ .main{
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;

View File

@ -174,7 +174,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '/static/public/font/stylesheet.css'; //@import '/static/public/font/stylesheet.css';
.main{ .main{
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;

View File

@ -670,7 +670,7 @@ export default {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '/static/public/font/stylesheet.css'; //@import '/static/public/font/stylesheet.css';
.main{ .main{
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;

View File

@ -245,7 +245,7 @@ import Tabbar from "../../components/tabbar/tabbar.vue";
{ {
id:'30f0e7d0-4e01-4a63-a65b-613e1f427335', id:'30f0e7d0-4e01-4a63-a65b-613e1f427335',
name: '考评考核', name: '考评考核',
homeUrl: '/pages/examine/index', homeUrl: '/pages/newamine/index',
imagePath: '/static/images/user/assessment.svg', imagePath: '/static/images/user/assessment.svg',
isNotice:false, isNotice:false,
notice:0, notice:0,