|
@@ -1,6 +1,8 @@
|
|
|
-import { queryConditionSnapshot, queryEnergy } from '@/services/SmartOps';
|
|
|
+import { getComparisonData } from '@/services/OperationManagement';
|
|
|
+import { queryConditionSnapshot } from '@/services/SmartOps';
|
|
|
import { LoadingOutlined } from '@ant-design/icons';
|
|
|
import { connect, history, useParams, useRequest } from '@umijs/max';
|
|
|
+import dayjs from 'dayjs';
|
|
|
import { useEffect } from 'react';
|
|
|
import CircleScore from '../Smart/components/CircleScore';
|
|
|
import styles from './index.less';
|
|
@@ -176,9 +178,21 @@ const Electric = (props) => {
|
|
|
// 药耗监测
|
|
|
const Medicine = () => {
|
|
|
const { projectId } = useParams();
|
|
|
+ const time = dayjs().format('YYYY-MM');
|
|
|
|
|
|
- const { data } = useRequest(queryEnergy, {
|
|
|
- defaultParams: [Number(projectId)],
|
|
|
+ const { data } = useRequest(getComparisonData, {
|
|
|
+ defaultParams: [
|
|
|
+ {
|
|
|
+ project_id: projectId,
|
|
|
+ start: time,
|
|
|
+ end: time,
|
|
|
+ type: 1,
|
|
|
+ flag: 1,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ formatResult(res) {
|
|
|
+ return res[0];
|
|
|
+ },
|
|
|
});
|
|
|
return (
|
|
|
<Box
|
|
@@ -187,8 +201,8 @@ const Medicine = () => {
|
|
|
>
|
|
|
<ul>
|
|
|
<li>
|
|
|
- <div className={styles.value}>{data?.medicine}kg</div>
|
|
|
- <div className={styles.name}>总药耗</div>
|
|
|
+ <div className={styles.value}>{data?.value?.toFixed(2) || '-'}元</div>
|
|
|
+ <div className={styles.name}>当月吨水药成本</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</Box>
|