|
|
@ -32,25 +32,39 @@ const Information = (props) => { |
|
|
|
console.log(res2,'res2') |
|
|
|
setshijiandata(res2?.payload?.data) |
|
|
|
setxunjiandata(res2?.payload?.data.filter(i=>parseInt(moment().format('YYYYMMDD'))=== parseInt(moment(i.inspectionTime ).format('YYYYMMDD')))) |
|
|
|
const count = res?.payload?.data?.rows?.filter(i=>{ |
|
|
|
let num = 0 |
|
|
|
res?.payload?.data?.rows?.map(i=>{ |
|
|
|
// console.log(i?.frequency?.match(/^[0-9]*$/),'jjj')
|
|
|
|
if(i?.frequency.split('/')[i?.frequency.split('/').length-1]==='天'){ |
|
|
|
if(i?.frequency.split('/')[i?.frequency.split('/').length-1]==='天' && parseInt(moment().format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))){ |
|
|
|
// console.log(i?.frequency?.match(/[\d.]/g).join(''),'jjj')
|
|
|
|
return parseInt(moment().format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD')) |
|
|
|
num = num + parseInt(i?.frequency?.match(/[\d.]/g).join('')) |
|
|
|
// return parseInt(moment().format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))
|
|
|
|
// console.log('是的',i?.frequency.split('/')[i?.frequency.split('/').length-1])
|
|
|
|
}else if(i?.frequency.split('/')[i?.frequency.split('/').length-1]==='周'){ |
|
|
|
}else if(i?.frequency.split('/')[i?.frequency.split('/').length-1]==='周'){ |
|
|
|
if(parseInt(moment().format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))&&res2?.payload?.data?.filter(j=>j.patrolPlanId===i.id |
|
|
|
&&moment(j.inspectionTim).week()===moment().week()).length<parseInt(i?.frequency?.match(/[\d.]/g).join(''))){ |
|
|
|
num = num + (parseInt(i?.frequency?.match(/[\d.]/g).join('')) - res2?.payload?.data?.filter(j=>j.patrolPlanId===i.id |
|
|
|
&&moment(j.inspectionTim).week()===moment().week()).length) |
|
|
|
} |
|
|
|
// console.log(i?.frequency?.match(/^[0-9]*$/),'jjj')
|
|
|
|
return parseInt(moment().format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))&&res2?.payload?.data?.filter(j=>j.patrolPlanId===i.id |
|
|
|
&&moment(j.inspectionTim).week()===moment().week()).length<parseInt(i?.frequency?.match(/[\d.]/g).join('')) |
|
|
|
|
|
|
|
// return parseInt(moment().format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))&&res2?.payload?.data?.filter(j=>j.patrolPlanId===i.id
|
|
|
|
// &&moment(j.inspectionTim).week()===moment().week()).length<parseInt(i?.frequency?.match(/[\d.]/g).join(''))
|
|
|
|
} |
|
|
|
else if(i?.frequency.split('/')[i?.frequency.split('/').length-1]==='月'){ |
|
|
|
else if(i?.frequency.split('/')[i?.frequency.split('/').length-1]==='月'){ |
|
|
|
if(parseInt(moment().format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))&&res2?.payload?.data?.filter(j=>j.patrolPlanId===i.id |
|
|
|
&&moment(j.inspectionTim).month()===moment().month()).length<parseInt(i?.frequency?.match(/[\d.]/g).join(''))){ |
|
|
|
num = num+ (parseInt(i?.frequency?.match(/[\d.]/g).join('')) - res2?.payload?.data?.filter(j=>j.patrolPlanId===i.id |
|
|
|
&&moment(j.inspectionTim).month()===moment().month()).length) |
|
|
|
} |
|
|
|
// console.log(i?.frequency?.match(/^[0-9]*$/),'jjj')
|
|
|
|
return parseInt(moment().format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))&&res2?.payload?.data?.filter(j=>j.patrolPlanId===i.id |
|
|
|
&&moment(j.inspectionTim).month()===moment().month()).length<parseInt(i?.frequency?.match(/[\d.]/g).join('')) |
|
|
|
// num = num+
|
|
|
|
// return parseInt(moment().format('YYYYMMDD'))<=parseInt(moment(i.endTime).format('YYYYMMDD'))&&res2?.payload?.data?.filter(j=>j.patrolPlanId===i.id
|
|
|
|
// &&moment(j.inspectionTim).month()===moment().month()).length<parseInt(i?.frequency?.match(/[\d.]/g).join(''))
|
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(count,'count') |
|
|
|
setplandata(count) |
|
|
|
console.log(num,'count') |
|
|
|
setplandata(num) |
|
|
|
console.log(res,'res') |
|
|
|
|
|
|
|
|
|
|
@ -71,24 +85,24 @@ const Information = (props) => { |
|
|
|
arr1.push({ name: l.point?.name, value: 1 }) |
|
|
|
} |
|
|
|
} else {//修好了
|
|
|
|
let ext4 = arr4.find(a => a.name === l.point.name); |
|
|
|
let ext4 = arr4.find(a => a?.name === l?.point?.name); |
|
|
|
if (ext4) { |
|
|
|
ext4.cost += parseFloat(l.patrolRecordIssueHandles[0]?.cost); |
|
|
|
} else { |
|
|
|
arr4.push({ name: l.point.name, cost: parseFloat(l.patrolRecordIssueHandles[0]?.cost) }) |
|
|
|
arr4.push({ name: l?.point?.name, cost: parseFloat(l?.patrolRecordIssueHandles[0]?.cost) }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//右上
|
|
|
|
let ext2 = arr2.find(a => a.name === l.point.name); |
|
|
|
let ext2 = arr2.find(a => a?.name === l?.point?.name); |
|
|
|
if (ext2) { |
|
|
|
ext2.num++; |
|
|
|
if(repairOk){ |
|
|
|
ext2.repairNum += l.patrolRecordIssueHandles[0]?.yanshoucishu; |
|
|
|
} |
|
|
|
} else { |
|
|
|
let repairNum = repairOk ? l.patrolRecordIssueHandles[0]?.yanshoucishu : 0; |
|
|
|
arr2.push({ name: l.point.name, num: 1, repairNum }) |
|
|
|
let repairNum = repairOk ? l?.patrolRecordIssueHandles[0]?.yanshoucishu : 0; |
|
|
|
arr2?.push({ name: l?.point?.name, num: 1, repairNum }) |
|
|
|
} |
|
|
|
}) |
|
|
|
arr1.sort((a, b) => b.value - a.value); |
|
|
@ -107,7 +121,7 @@ const Information = (props) => { |
|
|
|
<div className='shouyetopitem'> |
|
|
|
<div className='shouyetopitem-left' > |
|
|
|
<div>今日巡检</div> |
|
|
|
<div>{planedata.length}</div> |
|
|
|
<div>{planedata}</div> |
|
|
|
</div> |
|
|
|
<div className='shouyetopitem-right'> |
|
|
|
<div>完成巡检:{xunjiandata.length}个</div> |
|
|
|