|
|
@@ -49,6 +49,7 @@ export default function Home2() {
|
|
|
const drawerWidth = 240;
|
|
|
const theme = useTheme();
|
|
|
const scrollRef = React.useRef(null);
|
|
|
+ const huizongRef = React.useRef(null);
|
|
|
const tableRef = React.useRef(null);
|
|
|
const deleteItem = React.useCallback(
|
|
|
(id, navigate) => () => {
|
|
|
@@ -287,7 +288,7 @@ export default function Home2() {
|
|
|
link.href = url;
|
|
|
|
|
|
// Set the link attributes for downloading
|
|
|
- link.setAttribute('download', value.concat('.xml'));
|
|
|
+ link.setAttribute('download', value.concat('.13jt'));
|
|
|
|
|
|
// Programmatically click the link to initiate the download
|
|
|
link.click();
|
|
|
@@ -295,7 +296,10 @@ export default function Home2() {
|
|
|
// Clean up the temporary URL
|
|
|
URL.revokeObjectURL(url);
|
|
|
setBopen(false);
|
|
|
- })
|
|
|
+ setTimeout(function() {
|
|
|
+ scrollRef.current = null;
|
|
|
+ }, 1000);
|
|
|
+ })
|
|
|
.catch(error => console.error(error));
|
|
|
}}
|
|
|
>
|
|
|
@@ -335,10 +339,11 @@ export default function Home2() {
|
|
|
console.log(value);
|
|
|
event.stopPropagation();
|
|
|
scrollRef.current = apiRef.current.getScrollPosition();
|
|
|
- setBopen(true);
|
|
|
- SimpleService.hebing(value).then(x=>{
|
|
|
- navigate('/editor/qingdan/'.concat(x));
|
|
|
- });
|
|
|
+ setDopen4(true);
|
|
|
+ huizongRef.current = value;
|
|
|
+ // SimpleService.hebing(value).then(x=>{
|
|
|
+ // navigate('/editor/qingdan/'.concat(x));
|
|
|
+ // });
|
|
|
}}
|
|
|
>
|
|
|
合并清单
|
|
|
@@ -476,6 +481,11 @@ export default function Home2() {
|
|
|
pageSize: 100,
|
|
|
page: 0,
|
|
|
});
|
|
|
+ const [sortModel, setSortModel] = React.useState([{
|
|
|
+ field: '创建时间',
|
|
|
+ sort: 'desc',
|
|
|
+ }]);
|
|
|
+
|
|
|
const handleFileChange = (event) => {
|
|
|
console.log(event.target.files);
|
|
|
const fd = new FormData();
|
|
|
@@ -642,6 +652,20 @@ const handleClose4 = () => {
|
|
|
scrollRef.current = null;
|
|
|
}, 1000);
|
|
|
};
|
|
|
+ const handleOpenHuizong = () => {
|
|
|
+ setBopen(true);
|
|
|
+ handleClose6();
|
|
|
+ SimpleService.hebing(huizongRef.current).then(x=>{
|
|
|
+ navigate('/editor/qingdan/'.concat(x));
|
|
|
+ });
|
|
|
+ };
|
|
|
+ const handleRefreshHuizong = () => {
|
|
|
+ setBopen(true);
|
|
|
+ handleClose6();
|
|
|
+ SimpleService.refresh(huizongRef.current).then(x=>{
|
|
|
+ navigate('/editor/qingdan/'.concat(huizongRef.current));
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
const handleDelete = () => {
|
|
|
setTimeout(function() {
|
|
|
@@ -780,6 +804,8 @@ const handleClose4 = () => {
|
|
|
disableColumnMenu={true}
|
|
|
paginationModel={paginationModel}
|
|
|
onPaginationModelChange={setPaginationModel}
|
|
|
+ sortModel={sortModel}
|
|
|
+ onSortModelChange={(newSortModel) => setSortModel(newSortModel)}
|
|
|
localeText={zhCN.components.MuiDataGrid.defaultProps.localeText}
|
|
|
/>
|
|
|
|
|
|
@@ -803,10 +829,10 @@ const handleClose4 = () => {
|
|
|
aria-describedby="alert-dialog-description"
|
|
|
>
|
|
|
|
|
|
- <DialogActions>
|
|
|
- <Button onClick={handleClose6}>打开汇总清单</Button>
|
|
|
- <Button onClick={handleClose6}>
|
|
|
- 更新原始清单
|
|
|
+ <DialogActions sx={{p: 4}}>
|
|
|
+ <Button variant="outlined" size="large" onClick={handleOpenHuizong}>打开合并清单</Button>
|
|
|
+ <Button variant="outlined" size="large" sx={{ml: 2}} onClick={handleRefreshHuizong}>
|
|
|
+ 更新初始清单
|
|
|
</Button>
|
|
|
</DialogActions>
|
|
|
</Dialog>
|