Browse Source

Merge branch 'master' of lizhiqi/yongxu-web into master

lizhiqi 1 year ago
parent
commit
9b480445ef

+ 36 - 7
config/routes.ts

@@ -107,13 +107,6 @@
     icon: 'Appstore',
     component: './RoleManagement',
   },
-  // 报备管理
-  {
-    path: '/ReportingManagement',
-    name: '报备管理',
-    icon: 'Appstore',
-    component: './ReportingManagement',
-  },
   {
     path: '/ParameterConfiguration',
     name: '参数配置',
@@ -146,6 +139,42 @@
     icon: 'Appstore',
     component: './DeviceFaults',
   },
+  // banner图管理
+  {
+    path: '/banner',
+    name: 'banner图管理',
+    icon: 'Appstore',
+    component: './BannerManagement',
+  },
+  //  报备管理
+  {
+    path: '/reporting',
+    name: '经销商报备管理',
+    icon: 'Appstore',
+    routes: [
+      // 小区管理
+      {
+        path: '/reporting/community',
+        name: '小区管理',
+        icon: 'Appstore',
+        component: './CommunityManagement',
+      },
+      // 工程项目报备
+      {
+        path: '/reporting/project',
+        name: '工程报备',
+        icon: 'Appstore',
+        component: './ReportingManagement',
+      },
+      // 零售报备
+      {
+        path: '/reporting/home',
+        name: '零售报备',
+        icon: 'Appstore',
+        component: './ReportHomeManagement',
+      },
+    ],
+  },
   // 房间列表
   {
     path: '/roomList',

+ 160 - 0
src/pages/BannerManagement/edit.tsx

@@ -0,0 +1,160 @@
+import React, { useState } from 'react';
+import { Col, Form, Input, InputNumber, message, Modal, Row, Select } from 'antd';
+import UploadImage from '@/components/UploadImage';
+import { createBanner, updateBanner } from '@/services/banner';
+
+interface editProps {
+  visible: boolean;
+  editCallback: () => void;
+  params: any;
+}
+
+const Edit: React.FC<editProps> = (props) => {
+  const { params, visible, editCallback } = props;
+  const [form] = Form.useForm();
+  const [filesList, setFilesList] = useState([]);
+
+  const onOk = () => {
+    form.validateFields().then((values) => {
+      const data = { ...values };
+      data.banner_items = filesList;
+      if (params) {
+        updateBanner(data, params.record_id)
+          .then((res) => {
+            if (res.code === 0) {
+              message.success('编辑成功');
+              editCallback();
+            } else {
+              message.error(res?.message);
+              editCallback();
+            }
+          })
+          .catch((e) => {
+            message.error(e?.message);
+            editCallback();
+          });
+      } else {
+        createBanner(data)
+          .then((res) => {
+            if (res.code === 0) {
+              message.success('新增成功');
+              editCallback();
+            } else {
+              message.error(res?.message);
+              editCallback();
+            }
+          })
+          .catch((e) => {
+            message.error(e?.message);
+            editCallback();
+          });
+      }
+    });
+  };
+
+  const onCancel = () => {
+    editCallback();
+  };
+
+  // 上传图片回调
+  const onUploadChange = (files: any) => {
+    if (files && files.length) {
+      const arr: any = [];
+      files.forEach((el: any) => {
+        arr.push({ url: el?.response?.data?.url });
+      });
+      setFilesList(arr);
+    }
+  };
+
+  const formItemLayout = {
+    labelCol: {
+      span: 6,
+    },
+    wrapperCol: {
+      span: 18,
+    },
+  };
+
+  return (
+    <Modal
+      title={`${params ? '编辑' : '新增'}`}
+      open={visible}
+      onOk={onOk}
+      onCancel={onCancel}
+      width={800}
+    >
+      <Form form={form}>
+        <Row>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="title"
+              label="标题"
+              rules={[{ required: true, message: '请输入标题' }]}
+              initialValue={params?.title}
+            >
+              <Input placeholder="请输入标题" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="type"
+              label="类型"
+              rules={[{ required: true, message: '请选择类型' }]}
+              initialValue={params?.type}
+            >
+              <Input placeholder="请输入类型" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="status"
+              label="状态"
+              rules={[{ required: true, message: '请选择状态' }]}
+              initialValue={params?.status}
+            >
+              <Select placeholder="请选择状态">
+                <Select.Option key={0} value={0}>
+                  停用
+                </Select.Option>
+                <Select.Option key={1} value={1}>
+                  启用
+                </Select.Option>
+              </Select>
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="sequence"
+              label="排序值"
+              rules={[{ required: true, message: '请输入排序值' }]}
+              initialValue={params?.sequence}
+            >
+              <InputNumber min={1} placeholder="请输入排序值" style={{ width: '100%' }} />
+            </Form.Item>
+          </Col>
+          <Col span={24}>
+            <Form.Item
+              {...formItemLayout}
+              name="banner_items"
+              label="上传图片"
+              rules={[{ required: true, message: '请选择图片' }]}
+              initialValue={params?.banner_items ? [{ url: params?.banner_items[0].url }] : []}
+            >
+              <UploadImage
+                maxCount={1}
+                onChange={onUploadChange}
+                value={[{ url: params?.banner_items ? params?.banner_items[0].url : '' }]}
+              />
+            </Form.Item>
+          </Col>
+        </Row>
+      </Form>
+    </Modal>
+  );
+};
+export default Edit;

+ 212 - 0
src/pages/BannerManagement/index.tsx

@@ -0,0 +1,212 @@
+import React, { useEffect, useState } from 'react';
+import { Button, Card, Form, Input, message, Modal, Space, Table } from 'antd';
+import { PlusCircleOutlined, ReloadOutlined, SearchOutlined } from '@ant-design/icons';
+import { PageContainer } from '@ant-design/pro-components';
+import type { ColumnsType } from 'antd/es/table';
+import Edit from './edit';
+import { delBanner, queryBanner } from '@/services/banner';
+
+interface DataType {
+  name: string;
+  level: string;
+  record_id: string;
+}
+
+const BannerManagement: React.FC = () => {
+  const [form] = Form.useForm();
+  const [loading, setLoading] = useState(false);
+  const [dataList, setDataList] = useState([]);
+  const [editData, setEditData] = useState(null);
+  const [visible, setVisible] = useState(false);
+  const [searchData, setSearchData] = useState<object | null>({});
+  const [pagination, setPagination] = useState({ total: 0, current: 1, pageSize: 10 });
+
+  //  获取列表数据
+  const getList = () => {
+    const params = {
+      q: 'page',
+      current: pagination.current,
+      pageSize: pagination.pageSize,
+      ...searchData,
+    };
+    queryBanner(params).then((res) => {
+      if (res && res.code === 0) {
+        setDataList(res.data.list || []);
+        setLoading(false);
+      }
+    });
+    setDataList([]);
+    setLoading(false);
+  };
+
+  useEffect(() => {
+    setLoading(true);
+    getList();
+  }, []);
+
+  const onFinish = () => {
+    form.validateFields().then((data) => {
+      setLoading(true);
+      setSearchData(data);
+    });
+  };
+
+  useEffect(() => {
+    getList();
+  }, [searchData]);
+
+  // 分页切换
+  const tableChange = () => {
+    setLoading(true);
+    const params = {
+      q: 'page',
+      current: pagination.current,
+      pageSize: pagination.pageSize,
+      ...searchData,
+    };
+    queryBanner(params).then((res) => {
+      if (res?.code === 0) {
+        setDataList(res?.data?.list || []);
+        setPagination(res.data.pagination);
+        setLoading(false);
+      }
+    });
+  };
+
+  // 重置
+  const onReset = () => {
+    form.resetFields();
+    setLoading(true);
+    setSearchData(null);
+  };
+
+  // 新增弹框打开
+  const onAdd = () => {
+    setEditData(null);
+    setVisible(true);
+  };
+
+  //  编辑弹框打开
+  const toEdit = (data: any) => {
+    setEditData(data);
+    setVisible(true);
+  };
+
+  //  编辑回调
+  const onEditCallback = () => {
+    setVisible(false);
+    getList();
+  };
+
+  //  删除
+  const toDel = (record: any) => {
+    Modal.confirm({
+      title: '删除',
+      content: `确认删除banner图:[${record.title}]`,
+      onOk: () => {
+        delBanner(record.record_id)
+          .then((res) => {
+            if (res.code === 0) {
+              message.success('删除成功');
+              getList();
+            } else {
+              message.error('删除失败');
+            }
+          })
+          .catch((e) => {
+            message.error(e?.message);
+          });
+      },
+    });
+  };
+
+  const columns: ColumnsType<DataType> = [
+    {
+      title: '序号',
+      align: 'center',
+      key: 'index',
+      render: (_: any, row: any, index: number) => index + 1,
+    },
+    {
+      title: '标题',
+      dataIndex: 'title',
+      key: 'title',
+    },
+    {
+      title: '类型',
+      dataIndex: 'type',
+      key: 'type',
+    },
+    {
+      title: '状态',
+      dataIndex: 'status',
+      key: 'status',
+      render: (_, record: any) => {
+        return <span>{{ 1: '停用', 2: '启用' }[record.status]}</span>;
+      },
+    },
+    {
+      title: '操作',
+      key: 'action',
+      render: (_, record) => (
+        <Space size="middle">
+          <a
+            onClick={() => {
+              toEdit(record);
+            }}
+          >
+            编辑
+          </a>
+          <a
+            style={{ color: 'red' }}
+            onClick={() => {
+              toDel(record);
+            }}
+          >
+            删除
+          </a>
+        </Space>
+      ),
+    },
+  ];
+
+  return (
+    <PageContainer>
+      <div>
+        <Card>
+          <Form form={form} layout="inline" onFinish={onFinish}>
+            <Form.Item name="name" label="区域名称">
+              <Input placeholder="请输入区域名称" />
+            </Form.Item>
+            <Form.Item style={{ marginBottom: '10px' }}>
+              <Space>
+                <Button type="primary" htmlType="submit">
+                  <SearchOutlined />
+                  查询
+                </Button>
+                <Button htmlType="button" onClick={onReset}>
+                  <ReloadOutlined />
+                  重置
+                </Button>
+              </Space>
+            </Form.Item>
+          </Form>
+          <Button htmlType="button" type="primary" style={{ margin: '20px 0' }} onClick={onAdd}>
+            <PlusCircleOutlined />
+            新增banner图
+          </Button>
+          <Table
+            columns={columns}
+            dataSource={dataList}
+            rowKey={(record) => record.record_id}
+            pagination={pagination}
+            loading={loading}
+            onChange={tableChange}
+          />
+          {visible && <Edit editCallback={onEditCallback} params={editData} visible={visible} />}
+        </Card>
+      </div>
+    </PageContainer>
+  );
+};
+export default BannerManagement;

+ 160 - 0
src/pages/CommunityManagement/edit.tsx

@@ -0,0 +1,160 @@
+import React, { useEffect, useState } from 'react';
+import { Cascader, Col, Form, Input, message, Modal, Row } from 'antd';
+import { cityQuery } from '@/services/ReportingManagement';
+import { createCommunity, updateCommunity } from '@/services/reporting/community';
+
+interface editProps {
+  visible: boolean;
+  editCallback: () => void;
+  params: any;
+}
+
+const { TextArea } = Input;
+
+/**
+ * 小区管理 - 编辑页面
+ * @param props
+ * @constructor
+ */
+const Edit: React.FC<editProps> = (props) => {
+  const { params, visible, editCallback } = props;
+  const [form] = Form.useForm();
+  const [cityList, setCityList] = useState([]);
+
+  useEffect(() => {
+    //  获取城市列表
+    cityQuery({ q: 'tree' }).then((res) => {
+      if (res?.code === 0) {
+        const arr = res?.data?.list;
+        setCityList(arr);
+      }
+    });
+  }, []);
+  const onOk = () => {
+    form.validateFields().then((values) => {
+      const data = { ...values };
+      if (params) {
+        data.record_id = params.record_id;
+        const cityInfo = values.city
+          .split('')
+          .filter((x: { charCodeAt: () => number }) => x.charCodeAt() != 32)
+          .join('')
+          .split('/');
+        data.province = cityInfo[0];
+        data.city = cityInfo[1];
+        data.district = cityInfo[2];
+        updateCommunity(data)
+          .then((res) => {
+            if (res.code === 0) {
+              message.success('新增成功');
+              editCallback();
+            } else {
+              message.error(res?.message);
+              editCallback();
+            }
+          })
+          .catch((e) => {
+            message.error(e?.message);
+            editCallback();
+          });
+      } else {
+        data.province = values.city[0];
+        data.city = values.city[1];
+        data.district = values.city[2];
+        createCommunity(data)
+          .then((res) => {
+            if (res.code === 0) {
+              message.success('编辑成功');
+              editCallback();
+            } else {
+              message.error(res?.message);
+              editCallback();
+            }
+          })
+          .catch((e) => {
+            message.error(e?.message);
+            editCallback();
+          });
+      }
+    });
+  };
+
+  const onCancel = () => {
+    editCallback();
+  };
+
+  const formItemLayout = {
+    labelCol: {
+      span: 6,
+    },
+    wrapperCol: {
+      span: 18,
+    },
+  };
+
+  const formItemLayout24 = {
+    labelCol: { span: 3 },
+    wrapperCol: { span: 21 },
+  };
+
+  return (
+    <Modal
+      title={`${params ? '编辑' : '新增'}`}
+      open={visible}
+      onOk={onOk}
+      onCancel={onCancel}
+      width={800}
+    >
+      <Form form={form}>
+        <Row>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="name"
+              label="小区名称"
+              rules={[{ required: true, message: '请输入小区名称' }]}
+              initialValue={params?.name}
+            >
+              <Input placeholder="请输入小区名称" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="city"
+              label="省市区"
+              rules={[{ required: true, message: '请选择省市区' }]}
+              initialValue={
+                params && JSON.stringify(params) !== '{}'
+                  ? `${params?.province}` +
+                    ' / ' +
+                    `${params?.city}` +
+                    ' / ' +
+                    `${params?.district}`
+                  : ''
+              }
+            >
+              <Cascader
+                options={cityList}
+                fieldNames={{ label: 'name', value: 'name', children: 'children' }}
+                placeholder="请选择省市区"
+              />
+            </Form.Item>
+          </Col>
+          <Col span={24}>
+            <Form.Item
+              {...formItemLayout24}
+              name="address"
+              label="详细地址"
+              initialValue={params?.address}
+              rules={[{ required: true, message: '请输入详细地址' }]}
+            >
+              <TextArea rows={3} placeholder="请输入详细地址" />
+            </Form.Item>
+          </Col>
+        </Row>
+      </Form>
+    </Modal>
+  );
+};
+export default Edit;

+ 212 - 0
src/pages/CommunityManagement/index.tsx

@@ -0,0 +1,212 @@
+import React, { useEffect, useState } from 'react';
+import { Button, Card, Form, Input, message, Modal, Space, Table } from 'antd';
+import { PlusCircleOutlined, ReloadOutlined, SearchOutlined } from '@ant-design/icons';
+import { PageContainer } from '@ant-design/pro-components';
+import type { ColumnsType } from 'antd/es/table';
+import { delCommunity, queryCommunity } from '@/services/reporting/community';
+import Edit from './edit';
+
+interface DataType {
+  name: string;
+  address: string;
+  created_name: string;
+  record_id: string;
+}
+
+const CommunityManagement: React.FC = () => {
+  const [form] = Form.useForm();
+  const [loading, setLoading] = useState(false);
+  const [dataList, setDataList] = useState([]);
+  const [searchData, setSearchData] = useState<object | null>({});
+  const [pagination, setPagination] = useState({ total: 0, current: 1, pageSize: 10 });
+  const [editData, setEditData] = useState(null);
+  const [visible, setVisible] = useState(false);
+
+  const getList = () => {
+    const params = {
+      q: 'page',
+      current: pagination.current,
+      pageSize: pagination.pageSize,
+      ...searchData,
+    };
+    queryCommunity(params).then((res) => {
+      if (res && res.code === 0) {
+        setDataList(res.data.list || []);
+        setLoading(false);
+      }
+    });
+  };
+
+  useEffect(() => {
+    setLoading(true);
+    getList();
+  }, []);
+
+  const onFinish = () => {
+    form.validateFields().then((data) => {
+      setLoading(true);
+      setSearchData(data);
+    });
+  };
+
+  const onReset = () => {
+    form.resetFields();
+    setLoading(true);
+    setSearchData(null);
+  };
+
+  useEffect(() => {
+    getList();
+  }, [searchData]);
+
+  // 分页切换
+  const tableChange = () => {
+    setLoading(true);
+    const params = {
+      q: 'page',
+      current: pagination.current,
+      pageSize: pagination.pageSize,
+      ...searchData,
+    };
+    queryCommunity(params).then((res) => {
+      if (res?.code === 0) {
+        setDataList(res?.data?.list || []);
+        setPagination(res.data.pagination);
+        setLoading(false);
+      }
+    });
+  };
+
+  //  新增弹框
+  const onAdd = () => {
+    setEditData(null);
+    setVisible(true);
+  };
+
+  const toEdit = (record: any) => {
+    setEditData(record);
+    setVisible(true);
+  };
+
+  //  编辑回调
+  const onEditCallback = () => {
+    setVisible(false);
+    getList();
+  };
+
+  const toDel = (record: any) => {
+    Modal.confirm({
+      title: '删除',
+      content: `确认删除菜单:[${record.name}]`,
+      onOk: () => {
+        delCommunity(record.record_id)
+          .then((res) => {
+            if (res.code === 0) {
+              message.success('删除成功');
+              getList();
+            } else {
+              message.error('删除失败');
+            }
+          })
+          .catch((e) => {
+            message.error(e?.message);
+          });
+      },
+    });
+  };
+
+  const columns: ColumnsType<DataType> = [
+    {
+      title: '序号',
+      align: 'center',
+      key: 'index',
+      render: (_: any, _row: any, index: number) => index + 1,
+    },
+    {
+      title: '小区名称',
+      dataIndex: 'name',
+      key: 'name',
+    },
+    {
+      title: '省市区',
+      dataIndex: 'city',
+      key: 'city',
+      render: (_, data: any) => (
+        <span>{`${data.province}` + ' ' + `${data.city}` + ' ' + `${data.district}`}</span>
+      ),
+    },
+    {
+      title: '详细地址',
+      dataIndex: 'address',
+      key: 'address',
+    },
+    {
+      title: '创建人',
+      dataIndex: 'created_name',
+      key: 'created_name',
+    },
+    {
+      title: '操作',
+      key: 'action',
+      render: (_, record) => (
+        <Space size="middle">
+          <a
+            onClick={() => {
+              toEdit(record);
+            }}
+          >
+            编辑
+          </a>
+          <a
+            style={{ color: 'red' }}
+            onClick={() => {
+              toDel(record);
+            }}
+          >
+            删除
+          </a>
+        </Space>
+      ),
+    },
+  ];
+
+  return (
+    <PageContainer>
+      <div>
+        <Card>
+          <Form form={form} layout="inline" onFinish={onFinish}>
+            <Form.Item name="like_name" label="小区名称">
+              <Input placeholder="请输入小区名称" />
+            </Form.Item>
+            <Form.Item style={{ marginBottom: '10px' }}>
+              <Space>
+                <Button type="primary" htmlType="submit">
+                  <SearchOutlined />
+                  查询
+                </Button>
+                <Button htmlType="button" onClick={onReset}>
+                  <ReloadOutlined />
+                  重置
+                </Button>
+              </Space>
+            </Form.Item>
+          </Form>
+          <Button htmlType="button" type="primary" style={{ margin: '20px 0' }} onClick={onAdd}>
+            <PlusCircleOutlined />
+            新增小区
+          </Button>
+          <Table
+            columns={columns}
+            dataSource={dataList}
+            rowKey={(record) => record.record_id}
+            pagination={pagination}
+            loading={loading}
+            onChange={tableChange}
+          />
+          {visible && <Edit editCallback={onEditCallback} params={editData} visible={visible} />}
+        </Card>
+      </div>
+    </PageContainer>
+  );
+};
+export default CommunityManagement;

+ 2 - 2
src/pages/MenuManagement/edit.tsx

@@ -15,7 +15,7 @@ import React, { useEffect, useState } from 'react';
 import IconSelector from '@/components/IconSelecter';
 import { createMenu, editMenu, queryMenu } from '@/services/menu';
 
-interface editPros {
+interface editProps {
   visible: boolean;
   editCallback: () => void;
   params: any;
@@ -26,7 +26,7 @@ interface editPros {
  * @param props
  * @constructor
  */
-const Edit: React.FC<editPros> = (props) => {
+const Edit: React.FC<editProps> = (props) => {
   const { params, visible, editCallback } = props;
   const [iconSelectorVisible, setIconSelectorVisible] = useState(false);
   const [form] = Form.useForm();

+ 88 - 0
src/pages/ReportHomeManagement/check.tsx

@@ -0,0 +1,88 @@
+import { Descriptions, Modal } from 'antd';
+import React from 'react';
+
+interface checkProps {
+  visible: boolean;
+  data: any;
+  checkCallback: () => void;
+}
+
+/**
+ * 零售报备查看弹框
+ * @param props
+ * @constructor
+ */
+const Check: React.FC<checkProps> = (props) => {
+  const { visible, data, checkCallback } = props;
+
+  const onOk = () => {
+    checkCallback();
+  };
+
+  const onCancel = () => {
+    checkCallback();
+  };
+
+  const handleImg = () => {
+    if (data?.files && data?.files.length) {
+      return data?.files.map((res: any) => (
+        <img
+          style={{ width: '100px', height: '100px', margin: '5px 10px' }}
+          src={res.url}
+          key={res.record_id}
+          alt="图片"
+        />
+      ));
+    } else {
+      return '暂无图片';
+    }
+  };
+
+  return (
+    <Modal title="查看" open={visible} onOk={onOk} onCancel={onCancel} width={1000}>
+      <Descriptions bordered>
+        <Descriptions.Item label="小区名称">{data?.community_name}</Descriptions.Item>
+        <Descriptions.Item label="地址">{data?.address}</Descriptions.Item>
+        <Descriptions.Item label="楼栋号">{data?.building}</Descriptions.Item>
+        <Descriptions.Item label="单元">{data?.unit}</Descriptions.Item>
+        <Descriptions.Item label="门牌号">{data?.doorplate}</Descriptions.Item>
+        <Descriptions.Item label="空调类型">
+          {
+            {
+              1: '组合式方案',
+              2: '供暖机组',
+              3: '雅居多联机',
+              4: '多联机系列',
+              5: '螺杆机系列',
+              6: '热水机系列',
+              7: '离心机系列',
+              8: '地源热泵',
+              9: '模块机系列',
+            }[data?.air_conditioner_type]
+          }
+        </Descriptions.Item>
+        <Descriptions.Item label="业主姓名">{data?.proprietor_name}</Descriptions.Item>
+        <Descriptions.Item label="联系方式">{data?.phone}</Descriptions.Item>
+        <Descriptions.Item label="客户分类">{data?.customer_type}</Descriptions.Item>
+        <Descriptions.Item label="成功几率">{data?.success_probability}</Descriptions.Item>
+        <Descriptions.Item label="成功几率分析" span={3}>
+          {data?.success_probability_analysis}
+        </Descriptions.Item>
+        <Descriptions.Item label="状态">
+          {
+            { '1': '审核未通过', '2': '审核通过', '3': '成交', '4': '放弃', '5': '丢单' }[
+              data?.status
+            ]
+          }
+        </Descriptions.Item>
+        <Descriptions.Item label="跟进人" span={2}>
+          {data?.follow_people}
+        </Descriptions.Item>
+        <Descriptions.Item label="图片" span={3}>
+          {handleImg()}
+        </Descriptions.Item>
+      </Descriptions>
+    </Modal>
+  );
+};
+export default Check;

+ 342 - 0
src/pages/ReportHomeManagement/edit.tsx

@@ -0,0 +1,342 @@
+import React, { useEffect, useState } from 'react';
+import { Col, Form, Input, InputNumber, Modal, Row, Select, message } from 'antd';
+import UploadCommon from '@/components/UploadImage';
+import { createReportHome, editReportHome } from '@/services/reportHome';
+import { queryCommunity } from '@/services/reporting/community';
+
+interface userEditPros {
+  visible: boolean;
+  editCallback: () => void;
+  params: any;
+}
+
+const { TextArea } = Input;
+
+/**
+ * 报备编辑页面
+ * @param props
+ * @constructor
+ */
+const Edit: React.FC<userEditPros> = (props) => {
+  const { visible, editCallback, params } = props;
+  const [form] = Form.useForm();
+  const [filesList, setFilesList] = useState([]);
+  const [communityList, setCommunityList] = useState([]);
+
+  //  小区列表
+  const getCommunityList = () => {
+    queryCommunity({ q: 'list' }).then((res) => {
+      setCommunityList(res.data.list || []);
+    });
+  };
+
+  useEffect(() => {
+    getCommunityList();
+  }, []);
+
+  const onOk = () => {
+    form.validateFields().then((values) => {
+      if (values) {
+        const data = { ...values };
+        if (values.success_probability_analysis) {
+          data.success_probability_analysis = values.success_probability_analysis;
+        }
+        if (values.files && values.files.length) {
+          data.files = filesList;
+        }
+        if (params) {
+          data.record_id = params.record_id;
+          editReportHome(data)
+            .then((res) => {
+              if (res && res.code === 0) {
+                message.success('编辑成功');
+                editCallback();
+              } else {
+                message.error('编辑失败');
+              }
+            })
+            .catch((e) => {
+              message.error(e?.message);
+            });
+        } else {
+          createReportHome(data)
+            .then((res) => {
+              if (res && res.code === 0) {
+                message.success('新增成功');
+                editCallback();
+              } else {
+                message.error('新增失败');
+              }
+            })
+            .catch((e) => {
+              message.error(e?.message);
+            });
+        }
+      }
+    });
+  };
+
+  // 上传图片回调
+  const onUploadChange = (files: any) => {
+    if (files && files.length) {
+      const arr: any = [];
+      files.forEach((el: any) => {
+        arr.push({ url: el?.response?.data?.url || '' });
+      });
+      setFilesList(arr);
+    }
+  };
+
+  const onCancel = () => {
+    editCallback();
+  };
+
+  const formItemLayout = {
+    labelCol: {
+      span: 7,
+    },
+    wrapperCol: {
+      span: 15,
+    },
+  };
+
+  const formItemLayoutTwo = {
+    labelCol: {
+      span: 4,
+    },
+    wrapperCol: {
+      span: 19,
+    },
+  };
+
+  return (
+    <Modal
+      title={`${params ? '编辑' : '新增'}`}
+      open={visible}
+      onOk={onOk}
+      onCancel={onCancel}
+      width={800}
+    >
+      <Form form={form}>
+        <Row>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="community_id"
+              label="小区名称"
+              rules={[{ required: true, message: '请输入小区名称' }]}
+              initialValue={params?.community_id || undefined}
+            >
+              <Select
+                placeholder="请选择小区名称"
+                options={communityList}
+                fieldNames={{ label: 'name', value: 'record_id' }}
+              />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="building"
+              label="楼栋号"
+              rules={[{ required: true, message: '请输入楼栋号' }]}
+              initialValue={params?.building || ''}
+            >
+              <Input placeholder="请输入楼栋号" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="unit"
+              label="单元"
+              rules={[{ required: true, message: '请输入单元' }]}
+              initialValue={params?.unit || ''}
+            >
+              <Input placeholder="请输入单元" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="doorplate"
+              label="门牌号"
+              rules={[{ required: true, message: '请输入门牌号' }]}
+              initialValue={params?.doorplate || ''}
+            >
+              <Input placeholder="请输入门牌号" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="address"
+              label="详细地址"
+              rules={[{ required: true, message: '请输入详细地址' }]}
+              initialValue={params?.address || ''}
+            >
+              <Input placeholder="请输入详细地址" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="air_conditioner_type"
+              label="空调类型"
+              rules={[{ required: true, message: '请选择空调类型' }]}
+              initialValue={params?.air_conditioner_type || undefined}
+            >
+              <Select
+                placeholder="请选择空调类型"
+                options={[
+                  {
+                    value: '1',
+                    label: '组合式方案',
+                  },
+                  {
+                    value: '2',
+                    label: '供暖机组',
+                  },
+                  {
+                    value: '3',
+                    label: '雅居多联机',
+                  },
+                  {
+                    value: '4',
+                    label: '多联机系列',
+                  },
+                  {
+                    value: '5',
+                    label: '螺杆机系列',
+                  },
+                  {
+                    value: '6',
+                    label: '热水机系列',
+                  },
+                  {
+                    value: '7',
+                    label: '离心机系列',
+                  },
+                  {
+                    value: '8',
+                    label: '地源热泵',
+                  },
+                  {
+                    value: '9',
+                    label: '模块机系列',
+                  },
+                ]}
+              />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="proprietor_name"
+              label="业主姓名"
+              rules={[{ required: true, message: '请输入业主姓名' }]}
+              initialValue={params?.proprietor_name || ''}
+            >
+              <Input placeholder="请输入业主姓名" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="phone"
+              label="联系方式"
+              rules={[{ required: true, message: '请输入联系方式' }]}
+              initialValue={params?.phone || ''}
+            >
+              <Input placeholder="请输入联系方式" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="customer_type"
+              label="客户分类"
+              rules={[{ required: true, message: '请选择客户分类' }]}
+              initialValue={params?.customer_type || undefined}
+            >
+              <Select
+                placeholder="请选择客户分类"
+                options={[
+                  {
+                    value: 'A',
+                    label: 'A',
+                  },
+                  {
+                    value: 'B',
+                    label: 'B',
+                  },
+                  {
+                    value: 'C',
+                    label: 'C',
+                  },
+                  {
+                    value: 'D',
+                    label: 'D',
+                  },
+                ]}
+              />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="success_probability"
+              label="成功几率"
+              rules={[{ required: true, message: '请输入成功几率' }]}
+              initialValue={params?.success_probability || 0}
+            >
+              <InputNumber
+                min={0}
+                max={100}
+                placeholder="请输入成功几率"
+                addonAfter="%"
+                style={{ width: '235px' }}
+              />
+            </Form.Item>
+          </Col>
+          <Col span={24}>
+            <Form.Item
+              {...formItemLayoutTwo}
+              name="success_probability_analysis"
+              label="成功几率分析"
+              initialValue={params?.success_probability_analysis || ''}
+            >
+              <TextArea rows={4} placeholder="请输入成功几率分析" />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="follow_people"
+              label="跟进人"
+              rules={[{ required: true, message: '请输入跟进人' }]}
+              initialValue={params?.follow_people || ''}
+            >
+              <Input placeholder="请输入跟进人" />
+            </Form.Item>
+          </Col>
+          <Col span={24}>
+            <Form.Item
+              {...formItemLayoutTwo}
+              name="files"
+              label="上传图片"
+              initialValue={params?.files || []}
+            >
+              <UploadCommon
+                value={params?.files ? params?.files : []}
+                onChange={onUploadChange}
+                maxCount={9}
+              />
+            </Form.Item>
+          </Col>
+        </Row>
+      </Form>
+    </Modal>
+  );
+};
+export default Edit;

+ 300 - 0
src/pages/ReportHomeManagement/index.tsx

@@ -0,0 +1,300 @@
+import React, { useEffect, useState } from 'react';
+import { Button, Card, Form, Input, message, Modal, Space, Table } from 'antd';
+import { PlusCircleOutlined, ReloadOutlined, SearchOutlined } from '@ant-design/icons';
+import { PageContainer } from '@ant-design/pro-components';
+import type { ColumnsType } from 'antd/es/table';
+import Edit from './edit';
+import {
+  queryReportHome,
+  queryReportHomeDetail,
+  reportHomeAbandon,
+  reportHomeSuccess,
+} from '@/services/reportHome';
+import Check from './check';
+
+interface DataType {
+  name: string;
+  address: string;
+  created_name: string;
+  record_id: string;
+  status: number;
+}
+
+const CommunityManagement: React.FC = () => {
+  const [form] = Form.useForm();
+  const [loading, setLoading] = useState(false);
+  const [dataList, setDataList] = useState([]);
+  const [searchData, setSearchData] = useState<object | null>({});
+  const [pagination, setPagination] = useState({ total: 0, current: 1, pageSize: 10 });
+  const [editData, setEditData] = useState(null);
+  const [visible, setVisible] = useState(false);
+  const [checkVisible, setCheckVisible] = useState(false);
+  const [checkData, setCheckData] = useState<object | null>({});
+
+  const getList = () => {
+    const params = {
+      q: 'page',
+      current: pagination.current,
+      pageSize: pagination.pageSize,
+      ...searchData,
+    };
+    queryReportHome(params).then((res) => {
+      if (res && res.code === 0) {
+        setDataList(res.data.list || []);
+        setLoading(false);
+      }
+    });
+  };
+
+  useEffect(() => {
+    setLoading(true);
+    getList();
+  }, []);
+
+  const onFinish = () => {
+    form.validateFields().then((data) => {
+      setLoading(true);
+      setSearchData(data);
+    });
+  };
+
+  const onReset = () => {
+    form.resetFields();
+    setLoading(true);
+    setSearchData(null);
+  };
+
+  useEffect(() => {
+    getList();
+  }, [searchData]);
+
+  // 分页切换
+  const tableChange = () => {
+    setLoading(true);
+    const params = {
+      q: 'page',
+      current: pagination.current,
+      pageSize: pagination.pageSize,
+      ...searchData,
+    };
+    queryReportHome(params).then((res) => {
+      if (res?.code === 0) {
+        setDataList(res?.data?.list || []);
+        setPagination(res.data.pagination);
+        setLoading(false);
+      }
+    });
+  };
+
+  //  新增弹框
+  const onAdd = () => {
+    setEditData(null);
+    setVisible(true);
+  };
+
+  const toEdit = (record: any) => {
+    setEditData(record);
+    setVisible(true);
+  };
+
+  //  编辑回调
+  const onEditCallback = () => {
+    setVisible(false);
+    getList();
+  };
+
+  //  查看弹框回调
+  const checkCallback = () => {
+    setCheckVisible(false);
+  };
+
+  // 成交
+  const toDeal = (record: any) => {
+    Modal.confirm({
+      title: '成交',
+      content: '是否确认成交?',
+      onOk: () => {
+        reportHomeSuccess(record.record_id)
+          .then((res) => {
+            if (res.code === 0) {
+              message.success('成交成功');
+            } else {
+              message.error('成交失败');
+            }
+            getList();
+          })
+          .catch((e) => {
+            message.error(e?.message);
+          });
+      },
+    });
+  };
+
+  // 放弃
+  const toDisable = (record: any) => {
+    Modal.confirm({
+      title: '放弃',
+      content: '是否确认放弃?',
+      onOk: () => {
+        reportHomeAbandon(record.record_id)
+          .then((res) => {
+            if (res.code === 0) {
+              message.success('放弃成功');
+            } else {
+              message.error('放弃失败');
+            }
+            getList();
+          })
+          .catch((e) => {
+            message.error(e?.message);
+          });
+      },
+    });
+  };
+
+  // 查看弹框
+  const toCheck = (record: any) => {
+    queryReportHomeDetail(record.record_id).then((res) => {
+      if (res?.code === 0) {
+        setCheckData(record);
+        setCheckVisible(true);
+      }
+    });
+  };
+
+  const columns: ColumnsType<DataType> = [
+    {
+      title: '序号',
+      align: 'center',
+      key: 'index',
+      render: (_: any, _row: any, index: number) => index + 1,
+    },
+    {
+      title: '小区名称',
+      dataIndex: 'community_name',
+      key: 'community_name',
+    },
+    {
+      title: '地址',
+      dataIndex: 'address',
+      key: 'address',
+    },
+    {
+      title: '详细地址',
+      dataIndex: 'address',
+      key: 'address',
+    },
+    {
+      title: '空调类型',
+      dataIndex: 'air_conditioner_type',
+      key: 'air_conditioner_type',
+    },
+    {
+      title: '业主姓名',
+      dataIndex: 'proprietor_name',
+      key: 'proprietor_name',
+    },
+    {
+      title: '成功几率',
+      dataIndex: 'success_probability',
+      key: 'success_probability',
+    },
+    {
+      title: '状态',
+      dataIndex: 'status',
+      key: 'status',
+      render: (v) =>
+        v && <span>{{ 1: '审核未通过', 2: '审核通过', 3: '成交', 4: '放弃', 5: '丢单' }[v]}</span>,
+    },
+    {
+      title: '跟进人',
+      dataIndex: 'follow_people',
+      key: 'follow_people',
+    },
+    {
+      title: '操作',
+      key: 'action',
+      render: (_, record) => (
+        <Space size="middle">
+          <a
+            onClick={() => {
+              toEdit(record);
+            }}
+          >
+            编辑
+          </a>
+          <a
+            onClick={() => {
+              toCheck(record);
+            }}
+          >
+            查看
+          </a>
+          {record?.status === 2 && (
+            <a
+              style={{ color: 'green' }}
+              onClick={() => {
+                toDeal(record);
+              }}
+            >
+              成交
+            </a>
+          )}
+          {record?.status === 2 && (
+            <a
+              style={{ color: 'red' }}
+              onClick={() => {
+                toDisable(record);
+              }}
+            >
+              放弃
+            </a>
+          )}
+        </Space>
+      ),
+    },
+  ];
+
+  return (
+    <PageContainer>
+      <div>
+        <Card>
+          <Form form={form} layout="inline" onFinish={onFinish}>
+            <Form.Item name="like_name" label="小区名称">
+              <Input placeholder="请输入小区名称" />
+            </Form.Item>
+            <Form.Item style={{ marginBottom: '10px' }}>
+              <Space>
+                <Button type="primary" htmlType="submit">
+                  <SearchOutlined />
+                  查询
+                </Button>
+                <Button htmlType="button" onClick={onReset}>
+                  <ReloadOutlined />
+                  重置
+                </Button>
+              </Space>
+            </Form.Item>
+          </Form>
+          <Button htmlType="button" type="primary" style={{ margin: '20px 0' }} onClick={onAdd}>
+            <PlusCircleOutlined />
+            新增报备
+          </Button>
+          <Table
+            columns={columns}
+            dataSource={dataList}
+            rowKey={(record) => record.record_id}
+            pagination={pagination}
+            loading={loading}
+            onChange={tableChange}
+          />
+          {visible && <Edit editCallback={onEditCallback} params={editData} visible={visible} />}
+          {checkVisible && (
+            <Check visible={checkVisible} data={checkData} checkCallback={checkCallback} />
+          )}
+        </Card>
+      </div>
+    </PageContainer>
+  );
+};
+export default CommunityManagement;

+ 0 - 22
src/pages/ReportingManagement/edit.tsx

@@ -206,28 +206,6 @@ const Edit: React.FC<userEditPros> = (props) => {
               <Input placeholder="请输入路" />
             </Form.Item>
           </Col>
-          <Col span={12}>
-            <Form.Item
-              {...formItemLayout}
-              name="residence"
-              label="小区"
-              rules={[{ required: true, message: '请输入小区' }]}
-              initialValue={detailData?.residence || ''}
-            >
-              <Input placeholder="请输入小区" />
-            </Form.Item>
-          </Col>
-          <Col span={12}>
-            <Form.Item
-              {...formItemLayout}
-              name="doorplate"
-              label="门牌"
-              rules={[{ required: true, message: '请输入门牌' }]}
-              initialValue={detailData?.doorplate || ''}
-            >
-              <Input placeholder="请输入门牌" />
-            </Form.Item>
-          </Col>
           <Col span={24}>
             <Form.Item
               {...formItemLayoutTwo}

+ 2 - 2
src/pages/ReportingManagement/index.tsx

@@ -18,7 +18,7 @@ import moment from 'moment';
 const { RangePicker } = DatePicker;
 
 interface DataType {
-  name: string;
+  community_name: string;
   record_id: string;
   status: number;
 }
@@ -220,7 +220,7 @@ const ReportingManagement: React.FC = () => {
       render: (_: any, row: any, index: number) => index + 1,
     },
     {
-      title: '工程名称',
+      title: '项目名称',
       dataIndex: 'project_name',
       key: 'project_name',
     },

+ 51 - 13
src/pages/setting/UserManagement/edit.tsx

@@ -1,8 +1,8 @@
 import React, { useEffect, useState } from 'react';
 // import type { UploadProps } from 'antd';
 // import { Cascader } from 'antd';
-import { Checkbox, Col, Form, Input, message, Modal, Row } from 'antd';
-import { createUser, editUser } from '@/services/setting';
+import { Cascader, Checkbox, Col, Form, Input, InputNumber, message, Modal, Row } from 'antd';
+import { createUser, editUser, queryTreeList } from '@/services/setting';
 // import { LoadingOutlined, PlusOutlined } from '@ant-design/icons';
 import md5 from 'js-md5';
 import { queryRoleList } from '@/services/role';
@@ -29,7 +29,7 @@ const Edit: React.FC<userEditPros> = (props) => {
   // const [loading, setLoading] = useState(false);
   const [roleList, setRoleList] = useState([]);
   // const [selectList, setSelectList] = useState([]);
-  // const [areaList, setAreaList] = useState([]);
+  const [areaList, setAreaList] = useState([]);
   const [isCurrent, setIsCurrent] = useState(false);
 
   // const getBase64 = (img: any) => {
@@ -98,11 +98,11 @@ const Edit: React.FC<userEditPros> = (props) => {
     }
 
     //  地区列表
-    // queryTreeList({ q: 'tree' }).then((res) => {
-    //   if (res && res.code === 0) {
-    //     setAreaList(res.data.list || []);
-    //   }
-    // });
+    queryTreeList({ q: 'tree', level: '3' }).then((res) => {
+      if (res && res.code === 0) {
+        setAreaList(res.data.list || []);
+      }
+    });
   }, []);
 
   // const handleLevel = (values: any) => {
@@ -175,11 +175,20 @@ const Edit: React.FC<userEditPros> = (props) => {
           data.user_role = user_role;
           delete data.role_id;
         }
-        if (values?.area) {
-          data.province = values.area[0];
-          data.city = values.area[1];
-          data.district = values.area[2];
-          delete data.area;
+        // if (values?.area) {
+        //   data.province = values.area[0];
+        //   data.city = values.area[1];
+        //   data.district = values.area[2];
+        //   delete data.area;
+        // }
+        if (values.districts) {
+          const arr: any[] = [];
+          values.districts.forEach((el: any) => {
+            arr.push({
+              district_id: el[1],
+            });
+          });
+          data.districts = arr;
         }
         if (values?.parent_id) {
           data.parent_id = values?.parent_id;
@@ -331,6 +340,35 @@ const Edit: React.FC<userEditPros> = (props) => {
               />
             </Form.Item>
           </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="quota"
+              label="配额"
+              rules={[{ required: true, message: '请输入配额' }]}
+              initialValue={detailData?.quota || ''}
+            >
+              <InputNumber min={0} placeholder="请输入配额" style={{ width: '100%' }} />
+            </Form.Item>
+          </Col>
+          <Col span={12}>
+            <Form.Item
+              {...formItemLayout}
+              name="districts"
+              label="地区"
+              rules={[{ required: true, message: '请选择地区' }]}
+              initialValue={detailData?.districts || []}
+            >
+              <Cascader
+                style={{ width: '100%' }}
+                options={areaList}
+                multiple
+                placeholder="请选择地区"
+                maxTagCount="responsive"
+                fieldNames={{ label: 'name', value: 'record_id', children: 'children' }}
+              />
+            </Form.Item>
+          </Col>
           {/*<Col span={24}>*/}
           {/*  <Form.Item*/}
           {/*    {...formItemLayoutTwo}*/}

+ 10 - 0
src/pages/setting/UserManagement/index.tsx

@@ -314,6 +314,16 @@ const UserManagement: React.FC = () => {
               </Select.Option>
             </Select>
           </Form.Item>
+          <Form.Item name="status" label="状态">
+            <Select style={{ width: '175px' }} placeholder="请选择状态">
+              <Select.Option key={1} value={1}>
+                启用
+              </Select.Option>
+              <Select.Option key={2} value={2}>
+                停用
+              </Select.Option>
+            </Select>
+          </Form.Item>
           <Form.Item style={{ marginBottom: '10px' }}>
             <Space>
               <Button type="primary" htmlType="submit">

+ 6 - 6
src/services/ReportingManagement.ts

@@ -6,7 +6,7 @@ import { stringify } from 'qs';
  * @param param
  */
 export async function reportingQuery(param: object) {
-  return request(`/web/v1/customer_reports?${stringify(param)}`);
+  return request(`/web/v1/report_projects?${stringify(param)}`);
 }
 
 /**
@@ -14,7 +14,7 @@ export async function reportingQuery(param: object) {
  * @param id
  */
 export async function reportingDetailQuery(id: string) {
-  return request(`/web/v1/customer_reports/${id}`);
+  return request(`/web/v1/report_projects/${id}`);
 }
 
 /**
@@ -45,7 +45,7 @@ export async function cityQuery(params: any) {
  * @param params
  */
 export async function createReporting(params: object) {
-  return request(`/web/v1/customer_reports`, {
+  return request(`/web/v1/report_projects`, {
     method: 'POST',
     data: params,
   });
@@ -56,7 +56,7 @@ export async function createReporting(params: object) {
  * @param params
  */
 export async function editReporting(params: any) {
-  return request(`/web/v1/customer_reports/${params.record_id}`, {
+  return request(`/web/v1/report_projects/${params.record_id}`, {
     method: 'PUT',
     data: params,
   });
@@ -67,7 +67,7 @@ export async function editReporting(params: any) {
  * @param id
  */
 export async function reportingSuccess(id: string) {
-  return request(`/web/v1/customer_reports/${id}/success`, {
+  return request(`/web/v1/report_projects/${id}/success`, {
     method: 'PATCH',
   });
 }
@@ -77,7 +77,7 @@ export async function reportingSuccess(id: string) {
  * @param id
  */
 export async function reportingAbandon(id: string) {
-  return request(`/web/v1/customer_reports/${id}/abandon`, {
+  return request(`/web/v1/report_projects/${id}/abandon`, {
     method: 'PATCH',
   });
 }

+ 43 - 0
src/services/banner.ts

@@ -0,0 +1,43 @@
+import { request } from '@@/plugin-request/request';
+import { stringify } from 'qs';
+
+/**
+ * 查询banner图列表
+ * @param param
+ */
+export async function queryBanner(param: object) {
+  return request(`/web/v1/banners?${stringify(param)}`);
+}
+
+/**
+ * 新增banner图
+ * @param params
+ */
+export async function createBanner(params: object) {
+  return request(`/web/v1/banners`, {
+    method: 'POST',
+    data: params,
+  });
+}
+
+/**
+ * 编辑Banner图
+ * @param params
+ * @param record_id
+ */
+export async function updateBanner(params: object, record_id: string) {
+  return request(`/web/v1/banners/${record_id}`, {
+    method: 'PUT',
+    data: params,
+  });
+}
+
+/**
+ * 删除banner图
+ * @param record_id
+ */
+export async function delBanner(record_id: any) {
+  return request(`/web/v1/banners/${record_id}`, {
+    method: 'DELETE',
+  });
+}

+ 60 - 0
src/services/reportHome.ts

@@ -0,0 +1,60 @@
+import { request } from '@@/plugin-request/request';
+import { stringify } from 'qs';
+
+/**
+ * 零售报备列表查询
+ * @param param
+ */
+export async function queryReportHome(param: object) {
+  return request(`/web/v1/report_homes?${stringify(param)}`);
+}
+
+/**
+ * 报备成交
+ * @param id
+ */
+export async function reportHomeSuccess(id: string) {
+  return request(`/web/v1/report_homes/${id}/success`, {
+    method: 'PATCH',
+  });
+}
+
+/**
+ * 报备放弃
+ * @param id
+ */
+export async function reportHomeAbandon(id: string) {
+  return request(`/web/v1/report_homes/${id}/abandon`, {
+    method: 'PATCH',
+  });
+}
+
+/**
+ * 创建报备
+ * @param params
+ */
+export async function createReportHome(params: object) {
+  return request(`/web/v1/report_homes`, {
+    method: 'POST',
+    data: params,
+  });
+}
+
+/**
+ * 编辑报备
+ * @param params
+ */
+export async function editReportHome(params: any) {
+  return request(`/web/v1/report_homes/${params.record_id}`, {
+    method: 'PUT',
+    data: params,
+  });
+}
+
+/**
+ * 报备详情
+ * @param id
+ */
+export async function queryReportHomeDetail(id: string) {
+  return request(`/web/v1/report_homes/${id}`);
+}

+ 42 - 0
src/services/reporting/area.ts

@@ -0,0 +1,42 @@
+import { request } from '@@/plugin-request/request';
+import { stringify } from 'qs';
+
+/**
+ * 查询区域管理列表数据
+ * @param param
+ */
+export async function queryAreaTree(param: object) {
+  return request(`/web/v1/report_districts?${stringify(param)}`);
+}
+
+/**
+ * 新增区域
+ * @param params
+ */
+export async function createAreaTree(params: object) {
+  return request(`/web/v1/report_districts`, {
+    method: 'POST',
+    data: params,
+  });
+}
+
+/**
+ * 编辑区域
+ * @param params
+ */
+export async function updateAreaTree(params: object) {
+  return request(`/web/v1/report_districts`, {
+    method: 'POST',
+    data: params,
+  });
+}
+
+/**
+ * 删除区域
+ * @param record_id
+ */
+export async function delAreaTree(record_id: any) {
+  return request(`/web/v1/report_districts/${record_id}`, {
+    method: 'DELETE',
+  });
+}

+ 42 - 0
src/services/reporting/community.ts

@@ -0,0 +1,42 @@
+import { request } from '@@/plugin-request/request';
+import { stringify } from 'qs';
+
+/**
+ * 查询小区管理列表数据
+ * @param param
+ */
+export async function queryCommunity(param: object) {
+  return request(`/web/v1/report_community?${stringify(param)}`);
+}
+
+/**
+ * 新增小区
+ * @param params
+ */
+export async function createCommunity(params: object) {
+  return request(`/web/v1/report_community`, {
+    method: 'POST',
+    data: params,
+  });
+}
+
+/**
+ * 编辑小区
+ * @param params
+ */
+export async function updateCommunity(params: object) {
+  return request(`/web/v1/report_community`, {
+    method: 'POST',
+    data: params,
+  });
+}
+
+/**
+ * 删除小区
+ * @param record_id
+ */
+export async function delCommunity(record_id: any) {
+  return request(`/web/v1/report_community/${record_id}`, {
+    method: 'DELETE',
+  });
+}