修改bug

master
qsj 2 years ago
parent ffb4910983
commit 73e792cabb

@ -67,9 +67,9 @@ export default class Index extends Component<any, any> {
async getStatistics(id) {
let data = {};
if (id != null) {
data["instrumentId"] = id;
data["nursingId"] = id;
}
let res = await InstrumentInfo.apiNursingLog.getStatistics(data);
let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data);
if (res.data.code === 200) {
this.setState({ statistics: res.data.data });
@ -193,7 +193,6 @@ export default class Index extends Component<any, any> {
};
let res = await InstrumentInfo.apiClock.getList(data);
if (res.data.code === 200) {
console.log(this.state.clockStatistics, 88888);
this.state.clockStatistics.map((item) => {
if (item.id === id) {
@ -241,12 +240,20 @@ export default class Index extends Component<any, any> {
punchInInfo.clockImageList.splice(i, 1);
this.setState({ punchInInfo });
}
getRouteId() {
async getRouteId() {
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);
this.getRecord(id, recordId);
let res1 = await InstrumentInfo.apiClock.getLatestClockRecord();
punchInInfo.clockContent =res1.data.data.clockContent
punchInInfo.clockImageList =res1.data.data.clockImg
this.setState({ punchInInfo });
// 获取图片和文本
console.log(recordId);
}
getTime(time) {
@ -262,7 +269,7 @@ export default class Index extends Component<any, any> {
}
async onLoad(options) {
console.log(options, "查看传过来的参数");
let Bool = JSON.parse(options?.report);
if (!Bool) {
this.setState({

@ -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){

Loading…
Cancel
Save