|
@@ -2,7 +2,7 @@ import React from 'react';
|
2
|
2
|
import { Link } from 'react-router-dom';
|
3
|
3
|
import useBool from '@/utils/hooks/useBool';
|
4
|
4
|
import { Table, Space, Button, Row, Col, Card } from 'antd';
|
5
|
|
-import { getTaCheckItem } from '@/service/tacheckitem';
|
|
5
|
+import { getTaCheckItem, exportTaCheckItem } from '@/service/tacheckitem';
|
6
|
6
|
import QuList from './QuList';
|
7
|
7
|
import LocForm from './LocForm';
|
8
|
8
|
import styles from './style.module.less';
|
|
@@ -14,6 +14,7 @@ export default (props) => {
|
14
|
14
|
const [curItem, setCurItem] = React.useState();
|
15
|
15
|
const [loading, startLoading, stopLoading] = useBool();
|
16
|
16
|
const [open, setOpen] = React.useState(false);
|
|
17
|
+ const [expLoading, startExpLoading, stopExpLoading] = useBool();
|
17
|
18
|
|
18
|
19
|
const columns = [
|
19
|
20
|
{
|
|
@@ -107,6 +108,15 @@ export default (props) => {
|
107
|
108
|
setOpen(true);
|
108
|
109
|
}
|
109
|
110
|
|
|
111
|
+ const onExport = () => {
|
|
112
|
+ startExpLoading();
|
|
113
|
+ exportTaCheckItem(checkId).then(() => {
|
|
114
|
+ stopExpLoading();
|
|
115
|
+ }).catch(() => {
|
|
116
|
+ stopExpLoading();
|
|
117
|
+ });
|
|
118
|
+ }
|
|
119
|
+
|
110
|
120
|
const onChange = (item) => {
|
111
|
121
|
const newList = list.map(x => x.itemId === item.itemId ? item : x);
|
112
|
122
|
setList(newList);
|
|
@@ -130,7 +140,7 @@ export default (props) => {
|
130
|
140
|
return (
|
131
|
141
|
<Row gutter={24}>
|
132
|
142
|
<Col span={12}>
|
133
|
|
- <Card>
|
|
143
|
+ <Card extra={<Button loading={expLoading} type="primary" onClick={onExport}>导出</Button>}>
|
134
|
144
|
<Table
|
135
|
145
|
sticky
|
136
|
146
|
summary={() => (
|