|
|
|
|
@ -2,17 +2,22 @@ import Taro from "@tarojs/taro";
|
|
|
|
|
import classnames from "classnames";
|
|
|
|
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
|
|
|
|
import { Progress } from "@antmjs/vantui";
|
|
|
|
|
import { showModal } from "../../utils/traoAPI";
|
|
|
|
|
import { showModal } from "@/utils/traoAPI";
|
|
|
|
|
import { Tab, Tabs, Dialog, Popup } from "@antmjs/vantui";
|
|
|
|
|
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 { date, getdates, previewImage } from "@/utils/util";
|
|
|
|
|
|
|
|
|
|
/** 自定义组件 **/
|
|
|
|
|
import Navbar from "../../components/navbar/navbar";
|
|
|
|
|
import PopupAlert from "../../components/popup/popup-alert";
|
|
|
|
|
import { InstrumentInfo } from "../../utils/Interface";
|
|
|
|
|
import Navbar from "@/components/navbar/navbar";
|
|
|
|
|
import { InstrumentInfo } from "@/utils/Interface";
|
|
|
|
|
|
|
|
|
|
/** 自定义组件 **/
|
|
|
|
|
import "./face_report.less";
|
|
|
|
|
@ -21,8 +26,8 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
reportShow:true,
|
|
|
|
|
name: "template模板页",
|
|
|
|
|
reportShow: true,
|
|
|
|
|
name: "护理报告",
|
|
|
|
|
statistics: {},
|
|
|
|
|
recordList: [],
|
|
|
|
|
recordData: {},
|
|
|
|
|
@ -50,9 +55,9 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() { }
|
|
|
|
|
componentDidMount() {}
|
|
|
|
|
|
|
|
|
|
componentWillUnmount() { }
|
|
|
|
|
componentWillUnmount() {}
|
|
|
|
|
|
|
|
|
|
// 打开/关闭弹窗
|
|
|
|
|
setShow(show: boolean) {
|
|
|
|
|
@ -100,7 +105,9 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
// 文本框输入文字
|
|
|
|
|
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,24 +130,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
|
|
|
|
|
})
|
|
|
|
|
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) => {
|
|
|
|
|
@ -198,8 +203,8 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
this.setState({ clockStatistics: this.state.clockStatistics });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 上传图片
|
|
|
|
|
handleChooseImage() {
|
|
|
|
|
// 上传图片
|
|
|
|
|
handleChooseImage() {
|
|
|
|
|
Taro.chooseMedia({
|
|
|
|
|
count: 1,
|
|
|
|
|
mediaType: ["image"],
|
|
|
|
|
@ -226,13 +231,13 @@ handleChooseImage() {
|
|
|
|
|
console.info("err", err);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 删除打卡图片
|
|
|
|
|
delImg(i) {
|
|
|
|
|
}
|
|
|
|
|
// 删除打卡图片
|
|
|
|
|
delImg(i) {
|
|
|
|
|
const punchInInfo = this.state.punchInInfo;
|
|
|
|
|
punchInInfo.clockImageList.splice(i, 1);
|
|
|
|
|
this.setState({ punchInInfo });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
getRouteId() {
|
|
|
|
|
const searchParams = new URLSearchParams(window.location.search);
|
|
|
|
|
const id = searchParams.get("id");
|
|
|
|
|
@ -253,31 +258,41 @@ delImg(i) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async onLoad(options) {
|
|
|
|
|
console.log(options,'查看传过来的参数');
|
|
|
|
|
console.log(options, "查看传过来的参数");
|
|
|
|
|
|
|
|
|
|
let Bool = JSON.parse(options?.report)
|
|
|
|
|
if(!Bool ){
|
|
|
|
|
let Bool = JSON.parse(options?.report);
|
|
|
|
|
if (!Bool) {
|
|
|
|
|
this.setState({
|
|
|
|
|
reportShow:Bool
|
|
|
|
|
})
|
|
|
|
|
reportShow: Bool,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.getRouteId();
|
|
|
|
|
this.getClockStatistics()
|
|
|
|
|
this.getClockStatistics();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidShow() { }
|
|
|
|
|
componentDidShow() {}
|
|
|
|
|
|
|
|
|
|
componentDidHide() { }
|
|
|
|
|
componentDidHide() {}
|
|
|
|
|
|
|
|
|
|
async initData() { }
|
|
|
|
|
async initData() {}
|
|
|
|
|
|
|
|
|
|
GoIndex = () => {
|
|
|
|
|
Taro.switchTab({ url: "/pages/index/index" });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
@ -398,21 +413,20 @@ 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}
|
|
|
|
|
) : null}
|
|
|
|
|
<Popup show={show} onClose={() => this.setState({ show: false })}>
|
|
|
|
|
<View className="popBox">
|
|
|
|
|
<Image
|
|
|
|
|
className="close_icon"
|
|
|
|
|
src={require("../../img/close.png")}
|
|
|
|
|
src={require("@/img/close.png")}
|
|
|
|
|
mode="widthFix"
|
|
|
|
|
onClick={this.setShow.bind(this, false)}
|
|
|
|
|
></Image>
|
|
|
|
|
@ -432,7 +446,7 @@ delImg(i) {
|
|
|
|
|
<Image className="showImg" src={item} mode="widthFix"></Image>
|
|
|
|
|
<Image
|
|
|
|
|
className="closeImg"
|
|
|
|
|
src={require("../../img/close1.png")}
|
|
|
|
|
src={require("@/img/close1.png")}
|
|
|
|
|
mode="widthFix"
|
|
|
|
|
onClick={this.delImg.bind(this, index)}
|
|
|
|
|
></Image>
|
|
|
|
|
@ -445,7 +459,7 @@ delImg(i) {
|
|
|
|
|
>
|
|
|
|
|
<Image
|
|
|
|
|
className="showImg"
|
|
|
|
|
src={require("../../img/clock_in_upload/add-image.png")}
|
|
|
|
|
src={require("@/img/clock_in_upload/add-image.png")}
|
|
|
|
|
mode="widthFix"
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|