Commit f02065e050df75e5358698ca05da22b279c87395

Authored by jiangwei
1 parent 50fcf689

界面改动

src/pages/finance/Reimburse/FieldService/components/FeeModal.tsx
@@ -28,9 +28,9 @@ export default function Index(props: Props) { @@ -28,9 +28,9 @@ export default function Index(props: Props) {
28 pagination={false} 28 pagination={false}
29 rowKey={r => `${r.id}`} 29 rowKey={r => `${r.id}`}
30 > 30 >
31 - <Table.Column title="早餐(元)" dataIndex="breakfast" />  
32 - <Table.Column title="午餐(元)" dataIndex="lunch" />  
33 - <Table.Column title="晚餐(元)" dataIndex="dinner" /> 31 + <Table.Column title="早餐(元)" dataIndex="breakfast" render={(text: any, record: any) => (text ? `${text}元/次` : "")} />
  32 + <Table.Column title="午餐(元)" dataIndex="lunch" render={(text: any, record: any) => (text ? `${text}元/次` : "")} />
  33 + <Table.Column title="晚餐(元)" dataIndex="dinner" render={(text: any, record: any) => (text ? `${text}元/次` : "")} />
34 </Table> 34 </Table>
35 </Modal> 35 </Modal>
36 ); 36 );
src/pages/finance/Reimburse/FieldService/index.tsx
1 import useInitial from "@/hooks/useInitail"; 1 import useInitial from "@/hooks/useInitail";
2 import { PageHeaderWrapper } from "@ant-design/pro-layout"; 2 import { PageHeaderWrapper } from "@ant-design/pro-layout";
3 -import { Button, Card, Row, Table } from "antd"; 3 +import { Button, Card, Row, Table, Popconfirm, message } from "antd";
4 import React, { useState } from "react"; 4 import React, { useState } from "react";
5 import * as API from "./api"; 5 import * as API from "./api";
6 import Modal from "./components/Modal"; 6 import Modal from "./components/Modal";
@@ -24,6 +24,17 @@ const CateringSubsidies = () =&gt; { @@ -24,6 +24,17 @@ const CateringSubsidies = () =&gt; {
24 setCurrent(undefined); 24 setCurrent(undefined);
25 }; 25 };
26 26
  27 + const onDelete = (row: any) => {
  28 + API.deleteApi(row.id)
  29 + .then((res) => {
  30 + message.success("删除成功");
  31 + setLoading(true);
  32 + })
  33 + .catch((err) => {
  34 + message.error("删除失败", err);
  35 + });
  36 + };
  37 +
27 return ( 38 return (
28 <PageHeaderWrapper title="外勤报销"> 39 <PageHeaderWrapper title="外勤报销">
29 <Card> 40 <Card>
@@ -53,6 +64,16 @@ const CateringSubsidies = () =&gt; { @@ -53,6 +64,16 @@ const CateringSubsidies = () =&gt; {
53 <Button type="link" onClick={() => onEdit(row)}> 64 <Button type="link" onClick={() => onEdit(row)}>
54 编辑 65 编辑
55 </Button> 66 </Button>
  67 + <Popconfirm
  68 + title="是否删除"
  69 + onConfirm={() => onDelete(row)}
  70 + okText="确定"
  71 + cancelText="取消"
  72 + >
  73 + <Button type="link" danger>
  74 + 删除
  75 + </Button>
  76 + </Popconfirm>
56 </div> 77 </div>
57 )} 78 )}
58 /> 79 />