|
|
|
|
@ -2,16 +2,21 @@ import Taro from "@tarojs/taro";
|
|
|
|
|
import classnames from "classnames";
|
|
|
|
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
|
|
|
|
import { Progress , Tab, Tabs, Dialog, Popup } from "@antmjs/vantui";
|
|
|
|
|
import { showModal } from "../../../utils/traoAPI";
|
|
|
|
|
import { showModal } from "@/utils/traoAPI";
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
Block, View, Text, Image, Input, Button, Textarea,
|
|
|
|
|
Block,
|
|
|
|
|
View,
|
|
|
|
|
Text,
|
|
|
|
|
Image,
|
|
|
|
|
Input,
|
|
|
|
|
Button,
|
|
|
|
|
Textarea,
|
|
|
|
|
} from "@tarojs/components";
|
|
|
|
|
import { date, getdates, previewImage } from "../../../utils/util";
|
|
|
|
|
|
|
|
|
|
/** 自定义组件 **/
|
|
|
|
|
import Navbar from "../../../components/navbar/navbar";
|
|
|
|
|
import PopupAlert from "../../../components/popup/popup-alert";
|
|
|
|
|
import { InstrumentInfo } from "../../../utils/Interface";
|
|
|
|
|
|
|
|
|
|
/** 自定义组件 **/
|
|
|
|
|
@ -22,7 +27,7 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
reportShow: true,
|
|
|
|
|
name: "template模板页",
|
|
|
|
|
name: "护理报告",
|
|
|
|
|
statistics: {},
|
|
|
|
|
recordList: [],
|
|
|
|
|
recordData: {},
|
|
|
|
|
@ -71,36 +76,41 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async getRecord(id, recordId) {
|
|
|
|
|
console.log("id, recordId", id, recordId);
|
|
|
|
|
async getRecord(id, instrumentId) {
|
|
|
|
|
console.log("id, nursingLogId", id, instrumentId);
|
|
|
|
|
let data = {};
|
|
|
|
|
if (id != null) {
|
|
|
|
|
data["instrumentId"] = id;
|
|
|
|
|
data["nursingLogId"] = id;
|
|
|
|
|
}
|
|
|
|
|
let res = await InstrumentInfo.apiNursingLog.getRecord(data);
|
|
|
|
|
// 获取当前
|
|
|
|
|
let res1 = await InstrumentInfo.apiNursingLog.getRecordNow(id);
|
|
|
|
|
// 获取历史记录列表
|
|
|
|
|
let res = await InstrumentInfo.apiNursingLog.getRecordNew(data);
|
|
|
|
|
|
|
|
|
|
res1.data.data.nursingTime = this.getTime(res1.data.data.nursingTime);
|
|
|
|
|
res1.data.data.createTime = getdates(res1.data.data.createTime).replace(/-/g, ".");
|
|
|
|
|
|
|
|
|
|
this.setState({ recordData: res1.data.data });
|
|
|
|
|
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
if (recordId) {
|
|
|
|
|
if (instrumentId) {
|
|
|
|
|
res.data.rows.map((item) => {
|
|
|
|
|
item.nursingTime = this.getTime(item.nursingTime);
|
|
|
|
|
item.createTime = getdates(item.createTime).replace(/-/g, ".");
|
|
|
|
|
|
|
|
|
|
if (item.id == recordId) {
|
|
|
|
|
this.setState({ recordData: item });
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({ recordData: res.data.rows[0] });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
recordList: res.data.rows.filter((item) => item.id != recordId),
|
|
|
|
|
recordList: res.data.rows.filter((item) => item.id != instrumentId),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 文本框输入文字
|
|
|
|
|
handleTextareaInput = (e) => {
|
|
|
|
|
const punchInInfo = this.state.punchInInfo;
|
|
|
|
|
this.setState({ punchInInfo: { ...punchInInfo, clockContent: e.detail.value } });
|
|
|
|
|
this.setState({
|
|
|
|
|
punchInInfo: { ...punchInInfo, clockContent: e.detail.value },
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
async submit() {
|
|
|
|
|
let punchInInfo = this.state.punchInInfo || {};
|
|
|
|
|
@ -123,21 +133,22 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
t2: "您已完成今日打卡",
|
|
|
|
|
btn1show: false,
|
|
|
|
|
}).then(() => {
|
|
|
|
|
let data = new Date
|
|
|
|
|
Taro.setStorageSync('DayTime', data.toISOString())
|
|
|
|
|
let data = new Date();
|
|
|
|
|
Taro.setStorageSync("DayTime", data.toISOString());
|
|
|
|
|
this.setState({
|
|
|
|
|
clockShow: true,
|
|
|
|
|
});
|
|
|
|
|
this.getClockStatistics();
|
|
|
|
|
this.setShow(false);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/**分页获取用户的打卡记录 page size*/
|
|
|
|
|
async getClockStatistics(year = this.state.year) {
|
|
|
|
|
let res = await InstrumentInfo.apiClock.getClockStatistics({ year });
|
|
|
|
|
console.log(res,'查看返回',year);
|
|
|
|
|
console.log(res, "查看返回", year);
|
|
|
|
|
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
|
|
|
|
|
res.data.data.reverse();
|
|
|
|
|
if (res.data.data.length > 0) {
|
|
|
|
|
res.data.data.map((item, index) => {
|
|
|
|
|
@ -250,17 +261,17 @@ delImg(i) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async onLoad(options) {
|
|
|
|
|
console.log(options,'查看传过来的参数');
|
|
|
|
|
console.log(options, "查看传过来的参数");
|
|
|
|
|
|
|
|
|
|
let Bool = JSON.parse(options?.report)
|
|
|
|
|
let Bool = JSON.parse(options?.report);
|
|
|
|
|
if (!Bool) {
|
|
|
|
|
this.setState({
|
|
|
|
|
reportShow:Bool
|
|
|
|
|
})
|
|
|
|
|
reportShow: Bool,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.getRouteId();
|
|
|
|
|
this.getClockStatistics()
|
|
|
|
|
this.getClockStatistics();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidShow() {}
|
|
|
|
|
@ -274,7 +285,17 @@ delImg(i) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let { name, statistics, recordList, recordData, show,clockStatistics,punchInInfo,monthTime,reportShow } = this.state;
|
|
|
|
|
let {
|
|
|
|
|
name,
|
|
|
|
|
statistics,
|
|
|
|
|
recordList,
|
|
|
|
|
recordData,
|
|
|
|
|
show,
|
|
|
|
|
clockStatistics,
|
|
|
|
|
punchInInfo,
|
|
|
|
|
monthTime,
|
|
|
|
|
reportShow,
|
|
|
|
|
} = this.state;
|
|
|
|
|
return (
|
|
|
|
|
<Block>
|
|
|
|
|
<Navbar isBack titleSlot='护理报告'></Navbar>
|
|
|
|
|
@ -292,10 +313,10 @@ delImg(i) {
|
|
|
|
|
</View>
|
|
|
|
|
{/* </block> */}
|
|
|
|
|
</View>
|
|
|
|
|
<View className='main m-x-30'>
|
|
|
|
|
<View className='products_item' style='border: none'>
|
|
|
|
|
<View className='products_top flex aitems'>
|
|
|
|
|
<View className='add_time'>{recordData.createTime}</View>
|
|
|
|
|
<View className="main m-x-30">
|
|
|
|
|
<View className="products_item" style="border: none">
|
|
|
|
|
<View className="products_top flex aitems">
|
|
|
|
|
<View className="add_time">{recordData?.createTime}</View>
|
|
|
|
|
<View
|
|
|
|
|
className={classnames("tag", {
|
|
|
|
|
tag_active: recordData.online === 2,
|
|
|
|
|
@ -395,13 +416,12 @@ delImg(i) {
|
|
|
|
|
</View>
|
|
|
|
|
{reportShow ? (
|
|
|
|
|
<View className='footer flex aitems'>
|
|
|
|
|
<View className='btn' onClick={this.setShow.bind(this, true)}>前往打卡</View>
|
|
|
|
|
<View className='btn' onClick={this.setShow.bind(this, true)}>
|
|
|
|
|
前往打卡
|
|
|
|
|
</View>
|
|
|
|
|
<View className='text flex aitems'>
|
|
|
|
|
<View onClick={this.GoIndex}>跳过</View>
|
|
|
|
|
<Image
|
|
|
|
|
src={require("@/img/right.png")}
|
|
|
|
|
mode='aspectFill'
|
|
|
|
|
></Image>
|
|
|
|
|
<Image src={require("@/img/right.png")} mode='aspectFill'></Image>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
) : null}
|
|
|
|
|
|