+
{
-
+
}
{
onChange={onChangepage}
showSizeChanger={false}
/>
-
- deleteRecipePage()}
- okText="确定"
- cancelText="取消"
- >
-
-
+ {
+ codeList.includes("recipeInfoPageAdd") ?
+ : ""
+ }
+ {
+ codeList.includes("recipeInfoPageDel") ?
+ deleteRecipePage()}
+ okText="确定"
+ cancelText="取消"
+ >
+
+ : ""
+ }
diff --git a/src/pages/recipe/recipeinfo/service.js b/src/pages/recipe/recipeinfo/service.js
index 4bfa115..e92b5b1 100644
--- a/src/pages/recipe/recipeinfo/service.js
+++ b/src/pages/recipe/recipeinfo/service.js
@@ -91,4 +91,9 @@ export default {
method: 'Get',
});
},
+ GetBasicRoleCode() {
+ return request(getDataBaseUrl() + `/api/roles/getBasicRoleCode`, {
+ method: 'Get',
+ });
+ },
}
\ No newline at end of file
diff --git a/src/pages/report/batchingreport/index.jsx b/src/pages/report/batchingreport/index.jsx
index d8575c7..56aa3c6 100644
--- a/src/pages/report/batchingreport/index.jsx
+++ b/src/pages/report/batchingreport/index.jsx
@@ -1,46 +1,56 @@
import { PageContainer } from "@ant-design/pro-layout";
-import { Tabs, Card, Input, DatePicker, Button } from "antd"
+import { Tabs, Card, Input, DatePicker, Button, Select } from "antd"
import ProTable from '@ant-design/pro-table';
import React, { useState, useEffect } from 'react';
import moment from 'moment';
import api from "../service";
const { RangePicker } = DatePicker;
-const batchingreport = () =>{
+const batchingreport = () => {
const [tabIndex, setTabIndex] = useState(1);
const [batchingName, setBatchingName] = useState('');
const [storeName, setStoreName] = useState('');
const [deviceName, setDeviceName] = useState('');
+ const [isWeight, setIsWeight] = useState();
const [dataSource, setDataSource] = useState([]);
+ const [loading, setLoading] = useState(false);
const [timeRange, setTimeRange] = useState([
- moment(moment(new Date(Date.now())).format('YYYY-MM-DD 00:00:00')),
- moment(moment(new Date(Date.now())).format('YYYY-MM-DD 23:59:59')),
+ moment().startOf('month'),
+ moment().endOf('month'),
]);
+ const isWeightList = [
+ { value: false, label: '标准模式' },
+ { value: true, label: '称重模式' },
+ ];
useEffect(() => {
initData();
}, [tabIndex]);
const initData = async () => {
+ setLoading(true)
var data = [];
if (tabIndex == 1) {
- data = await api.getBatchingUseSummary({ "batchingName": batchingName, "startTime": timeRange[0]._i, "endTime": timeRange[1]._i, "storeName": storeName, "deviceName": deviceName });
+ data = await api.getBatchingUseSummary({ "batchingName": batchingName, "startTime": timeRange[0]._i, "endTime": timeRange[1]._i, "storeName": storeName, "deviceName": deviceName, "isWeight": isWeight });
}
setDataSource(data.data)
+ setLoading(false)
}
const resetRequest = async () => {
+ setLoading(true)
setBatchingName('')
setStoreName('')
setDeviceName('')
- var startDate = moment(new Date(Date.now())).format('YYYY-MM-DD 00:00:00');
- var endDate = moment(new Date(Date.now())).format('YYYY-MM-DD 23:59:59');
- setTimeRange([moment(startDate),moment(endDate)])
+ var startDate = moment().startOf('month');
+ var endDate = moment().endOf('month');
+ setTimeRange([startDate, endDate])
var data = []
if (tabIndex == 1) {
- data = await api.getBatchingUseSummary({ "batchingName": "", "startTime": startDate, "endTime": endDate, "storeName": "", "deviceName": "" });
+ data = await api.getBatchingUseSummary({ "batchingName": "", "startTime": startDate, "endTime": endDate, "storeName": "", "deviceName": "", "isWeight": "" });
}
setDataSource(data.data)
+ setLoading(false)
}
const summaryColumns = [
{
@@ -75,12 +85,12 @@ const batchingreport = () =>{
ellipsis: true,
},
]
- return(
+ return (
@@ -90,14 +100,25 @@ const batchingreport = () =>{
{ setStoreName(a.target.value) }} />
设备名称:
{ setDeviceName(a.target.value) }} />
+ 配方模式:
+
使用时间:
{
- let tempDate = [
- moment(moment(new Date(dateStrings[0])).format('YYYY-MM-DD HH:mm:ss')),
- moment(moment(new Date(dateStrings[1])).format('YYYY-MM-DD HH:mm:ss')),
- ]
+ let tempDate = ['', '']
+ if (date != null) {
+ tempDate = [
+ moment(moment(new Date(dateStrings[0])).format('YYYY-MM-DD HH:mm:ss')),
+ moment(moment(new Date(dateStrings[1])).format('YYYY-MM-DD HH:mm:ss')),
+ ]
+ }
setTimeRange(tempDate);
}} />
使用时间:
{
- let tempDate = [
- moment(moment(new Date(dateStrings[0])).format('YYYY-MM-DD HH:mm:ss')),
- moment(moment(new Date(dateStrings[1])).format('YYYY-MM-DD HH:mm:ss')),
- ]
+ let tempDate = ['', '']
+ if (date != null) {
+ tempDate = [
+ moment(moment(new Date(dateStrings[0])).format('YYYY-MM-DD HH:mm:ss')),
+ moment(moment(new Date(dateStrings[1])).format('YYYY-MM-DD HH:mm:ss')),
+ ]
+ }
setTimeRange(tempDate);
}} />