|
|
|
|
@ -81,16 +81,7 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
data["nursingId"] = ids;
|
|
|
|
|
}
|
|
|
|
|
let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data);
|
|
|
|
|
// // 获取echarts数据 这个是获取接口更新echarts页面
|
|
|
|
|
// let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids);
|
|
|
|
|
// let nursingData=JSON.parse(res2.data.data.nursingData)
|
|
|
|
|
// let obj ={
|
|
|
|
|
// modeName:res2.data.data.modeName,
|
|
|
|
|
// data:nursingData
|
|
|
|
|
// }
|
|
|
|
|
// this.init({
|
|
|
|
|
// obj:JSON.stringify(obj)
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
this.setState({ statistics: res.data.data });
|
|
|
|
|
}
|
|
|
|
|
@ -168,38 +159,13 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
res.data.data.reverse();
|
|
|
|
|
if (res.data.data.length > 0) {
|
|
|
|
|
res.data.data.map((item, index) => {
|
|
|
|
|
item.isMore = false;
|
|
|
|
|
item.detail = [];
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
item.isMore = true;
|
|
|
|
|
this.getList(item.id, item.year, item.month);
|
|
|
|
|
}
|
|
|
|
|
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 });
|
|
|
|
|
let clockStatistics = this.state.clockStatistics
|
|
|
|
|
clockStatistics=res.data.data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({ clockStatistics });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 获取当月打卡记录
|
|
|
|
|
@ -212,8 +178,7 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
|
|
|
|
|
this.state.clockStatistics.map((item) => {
|
|
|
|
|
console.log(item,'iiiiiiii',id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item.id === id) {
|
|
|
|
|
item.detail = res.data.data;
|
|
|
|
|
item.detail.map((obj) => {
|
|
|
|
|
@ -260,20 +225,17 @@ export default class Index extends Component<any, any> {
|
|
|
|
|
this.setState({ punchInInfo });
|
|
|
|
|
}
|
|
|
|
|
async getRouteId() {
|
|
|
|
|
let clockStatistics =this.state.clockStatistics
|
|
|
|
|
let punchInInfo =this.state.punchInInfo
|
|
|
|
|
const searchParams = new URLSearchParams(window.location.search);
|
|
|
|
|
const id = searchParams.get("id");
|
|
|
|
|
const recordId = searchParams.get("recordId");
|
|
|
|
|
this.getStatistics(id);
|
|
|
|
|
let res1 = await InstrumentInfo.apiClock.getLatestClockRecord();
|
|
|
|
|
|
|
|
|
|
let obj:any ={}
|
|
|
|
|
obj.detail = res1.data.data;
|
|
|
|
|
obj.updateTime = getdates(res1.data.data.updateTime).replace(/-/g, ".");
|
|
|
|
|
let arr:any =[]
|
|
|
|
|
arr.push(obj)
|
|
|
|
|
punchInInfo.clockContent =res1.data.data.clockContent
|
|
|
|
|
punchInInfo.clockImageList =res1.data.data.clockImg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({ clockStatistics:arr });
|
|
|
|
|
this.setState({ punchInInfo });
|
|
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
|
|
|
|
|
@ -302,7 +264,7 @@ setTimeout(function() {
|
|
|
|
|
}
|
|
|
|
|
this.init(options)
|
|
|
|
|
this.getRouteId();
|
|
|
|
|
// this.getClockStatistics()
|
|
|
|
|
this.getClockStatistics()
|
|
|
|
|
}
|
|
|
|
|
init(options){
|
|
|
|
|
|
|
|
|
|
|