123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- import React from 'react';
- import { history, Link } from 'umi';
- import { Button, Popconfirm, message, Tooltip } from 'antd';
- import { PlusOutlined } from '@ant-design/icons';
- import { getList } from '@/services/cooperative';
- import { PageHeaderWrapper } from '@ant-design/pro-layout';
- import moment from 'moment';
- import PageTable from '@/components/PageTable';
-
- const formatterTime = (val) => {
- return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '';
- };
-
- export default (props) => {
- const actions = () => [
- <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => gotoEdit()}>
- 新增机构
- </Button>,
- ];
- const gotoEdit = (id) => {
- const queryStr = id ? `?id=${id}` : '';
- history.push(`./Cooperative/edit.jsx${queryStr}`);
- };
- const columns = [
- {
- title: '机构名',
- dataIndex: 'name',
- key: 'name',
- },
- {
- title: '联系人',
- dataIndex: 'contactPerson',
- key: 'contactPerson',
- },
- {
- title: '联系方式',
- dataIndex: 'phone',
- key: 'phone',
- },
- {
- title: '区域',
- dataIndex: 'regionId',
- key: 'regionId',
- },
- {
- title: '地址',
- dataIndex: 'address',
- key: 'address',
- search: false,
- },
-
- {
- title: '农机数',
- dataIndex: 'machineryNum',
- key: 'machineryNum',
- search: false,
- },
- {
- title: '员工数',
- dataIndex: 'employeesNum',
- key: 'employeesNum',
- search: false,
- },
- {
- title: '完成订单数',
- dataIndex: 'orderNum',
- key: 'orderNum',
- search: false,
- },
- {
- title: '评分',
- dataIndex: 'score',
- key: 'score',
- search: false,
- },
- {
- title: '操作',
- valueType: 'option',
- render: (_, record) => [
- <Link key={1} to={`./edit.jsx`}>
- 编辑
- </Link>,
- <Popconfirm
- key={2}
- title="您是否确认删除 ?"
- onConfirm={() => handleDelete(record.cooperativeId)}
- okText="确定"
- cancelText="取消"
- >
- <a href="#">删除</a>
- </Popconfirm>,
- ],
- },
- ];
- const handleDelete = () => {};
- return (
- <PageHeaderWrapper>
- <PageTable
- request={getList}
- // expfunc={exportPersonList}
- columns={columns}
- rowKey="cooperativeId"
- options={false}
- toolBarRender={actions}
- scroll={{ x: 1000 }}
- />
- </PageHeaderWrapper>
- );
- };
|