|
|
|
|
@ -4,11 +4,11 @@ import { Component, PropsWithChildren, useEffect, useState } from "react";
|
|
|
|
|
|
|
|
|
|
import { Block, View, Text, Image, Input, Button, ScrollView, Picker } from "@tarojs/components";
|
|
|
|
|
import { go } from "@/utils/traoAPI";
|
|
|
|
|
import { Tab, Tabs } from "@antmjs/vantui";
|
|
|
|
|
import { Tab, Tabs, Dialog } from "@antmjs/vantui";
|
|
|
|
|
|
|
|
|
|
/** 自定义组件 **/
|
|
|
|
|
import Navbar from "../../components/navbar/navbar";
|
|
|
|
|
import PopupAlert from "../../components/popup/popup-alert";
|
|
|
|
|
import PopupClock from "../../components/popup/popup-clock";
|
|
|
|
|
/** 自定义组件 **/
|
|
|
|
|
|
|
|
|
|
import { InstrumentInfo } from '../../utils/Interface'
|
|
|
|
|
@ -27,15 +27,27 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
bindingInstrumentList: [],
|
|
|
|
|
curIndex: null,
|
|
|
|
|
clockStatistics: [],
|
|
|
|
|
statistics:[],
|
|
|
|
|
year:new Date().getFullYear(),
|
|
|
|
|
today: new Date()
|
|
|
|
|
statistics: [],
|
|
|
|
|
year: new Date().getFullYear(),
|
|
|
|
|
today: new Date(),
|
|
|
|
|
monthTime: [
|
|
|
|
|
{ month: 1, time: 0 },
|
|
|
|
|
{ month: 2, time: 0 },
|
|
|
|
|
{ month: 3, time: 0 },
|
|
|
|
|
{ month: 4, time: 0 },
|
|
|
|
|
{ month: 5, time: 0 },
|
|
|
|
|
{ month: 6, time: 0 },
|
|
|
|
|
{ month: 7, time: 0 },
|
|
|
|
|
{ month: 8, time: 0 },
|
|
|
|
|
{ month: 9, time: 0 },
|
|
|
|
|
{ month: 10, time: 0 },
|
|
|
|
|
{ month: 11, time: 0 },
|
|
|
|
|
{ month: 12, time: 0 },
|
|
|
|
|
],
|
|
|
|
|
show:true
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() { }
|
|
|
|
|
|
|
|
|
|
componentWillUnmount() { }
|
|
|
|
|
@ -64,52 +76,93 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
if (id != null) {
|
|
|
|
|
data['instrumentId'] = id
|
|
|
|
|
}
|
|
|
|
|
let res = await InstrumentInfo.nursingLog.getRecord(data)
|
|
|
|
|
let res = await InstrumentInfo.apiNursingLog.getRecord(data)
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
res.data.rows.map(item => {
|
|
|
|
|
item.nursingTime = this.getTime(item.nursingTime)
|
|
|
|
|
item.createTime = getdates(item.createTime).replace(/-/g, '.')
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
this.setState({ recordList: res.data.rows })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async addLog() {
|
|
|
|
|
let data = {
|
|
|
|
|
instrumentId: 57,
|
|
|
|
|
instrumentName: "0130验收FR100",
|
|
|
|
|
online: 1,
|
|
|
|
|
modeId: 100,
|
|
|
|
|
modeName: "护理记录测试",
|
|
|
|
|
nursingTime: "00:15:00"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let res = await InstrumentInfo.apiNursingLog.addLog(data)
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**分页获取用户的打卡记录 page size*/
|
|
|
|
|
async getClockStatistics(year=this.state.year) {
|
|
|
|
|
let res = await InstrumentInfo.clock.getClockStatistics({year})
|
|
|
|
|
async getClockStatistics(year = this.state.year) {
|
|
|
|
|
let res = await InstrumentInfo.apiClock.getClockStatistics({ year })
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
res.data.data.reverse()
|
|
|
|
|
res.data.data.map(item=>{
|
|
|
|
|
item.isMore = false
|
|
|
|
|
})
|
|
|
|
|
if (res.data.data.length > 0) {
|
|
|
|
|
res.data.data.map((item, index) => {
|
|
|
|
|
item.isMore = false
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
item.isMore = true
|
|
|
|
|
}
|
|
|
|
|
this.state.monthTime.map(monthItem => {
|
|
|
|
|
if (monthItem.month == item.month) {
|
|
|
|
|
monthItem.time = item.clockNum
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.setState({ monthTime: this.state.monthTime })
|
|
|
|
|
} else {
|
|
|
|
|
let monthTime = [
|
|
|
|
|
{ month: 1, time: 0 },
|
|
|
|
|
{ month: 2, time: 0 },
|
|
|
|
|
{ month: 3, time: 0 },
|
|
|
|
|
{ month: 4, time: 0 },
|
|
|
|
|
{ month: 5, time: 0 },
|
|
|
|
|
{ month: 6, time: 0 },
|
|
|
|
|
{ month: 7, time: 0 },
|
|
|
|
|
{ month: 8, time: 0 },
|
|
|
|
|
{ month: 9, time: 0 },
|
|
|
|
|
{ month: 10, time: 0 },
|
|
|
|
|
{ month: 11, time: 0 },
|
|
|
|
|
{ month: 12, time: 0 },
|
|
|
|
|
]
|
|
|
|
|
this.setState({ monthTime })
|
|
|
|
|
}
|
|
|
|
|
this.setState({ clockStatistics: res.data.data })
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 查询用户护理记录的当月统计信息
|
|
|
|
|
async getStatistics(id) {
|
|
|
|
|
let data = {}
|
|
|
|
|
if (id != null) {
|
|
|
|
|
data['instrumentId'] = id
|
|
|
|
|
}
|
|
|
|
|
let res = await InstrumentInfo.nursingLog.getStatistics(data)
|
|
|
|
|
// if (res.data.code === 200) {
|
|
|
|
|
|
|
|
|
|
// this.setState({ statistics: res.data.rows })
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
setShow(show: boolean){
|
|
|
|
|
this.setState({show})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
closeAlert(){
|
|
|
|
|
this.setShow(false)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onChangeProduct(id) {
|
|
|
|
|
this.setState({ curIndex: id })
|
|
|
|
|
this.getRecord(id)
|
|
|
|
|
// this.addLog()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onChangeMore(id){
|
|
|
|
|
this.state.clockStatistics.map(item=>{
|
|
|
|
|
if(item.id === id){
|
|
|
|
|
onChangeMore(id) {
|
|
|
|
|
this.state.clockStatistics.map(item => {
|
|
|
|
|
if (item.id === id) {
|
|
|
|
|
item.isMore = !item.isMore
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.setState({ clockStatistics:this.state.clockStatistics})
|
|
|
|
|
this.setState({ clockStatistics: this.state.clockStatistics })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async onLoad() {
|
|
|
|
|
@ -124,9 +177,9 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
async initData() { }
|
|
|
|
|
|
|
|
|
|
onChangeYear(event) {
|
|
|
|
|
this.setState({ year: event.detail.value})
|
|
|
|
|
this.setState({ year: event.detail.value })
|
|
|
|
|
this.getClockStatistics(event.detail.value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onTab = async (event) => {
|
|
|
|
|
const { current } = event.currentTarget.dataset;
|
|
|
|
|
@ -136,12 +189,12 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
toReport() {
|
|
|
|
|
go("/pages/face_report/face_report");
|
|
|
|
|
toReport(id, recordId) {
|
|
|
|
|
go("/pages/face_report/face_report?id=" + id + "&recordId=" + recordId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let { current, array, name, recordList, bindingInstrumentList, curIndex, clockStatistics,statistics,year,today } = this.state;
|
|
|
|
|
let { current, array, name, recordList, bindingInstrumentList, curIndex, clockStatistics, statistics, year, today, monthTime,show } = this.state;
|
|
|
|
|
return (
|
|
|
|
|
<Block>
|
|
|
|
|
<Navbar isBack titleSlot='护理记录'></Navbar>
|
|
|
|
|
@ -235,11 +288,11 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
<View className='top-left'>
|
|
|
|
|
<View className='date'>{item.createTime}</View>
|
|
|
|
|
<View className={classnames("tip", {
|
|
|
|
|
tag_active: item.online === 0,
|
|
|
|
|
tag_active: item.online === 2,
|
|
|
|
|
})}
|
|
|
|
|
>{item.online ? '在线' : '离线'}</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='top-right' onClick={this.toReport}>
|
|
|
|
|
<View className='top-right' onClick={this.toReport.bind(this, item.instrumentId, item.id)}>
|
|
|
|
|
回看报告
|
|
|
|
|
<Image className='arrow_icon' src={require("../../img/index/right.png")} mode='aspectFill'></Image>
|
|
|
|
|
</View>
|
|
|
|
|
@ -283,60 +336,85 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
</Picker>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='chart flex sb'>
|
|
|
|
|
<View className='flex fc aitems' >
|
|
|
|
|
<View className='buoy' >5天</View>
|
|
|
|
|
<View className='column' style='height: calc(186/31*{{item.total}}rpx)'></View>
|
|
|
|
|
<View className='month'>1</View>
|
|
|
|
|
</View>
|
|
|
|
|
{
|
|
|
|
|
monthTime.map(item => (
|
|
|
|
|
<View className='flex fc aitems' key={item.month}>
|
|
|
|
|
{
|
|
|
|
|
item.time > 0 && <View className='buoy' >{item.time}天</View>
|
|
|
|
|
}
|
|
|
|
|
<View className='column' style={{ height: `calc(186/31*${item.time}rpx)` }}></View>
|
|
|
|
|
<View className='month'>{item.month}</View>
|
|
|
|
|
</View>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View style='padding-bottom: env(safe-area-inset-bottom)' >
|
|
|
|
|
<View className='month_box m-x-30'>
|
|
|
|
|
{clockStatistics.map(item => (
|
|
|
|
|
<View className='month_statistics' key={item.id}>
|
|
|
|
|
<View className='flex aitems sb'>
|
|
|
|
|
<View className='time'>{item.year}年{item.month}月</View>
|
|
|
|
|
<View className='more_box flex aitems' onClick={this.onChangeMore.bind(this,item.id)}>
|
|
|
|
|
<View className='more_text'> {!item.isMore ? '展开更多' : '收起更多'}</View>
|
|
|
|
|
<Image style={{transform: (item.isMore) ? 'rotate(180deg)':'rotate(0deg)'}} className='more_icon'
|
|
|
|
|
src={require("../../img/arrow-down.png")} mode='widthFix'
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='month_statistics' key={item.id}>
|
|
|
|
|
<View className='flex aitems sb'>
|
|
|
|
|
<View className='time'>{item.year}年{item.month}月</View>
|
|
|
|
|
<View className='more_box flex aitems' onClick={this.onChangeMore.bind(this, item.id)}>
|
|
|
|
|
<View className='more_text'> {!item.isMore ? '展开更多' : '收起更多'}</View>
|
|
|
|
|
<Image style={{ transform: (item.isMore) ? 'rotate(180deg)' : 'rotate(0deg)' }} className='more_icon'
|
|
|
|
|
src={require("../../img/arrow-down.png")} mode='widthFix'
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|
|
|
|
|
<View style='height: 59rpx'></View>
|
|
|
|
|
<View className='statistic'>
|
|
|
|
|
<View className='statistic_item'>
|
|
|
|
|
<View className='statistic_num'>{item.clockNum}</View>
|
|
|
|
|
<View className='statistic_desc'>本月打卡天数</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='statistic_item'>
|
|
|
|
|
<View className='statistic_num'>{item.percentage*100}%</View>
|
|
|
|
|
<View className='statistic_desc'>超越花至用户</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='border'></View>
|
|
|
|
|
</View>
|
|
|
|
|
<View style='height: 59rpx'></View>
|
|
|
|
|
<View className='statistic'>
|
|
|
|
|
<View className='statistic_item'>
|
|
|
|
|
<View className='statistic_num'>{item.clockNum}</View>
|
|
|
|
|
<View className='statistic_desc'>本月打卡天数</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='statistic_item'>
|
|
|
|
|
<View className='statistic_num'>{item.percentage * 100}%</View>
|
|
|
|
|
<View className='statistic_desc'>超越花至用户</View>
|
|
|
|
|
</View>
|
|
|
|
|
{ item.isMore&&
|
|
|
|
|
<View className='border'></View>
|
|
|
|
|
</View>
|
|
|
|
|
{item.isMore &&
|
|
|
|
|
<View>
|
|
|
|
|
<View style='height: 57rpx' ></View>
|
|
|
|
|
<View className='month_item'>
|
|
|
|
|
<View className='month_item_date'>2024.5.23</View>
|
|
|
|
|
<View className='month_image_box flex sb'>
|
|
|
|
|
<Image className='month_item_cover' src={require("../../img/test/1706667011027.jpg")} ></Image>
|
|
|
|
|
<View style='height: 57rpx' ></View>
|
|
|
|
|
<View className='month_item'>
|
|
|
|
|
<View className='month_item_date'>2024.5.23</View>
|
|
|
|
|
<View className='month_image_box flex sb'>
|
|
|
|
|
<Image className='month_item_cover' src={require("../../img/test/1706667011027.jpg")} ></Image>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='month_item_date'>小紫弹智能射频仪、花至抗老射频仪PRO </View>
|
|
|
|
|
<View className='month_item_note'>护理心得:真棒真棒真棒真棒真棒真棒真棒真棒真棒真棒</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='month_item_date'>小紫弹智能射频仪、花至抗老射频仪PRO </View>
|
|
|
|
|
<View className='month_item_note'>护理心得:真棒真棒真棒真棒真棒真棒真棒真棒真棒真棒</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
}
|
|
|
|
|
</View>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
</View>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
)}
|
|
|
|
|
<View className='footer flex aitems' >
|
|
|
|
|
<View className='btn' onClick={this.setShow.bind(this,true)}>前往打卡</View>
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
<PopupClock
|
|
|
|
|
isShow={show}
|
|
|
|
|
isClose
|
|
|
|
|
title='今日打卡'
|
|
|
|
|
content='暂未授权注册,请点击注册'
|
|
|
|
|
confirmButtonText='确认提交'
|
|
|
|
|
textAlgin='center'
|
|
|
|
|
type='1'
|
|
|
|
|
close={this.closeAlert}
|
|
|
|
|
confirm={this.closeAlert}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Block>
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|