Selaa lähdekoodia

Merge branch 'v2' of http://git.ycjcjy.com/yunzhi/crm_pc into v2

fangmingyue 1 vuosi sitten
vanhempi
commit
2352037b6f

+ 3
- 2
src/components/Upload/UploadImage.jsx Näytä tiedosto

@@ -40,12 +40,13 @@ export default (props) => {
40 40
     if (info.file.status === 'done') {
41 41
       setLoading(false);
42 42
       const { url, fileType } = info.file.response;
43
+      console.log(url)
43 44
       onChange(url);
44 45
     }
45 46
   };
46 47
 
47 48
   const previewUrl = getRealPath ? getRealPath(value) : value;
48
-
49
+console.log(value)
49 50
   return (
50 51
     <Upload
51 52
       listType="picture-card"
@@ -54,7 +55,7 @@ export default (props) => {
54 55
       beforeUpload={beforeUpload}
55 56
       onChange={handleChange}
56 57
     >
57
-      {value ? <img src={previewUrl} alt="avatar" style={{ width: '100%', height: '100%' }} /> : <UploadButton loading={loading} />}
58
+      {value ? <img src={value} alt="avatar" style={{ width: '100%', height: '100%' }} /> : <UploadButton loading={loading} />}
58 59
     </Upload>
59 60
   );
60 61
 }

+ 1
- 2
src/components/Upload/request.js Näytä tiedosto

@@ -4,8 +4,7 @@ const upload = (file, fileType = 'image') => {
4 4
   const formData = new FormData();
5 5
   formData.append("file", file);
6 6
   formData.append("fileType", fileType);
7
-
8
-  return request('/api/admin/file', {
7
+  return request('/upload', {
9 8
     method: 'post',
10 9
     data: formData,
11 10
     headers: {

+ 54
- 0
src/pages/member/Edit.jsx Näytä tiedosto

@@ -0,0 +1,54 @@
1
+import { getTaMemberId } from "@/services/taMember";
2
+import { Card } from "antd";
3
+import React, { useEffect, useState } from "react";
4
+import { useSearchParams } from "react-router-dom";
5
+import Page from "@/components/Page";
6
+import MemberInfo from "./components/MemberInfo";
7
+import MemberCardInfo from "./components/MemberCardInfo";
8
+import "./index.less";
9
+export default (props) => {
10
+  const [params] = useSearchParams();
11
+  const [activeTabKey, setActiveTabKey] = useState("tab1");
12
+  const [memberList, setMemberList] = useState();
13
+  const id = params.get("id");
14
+
15
+  useEffect(() => {
16
+  if(id){
17
+    getTaMemberId(id).then((res) => {
18
+        setMemberList(res || {});
19
+      });
20
+  }
21
+  }, []);
22
+
23
+  const tabList = [
24
+    {
25
+      key: "tab1",
26
+      tab: "会员信息",
27
+    },
28
+    {
29
+      key: "tab2",
30
+      tab: "会员卡信息",
31
+    },
32
+  ];
33
+  const contentList = {
34
+    // 会员基本信息
35
+    tab1: <MemberInfo memberList={memberList} />,
36
+    // 会员卡信息
37
+    tab2: <MemberCardInfo taMemberCardList={memberList?.taMemberCardList} />,
38
+  };
39
+  return (
40
+    <Page>
41
+      <Card
42
+        className="scorll"
43
+        style={{ width: "100%", overflowY: "scroll", maxHeight: "700px" }}
44
+        // title="会员卡"
45
+        //   extra={<a href="#">More</a>}
46
+        tabList={tabList}
47
+        activeTabKey={activeTabKey}
48
+        onTabChange={(key) => setActiveTabKey(key)}
49
+      >
50
+        {contentList[activeTabKey]}
51
+      </Card>
52
+    </Page>
53
+  );
54
+};

+ 41
- 0
src/pages/member/components/MemberCardInfo.jsx Näytä tiedosto

@@ -0,0 +1,41 @@
1
+import React from "react";
2
+import { Card } from "antd";
3
+export default (props) => {
4
+  const { taMemberCardList } = props;
5
+
6
+  const CardAll = () => {
7
+    return (taMemberCardList || []).map((it) => {
8
+      return (
9
+        <Card
10
+          id={it?.cardId}
11
+          style={{ width: "100%" }}
12
+          title={it?.cardType ? it?.cardType : "会员卡"}
13
+        >
14
+          <Card.Grid>
15
+            <Card.Meta title="开卡人姓名" description={it?.memberName} />
16
+          </Card.Grid>
17
+          <Card.Grid>
18
+            <Card.Meta title="手机号" description={it?.memberPhone} />
19
+          </Card.Grid>
20
+          <Card.Grid>
21
+            <Card.Meta title="总次数" description={it?.totalAmount} />
22
+          </Card.Grid>
23
+          <Card.Grid>
24
+            <Card.Meta title="剩余次数" description={it?.leftAmount} />
25
+          </Card.Grid>
26
+          <Card.Grid>
27
+            <Card.Meta title="开卡日期" description={it?.bizDate} />
28
+          </Card.Grid>
29
+          <Card.Grid>
30
+            <Card.Meta title="总时长" description={it?.totalTime} />
31
+          </Card.Grid>
32
+          <Card.Grid>
33
+            <Card.Meta title="截止日期" description={it?.expireTime} />
34
+          </Card.Grid>
35
+        </Card>
36
+      );
37
+    });
38
+  };
39
+
40
+  return <CardAll />;
41
+};

+ 28
- 0
src/pages/member/components/MemberInfo.jsx Näytä tiedosto

@@ -0,0 +1,28 @@
1
+import { Card } from "antd";
2
+import React from "react";
3
+export default (props) => {
4
+  const { memberList } = props;
5
+  return (
6
+    <Card
7
+      style={{ width: "100%" }}
8
+      title="会员信息"
9
+    >
10
+      <Card.Grid>
11
+        <Card.Meta title="会员名称" description={memberList?.memberName} />
12
+      </Card.Grid>
13
+      <Card.Grid>
14
+        <Card.Meta title="手机号" description={memberList?.phone} />
15
+      </Card.Grid>
16
+      <Card.Grid>
17
+        <Card.Meta title="性别" description={memberList?.sex} />
18
+      </Card.Grid>
19
+      <Card.Grid>
20
+        <Card.Meta title="状态" description={memberList?.status} />
21
+      </Card.Grid>
22
+      <Card.Grid>
23
+        <Card.Meta title="注册日期" description={memberList?.bizDate} />
24
+      </Card.Grid>
25
+
26
+    </Card>
27
+  );
28
+};

+ 82
- 0
src/pages/member/index.jsx Näytä tiedosto

@@ -0,0 +1,82 @@
1
+import React from "react";
2
+import { getTaMember } from "@/services/taMember";
3
+import List from "@/components/Page/List";
4
+import moment from "moment";
5
+import { useNavigate } from "react-router-dom";
6
+export default (props) => {
7
+  const navigate = useNavigate();
8
+
9
+  const columns = [
10
+    {
11
+      title: "注册日期",
12
+      dataIndex: "bizDate1",
13
+      valueType: "dateRange",
14
+      search: {
15
+        transform: (value) => {
16
+          return {
17
+            startTime: value[0],
18
+            endTime: value[1],
19
+          };
20
+        },
21
+      },
22
+      hideInTable: true,
23
+    },
24
+    {
25
+      title: "会员名称",
26
+      dataIndex: "memberName",
27
+    },
28
+    {
29
+      title: "生日",
30
+      dataIndex: "birthDay",
31
+      render: (_, r) => {
32
+        return r.birthDay ? moment(r.birthDay).format("YYYY-MM-DD") : "";
33
+      },
34
+      search: false,
35
+    },
36
+    {
37
+      title: "手机号",
38
+      dataIndex: "phone",
39
+    },
40
+
41
+    {
42
+      title: "性别",
43
+      dataIndex: "sex",
44
+      search: false,
45
+    },
46
+
47
+    {
48
+      title: "注册日期",
49
+      dataIndex: "bizDate",
50
+      render: (_, r) => {
51
+        return moment(r.bizDate).format("YYYY-MM-DD");
52
+      },
53
+      search: false,
54
+    },
55
+    {
56
+      title: "状态",
57
+      dataIndex: "status",
58
+
59
+    },
60
+  ];
61
+  return (
62
+    <List
63
+      // actionRef={actionRef}
64
+      rowKey="memberId"
65
+      onEdit={(record) => navigate(`/member/edit?id=${record.memberId}`)}
66
+      // onDelete={(record) => handleDelete(record.memberId)}
67
+      // toolBarRender={() => [
68
+      //   <Button
69
+      //     key="1"
70
+      //     type="primary"
71
+      //     onClick={() => {
72
+      //       navigate("/member/edit");
73
+      //     }}
74
+      //   >
75
+      //     新增
76
+      //   </Button>,
77
+      // ]}
78
+      request={getTaMember}
79
+      columns={columns}
80
+    />
81
+  );
82
+};

+ 6
- 0
src/pages/member/index.less Näytä tiedosto

@@ -0,0 +1,6 @@
1
+// .scroll {
2
+// //    .ant-card-body{
3
+//     overflow-y: scroll !important;
4
+//     max-height: 700px;
5
+// //    }
6
+// }

+ 53
- 0
src/pages/package/Edit.jsx Näytä tiedosto

@@ -0,0 +1,53 @@
1
+import React, { useEffect, useRef, useState } from "react";
2
+import { useSearchParams } from "react-router-dom";
3
+
4
+import { getTaPackageId } from "@/services/taPackage";
5
+
6
+import Page from "@/components/Page";
7
+import { Button, Card } from "antd";
8
+import Package from "./components/Package";
9
+import PackageItem from "./components/PackageItem";
10
+export default (props) => {
11
+  const [params] = useSearchParams();
12
+  const id = params.get("id");
13
+  const [activeTabKey, setActiveTabKey] = useState("tab1");
14
+  const [packageList, setPackageList] = useState();
15
+
16
+  useEffect(() => {
17
+    if (id) {
18
+      getTaPackageId(id).then((res) => {
19
+        setPackageList(res||{});
20
+      });
21
+    }
22
+  }, [id]);
23
+
24
+  const tabList = [
25
+    {
26
+      key: "tab1",
27
+      tab: "套餐项目",
28
+    },
29
+    {
30
+      key: "tab2",
31
+      tab: "套餐内容",
32
+    },
33
+  ];
34
+  const contentList = {
35
+    // 套餐项目
36
+    tab1: <Package id={id} packageList={packageList} />,
37
+    // 套餐内容
38
+    tab2: <PackageItem id={id}   />,
39
+  };
40
+
41
+  return (
42
+    <Page>
43
+      <Card
44
+        style={{ width: "100%" }}
45
+        tabList={tabList}
46
+        activeTabKey={activeTabKey}
47
+        onTabChange={(key) => setActiveTabKey(key)}
48
+      >
49
+        {contentList[activeTabKey]}
50
+      </Card>
51
+    </Page>
52
+  );
53
+};

+ 92
- 0
src/pages/package/components/ModalPackageItem.jsx Näytä tiedosto

@@ -0,0 +1,92 @@
1
+import React, {
2
+  forwardRef,
3
+  useEffect,
4
+  useImperativeHandle,
5
+  useRef,
6
+  useState,
7
+} from "react";
8
+import {
9
+  ProForm,
10
+  ProFormSelect,
11
+  ProFormText,
12
+} from "@ant-design/pro-components";
13
+import { Modal } from "antd";
14
+import { postTaPackageItem, putTaPackageItem } from "@/services/taPackageItem";
15
+import { getTaPackage } from "@/services/taPackage";
16
+export default forwardRef((props, ref) => {
17
+  const { curd, open, setOpen } = props;
18
+  const formRef = useRef();
19
+  const [packageList, setPackageList] = useState();
20
+  console.log(ref);
21
+  const onFinish = (values) => {
22
+    console.log(ref);
23
+    if (curd != "new") {
24
+      // 修改
25
+      putTaPackageItem(curd?.packageItemId, values)
26
+        .then(() => {
27
+          setOpen(false);
28
+          ref?.current?.reload();
29
+        })
30
+        .catch((e) => ref?.current?.reload());
31
+    } else {
32
+      // 新增
33
+      postTaPackageItem(values)
34
+        .then(() => {
35
+          setOpen(false);
36
+          ref?.current?.reload();
37
+        })
38
+        .catch((e) => ref?.current?.reload());
39
+    }
40
+  };
41
+
42
+  useEffect(() => {
43
+    formRef.current?.resetFields();
44
+
45
+    if (curd != "new" && curd) {
46
+      formRef.current?.setFieldsValue(curd);
47
+    }
48
+  }, [curd]);
49
+
50
+  useEffect(() => {
51
+    getTaPackage({ pageSize: 9999 })
52
+      .then((res) => {
53
+        const data = (res.records || []).map((it) => {
54
+          return {
55
+            label: it.packageName,
56
+            value: it.packageId,
57
+          };
58
+        });
59
+        setPackageList(data);
60
+      })
61
+      .catch((err) => {});
62
+  }, []);
63
+
64
+  return (
65
+    <Modal
66
+      title="套餐内容维护"
67
+      open={open}
68
+      footer={null}
69
+      maskClosable={false}
70
+      onCancel={() => setOpen(false)}
71
+    >
72
+      <ProForm
73
+        layout="horizontal"
74
+        formRef={formRef}
75
+        onFinish={onFinish}
76
+        submitter={{
77
+          render: (_, doms) => [
78
+            doms.find((dom) => dom.props?.children === "提交"),
79
+          ],
80
+        }}
81
+      >
82
+        <ProFormText name="itemName" label="项目名称" />
83
+        <ProFormText name="charge" label="金额" />
84
+        <ProFormSelect
85
+          name="packageId"
86
+          label="套餐项目"
87
+          options={packageList}
88
+        />
89
+      </ProForm>
90
+    </Modal>
91
+  );
92
+});

+ 73
- 0
src/pages/package/components/Package.jsx Näytä tiedosto

@@ -0,0 +1,73 @@
1
+import React, { useEffect, useRef } from "react";
2
+import { postTaPackage, putTaPackage } from "@/services/taPackage";
3
+import {
4
+  ProForm,
5
+  ProFormMoney,
6
+  ProFormSelect,
7
+  ProFormText,
8
+} from "@ant-design/pro-components";
9
+import { Button } from "antd";
10
+import { useNavigate } from "react-router-dom";
11
+import { UploadImage } from "@/components/Upload";
12
+export default (props) => {
13
+  const { id, packageList } = props;
14
+  const formRef = useRef();
15
+
16
+  const navigate = useNavigate();
17
+
18
+  useEffect(() => {
19
+    if (packageList) {
20
+      formRef.current?.setFieldsValue(packageList);
21
+    }
22
+  }, [packageList]);
23
+  const onFinish = (values) => {
24
+    console.log(values);
25
+    if (!id) {
26
+      postTaPackage(values).then(() => {
27
+        navigate(-1);
28
+      });
29
+    } else {
30
+      putTaPackage(id, values).then(() => {
31
+        navigate(-1);
32
+      });
33
+    }
34
+  };
35
+
36
+  const onChange=(file)=>{
37
+    console.log(file)
38
+  }
39
+  return (
40
+    <ProForm
41
+      formRef={formRef}
42
+      onFinish={onFinish}
43
+      layout="horizontal"
44
+      submitter={{
45
+        render: (_, doms) => [
46
+          doms.find((dom) => dom.props?.children === "提交"),
47
+          <Button onClick={() => navigate(-1)}>返回</Button>,
48
+        ],
49
+      }}
50
+    >
51
+      <ProFormText name="packageName" label="套餐名称" />
52
+      <ProFormText name="packageType" label="套餐类型" />
53
+      <ProForm.Item name="thumb" label="图片">
54
+        <UploadImage onChange={onChange}/>
55
+      </ProForm.Item>
56
+      <ProFormMoney name="charge" label="价格" />
57
+      <ProFormText name="limitType" label="是否限制型消费" />
58
+      <ProFormText name="limitNum" label="限制数目" />
59
+      <ProFormSelect
60
+        name="limitUnit"
61
+        label="限制单位"
62
+        options={[
63
+          { key: "year", label: "year" },
64
+          { key: "month", label: "month" },
65
+          { key: "day", label: "day" },
66
+          { key: "order", label: "order" },
67
+        ]}
68
+      />
69
+      <ProFormText name="desc" label="说明" />
70
+      <ProFormSelect name="status" label="状态" />
71
+    </ProForm>
72
+  );
73
+};

+ 86
- 0
src/pages/package/components/PackageItem.jsx Näytä tiedosto

@@ -0,0 +1,86 @@
1
+import React, {
2
+  forwardRef,
3
+  useImperativeHandle,
4
+  useRef,
5
+  useState,
6
+} from "react";
7
+import {
8
+  getTaPackageItem,
9
+  getTaPackageId,
10
+  deleteTaPackageItem,
11
+} from "@/services/taPackageItem";
12
+import List from "@/components/Page/List";
13
+import moment from "moment";
14
+import { useNavigate } from "react-router-dom";
15
+import ModalPackageItem from "./ModalPackageItem";
16
+import { Button } from "antd";
17
+export default (props) => {
18
+  const { id } = props;
19
+  const [open, setOpen] = useState(false);
20
+  const [curd, setCurd] = useState();
21
+
22
+  const actionRef = useRef();
23
+  const columns = [
24
+    {
25
+      title: "项目名称",
26
+      dataIndex: "itemName",
27
+    },
28
+    {
29
+      title: "金额",
30
+      dataIndex: "charge",
31
+      search: false,
32
+    },
33
+  ];
34
+
35
+  const handleDelete = (id) => {
36
+    deleteTaPackageItem(id).then((res) => actionRef.current.reload());
37
+  };
38
+  const handOpen = () => {
39
+    setCurd("new");
40
+    setOpen(true);
41
+  };
42
+  const onEdit = (record) => {
43
+    setCurd(record);
44
+    setOpen(true);
45
+  };
46
+  useImperativeHandle(
47
+    actionRef,
48
+    () => ({
49
+      reload: () => actionRef?.current?.reload(),
50
+    }),
51
+    []
52
+  );
53
+
54
+//   const beforeSearchSubmit = (params) => {
55
+//     setParams(params);
56
+//   };
57
+//   const [params, setParams] = useState();
58
+  return (
59
+    <>
60
+      <List
61
+        actionRef={actionRef}
62
+        rowKey="packageItemId"
63
+        onEdit={(record) => onEdit(record)}
64
+        onDelete={(record) => handleDelete(record.packageItemId)}
65
+        toolBarRender={() => {
66
+          return [
67
+            <Button key="1" type="primary" onClick={handOpen}>
68
+              新增
69
+            </Button>,
70
+          ];
71
+        }}
72
+        params={{packageId:id}}
73
+        request={getTaPackageId}
74
+        columns={columns}
75
+        // beforeSearchSubmit={setParams}
76
+      />
77
+
78
+      <ModalPackageItem
79
+        curd={curd}
80
+        open={open}
81
+        setOpen={setOpen}
82
+        ref={actionRef}
83
+      />
84
+    </>
85
+  );
86
+};

+ 29
- 3
src/pages/package/index.jsx Näytä tiedosto

@@ -1,7 +1,10 @@
1 1
 import List from "@/components/Page/List";
2 2
 import React from "react";
3 3
 import { getTaPackage, deleteTaPackage } from "@/services/taPackage";
4
+import { useNavigate } from "react-router-dom";
5
+import { Button, Image } from "antd";
4 6
 export default (props) => {
7
+    const navigate = useNavigate();
5 8
   const columns = [
6 9
     {
7 10
       title: "套餐名称",
@@ -13,10 +16,19 @@ export default (props) => {
13 16
       dataIndex: "packageType",
14 17
     },
15 18
 
19
+
16 20
     {
17 21
       title: "图片",
18 22
       dataIndex: "thumb",
19 23
       search: false,
24
+      render: (t) => (
25
+        <Image
26
+          src={t}
27
+          height={60}
28
+          style={{ borderRadius: "15px" }}
29
+          // fallback="/image/default_1.png"
30
+        />
31
+      ),
20 32
     },
21 33
     {
22 34
       title: "价格",
@@ -51,14 +63,28 @@ export default (props) => {
51 63
       search: false,
52 64
     },
53 65
   ];
54
-
66
+  const handleDelete = (id) => {
67
+    deleteTaPackage(id).then(() => {});
68
+  };
55 69
   return (
56 70
     <List
71
+      // actionRef={actionRef}
57 72
       rowKey="packageId"
58 73
       request={getTaPackage}
74
+      onEdit={(record) => navigate(`/package/edit?id=${record.packageId}`)}
75
+      onDelete={(record) => handleDelete(record.packageId)}
76
+      toolBarRender={() => [
77
+        <Button
78
+          key="1"
79
+          type="primary"
80
+          onClick={() => {
81
+            navigate("/package/edit");
82
+          }}
83
+        >
84
+          新增
85
+        </Button>,
86
+      ]}
59 87
       columns={columns}
60
-      onEdit={(item) => {}}
61
-      onDelete={(item) => {}}
62 88
     />
63 89
   );
64 90
 };

+ 83
- 0
src/pages/project/Edit.jsx Näytä tiedosto

@@ -0,0 +1,83 @@
1
+import React, { useEffect, useRef } from "react";
2
+import {
3
+  postTaProject,
4
+  putTaProject,
5
+  getTaProjectId,
6
+} from "@/services/taProject";
7
+import Page from "@/components/Page";
8
+import { Button, Card } from "antd";
9
+import {
10
+  ProForm,
11
+  ProFormDateTimeRangePicker,
12
+  ProFormMoney,
13
+  ProFormSelect,
14
+  ProFormText,
15
+} from "@ant-design/pro-components";
16
+import { useNavigate, useSearchParams } from "react-router-dom";
17
+import moment from "moment";
18
+export default (props) => {
19
+  const formRef = useRef();
20
+  const navigate = useNavigate();
21
+
22
+  const [params] = useSearchParams();
23
+  const id = params.get("id");
24
+
25
+  useEffect(() => {
26
+    if (id) {
27
+      getTaProjectId(id).then((res) => {
28
+
29
+        formRef.current?.setFieldsValue({
30
+            ...res,
31
+            time:[moment(res.startTime),moment(res.endTime)] 
32
+        });
33
+      });
34
+    }
35
+  }, []);
36
+  const onFinish = (values) => {
37
+    const data = {
38
+      ...values,
39
+      startTime: values.time[0],
40
+      endTime: values.time[1],
41
+    };
42
+    console.log(data);
43
+    if (!id) {
44
+      postTaProject(data).then((res) => {
45
+        navigate(-1);
46
+      });
47
+    } else if (id) {
48
+      putTaProject(id, data).then((res) => {
49
+        navigate(-1);
50
+      });
51
+    }
52
+  };
53
+  return (
54
+    <Page>
55
+      <Card>
56
+        <ProForm
57
+          formRef={formRef}
58
+          onFinish={onFinish}
59
+          layout="horizontal"
60
+          submitter={{
61
+            render: (_, doms) => [
62
+              doms.find((dom) => dom.props?.children === "提交"),
63
+              <Button onClick={() => navigate(-1)}>返回</Button>,
64
+            ],
65
+          }}
66
+        >
67
+          <ProFormText name="partyA" label="甲方联系人" />
68
+          <ProFormText name="partyAName" label="甲方名称" />
69
+          <ProFormText name="partyB" label="乙方联系人" />
70
+          <ProFormText name="partyBName" label="乙方名称" />
71
+          <ProFormText name="projectName" label="项目名称" />
72
+          <ProFormText name="introduction" label="项目简介" />
73
+          <ProFormDateTimeRangePicker name="time" label="工作周期" />
74
+          <ProFormMoney name="quotation" label="合同报价" />
75
+          <ProFormMoney name="receivedMoney" label="已收款" />
76
+          <ProFormMoney name="invoicedMoney" label="已开票额" />
77
+          <ProFormText name="stageName" label="阶段名称" />
78
+          <ProFormSelect name="status" label="状态" />
79
+        </ProForm>
80
+      </Card>
81
+    </Page>
82
+  );
83
+};

+ 116
- 0
src/pages/project/index.jsx Näytä tiedosto

@@ -0,0 +1,116 @@
1
+import List from "@/components/Page/List";
2
+import React, { useRef } from "react";
3
+import { getTaProject, deleteTaProject } from "@/services/taProject";
4
+import { Button } from "antd";
5
+import { useNavigate } from "react-router-dom";
6
+import moment from "moment";
7
+export default (props) => {
8
+  const navigate = useNavigate();
9
+
10
+  const columns = [
11
+    {
12
+      title: "项目日期",
13
+      dataIndex: "startTime1",
14
+      search: {
15
+        transform: (value) => {
16
+          return {
17
+            startTime: value[0],
18
+            endTime: value[1],
19
+          };
20
+        },
21
+      },
22
+
23
+      hideInTable: true,
24
+    },
25
+
26
+    {
27
+      title: "甲方",
28
+      dataIndex: "partyA",
29
+      search: false,
30
+    },
31
+    {
32
+      title: "甲方名称",
33
+      dataIndex: "partyAName",
34
+    },
35
+    {
36
+      title: "已方",
37
+      dataIndex: "partyB",
38
+      search: false,
39
+    },
40
+    {
41
+      title: "已方名称",
42
+      dataIndex: "partyBName",
43
+    },
44
+
45
+    {
46
+      title: "项目名称",
47
+      dataIndex: "projectName",
48
+    },
49
+    {
50
+      title: "项目简介",
51
+      dataIndex: "introduction",
52
+      search: false,
53
+    },
54
+
55
+    {
56
+      title: "开始日期",
57
+      dataIndex: "startTime",
58
+      render: (t) => moment(t).format("YYYY-MM-DD"),
59
+      search: false,
60
+    },
61
+    {
62
+      title: "结束日期",
63
+      dataIndex: "endTime",
64
+      render: (t) => moment(t).format("YYYY-MM-DD"),
65
+      search: false,
66
+    },
67
+    {
68
+      title: "合同报价",
69
+      dataIndex: "quotation",
70
+      search: false,
71
+    },
72
+    {
73
+      title: "已收款",
74
+      dataIndex: "receivedMoney",
75
+      search: false,
76
+    },
77
+    {
78
+      title: "已开票额",
79
+      dataIndex: "invoicedMoney",
80
+      search: false,
81
+    },
82
+    {
83
+      title: "阶段名称",
84
+      dataIndex: "stageName",
85
+      search: false,
86
+    },
87
+    {
88
+      title: "状态",
89
+      dataIndex: "status",
90
+    },
91
+  ];
92
+  const actionRef = useRef();
93
+  return (
94
+    <List
95
+      actionRef={actionRef}
96
+      rowKey="projectId"
97
+      onEdit={(record) => navigate(`/project/edit?id=${record.projectId}`)}
98
+      onDelete={(record) =>
99
+        deleteTaProject(record.projectId).then(() => actionRef.current.reload())
100
+      }
101
+      toolBarRender={() => [
102
+        <Button
103
+          key="1"
104
+          type="primary"
105
+          onClick={() => {
106
+            navigate("/project/edit");
107
+          }}
108
+        >
109
+          新增
110
+        </Button>,
111
+      ]}
112
+      request={getTaProject}
113
+      columns={columns}
114
+    />
115
+  );
116
+};

+ 47
- 44
src/routes/routes.jsx Näytä tiedosto

@@ -11,14 +11,17 @@ import Login from "@/pages/login";
11 11
 import Page404 from "@/pages/404";
12 12
 import AdUser from "@/pages/adUser";
13 13
 import CustomEdit from "@/pages/adUser/Edit";
14
-// import Project from "@/pages/project";
15
-// import ProjectEdit from "@/pages/project/Edit";
14
+import Project from "@/pages/project";
15
+import ProjectEdit from "@/pages/project/Edit";
16 16
 import User from "@/pages/user";
17 17
 import UserEdit from "@/pages/user/Edit";
18 18
 import Menu from "@/pages/menu";
19 19
 import Role from "@/pages/role";
20 20
 import Dept from "@/pages/dept";
21 21
 import Package from "@/pages/package";
22
+import PackageEdit from "@/pages/package/Edit";
23
+import Member from "@/pages/member";
24
+import MemberEdit from "@/pages/member/Edit";
22 25
 // import RoleEdit from "@/pages/role/Edit";
23 26
 /**
24 27
  * meta 用来扩展自定义数据数据
@@ -54,38 +57,22 @@ export const authRoutes = [
54 57
       hideInMenu: true,
55 58
     },
56 59
   },
57
-  // {
58
-  //   path: "project",
59
-  //   element: <Project />,
60
-  //   meta: {
61
-  //     title: "项目管理",
62
-  //     icon: <FileTextOutlined />,
63
-  //   },
64
-  // },
65
-  // {
66
-  //   path: "project/edit",
67
-  //   element: <ProjectEdit />,
68
-  //   meta: {
69
-  //     title: "项目维护",
70
-  //     hideInMenu: true,
71
-  //   },
72
-  // },
73
-  // {
74
-  //   path: "user",
75
-  //   element: <User />,
76
-  //   meta: {
77
-  //     title: "人员管理",
78
-  //     icon: <UserOutlined />,
79
-  //   },
80
-  // },
81
-  // {
82
-  //   path: "user/edit",
83
-  //   element: <UserEdit />,
84
-  //   meta: {
85
-  //     title: "人员维护",
86
-  //     hideInMenu: true,
87
-  //   },
88
-  // },
60
+  {
61
+    path: "project",
62
+    element: <Project />,
63
+    meta: {
64
+      title: "项目管理",
65
+      icon: <FileTextOutlined />,
66
+    },
67
+  },
68
+  {
69
+    path: "project/edit",
70
+    element: <ProjectEdit />,
71
+    meta: {
72
+      title: "项目维护",
73
+      hideInMenu: true,
74
+    },
75
+  },
89 76
   {
90 77
     path: "dept",
91 78
     element: <Dept />,
@@ -94,14 +81,7 @@ export const authRoutes = [
94 81
       icon: <HeartOutlined />,
95 82
     },
96 83
   },
97
-  // {
98
-  //   path: "menu",
99
-  //   element: <Menu />,
100
-  //   meta: {
101
-  //     title: "菜单管理",
102
-  //     icon: <UserOutlined />,
103
-  //   },
104
-  // },
84
+
105 85
   {
106 86
     path: "role",
107 87
     element: <Role />,
@@ -114,11 +94,34 @@ export const authRoutes = [
114 94
     path: "package",
115 95
     element: <Package />,
116 96
     meta: {
117
-      title: "收费套餐管理",
97
+      title: "套餐管理",
118 98
       icon: <HourglassTwoTone />,
119 99
     },
120 100
   },
121
-
101
+  {
102
+    path: "package/edit",
103
+    element: <PackageEdit />,
104
+    meta: {
105
+      title: "套餐维护",
106
+      hideInMenu: true,
107
+    },
108
+  },
109
+  {
110
+    path: "member",
111
+    element: <Member />,
112
+    meta: {
113
+      title: "会员管理",
114
+      icon: <HourglassTwoTone />,
115
+    },
116
+  },
117
+  {
118
+    path: "member/edit",
119
+    element: <MemberEdit />,
120
+    meta: {
121
+      title: "会员管理",
122
+      hideInMenu: true,
123
+    },
124
+  },
122 125
   // {
123 126
   //   path: "role/edit",
124 127
   //   element: <RoleEdit />,

+ 11
- 0
src/services/taMember.js Näytä tiedosto

@@ -0,0 +1,11 @@
1
+import request from "@/utils/request";
2
+
3
+/**
4
+ * 会员查询
5
+ */
6
+export const getTaMember = (params) => request("/taMember", { params });
7
+
8
+/**
9
+ * 会员ID查询
10
+ */
11
+export const getTaMemberId = (id) => request(`/taMember/${id}`);

+ 0
- 7
src/services/taMemberCard.js Näytä tiedosto

@@ -1,7 +0,0 @@
1
-import request from "@/utils/request";
2
-
3
-
4
-/**
5
- * 会员查询
6
- */
7
-export const getTaMemberCard = (params) => request("/taMemberCard", { params });

+ 34
- 0
src/services/taPackageItem.js Näytä tiedosto

@@ -0,0 +1,34 @@
1
+import request from "@/utils/request";
2
+
3
+/*
4
+ * 分页查询
5
+ */
6
+export const getTaPackageItem = (params) => request(`/taPackageItem`, { params });
7
+
8
+/*
9
+ * 新增数据
10
+ */
11
+export const postTaPackageItem = (data) => request('/taPackageItem', { data, method: 'post' });
12
+
13
+/*
14
+ * 更新数据
15
+ */
16
+export const putTaPackageItem = (id, data) => request(`/taPackageItem/${id}`, { data, method: 'put' });
17
+
18
+/*
19
+ * 通过主键删除数据
20
+ */
21
+export const deleteTaPackageItem = (id) => request(`/taPackageItem/${id}`, { method: 'delete' });
22
+
23
+/*
24
+ * 通过ID查询单条数据
25
+ */
26
+export const getTaPackageItemId = (id) => request(`/taPackageItem/${id}`);
27
+
28
+
29
+
30
+
31
+/*
32
+ * 通过packageId查询所有
33
+ */
34
+export const getTaPackageId = (params) => request(`/taPackageIdItem`,{params});

+ 27
- 0
src/services/taProject.js Näytä tiedosto

@@ -0,0 +1,27 @@
1
+import request from "@/utils/request";
2
+
3
+
4
+/*
5
+ * 分页查询
6
+ */
7
+export const getTaProject = (params) => request(`/taProject`, { params });
8
+
9
+/*
10
+ * 新增数据
11
+ */
12
+export const postTaProject = (data) => request('/taProject', { data, method: 'post' });
13
+
14
+/*
15
+ * 更新数据
16
+ */
17
+export const putTaProject = (id, data) => request(`/taProject/${id}`, { data, method: 'put' });
18
+
19
+/*
20
+ * 通过主键删除数据
21
+ */
22
+export const deleteTaProject = (id) => request(`/taProject/${id}`, { method: 'delete' });
23
+
24
+/*
25
+ * 通过ID查询单条数据
26
+ */
27
+export const getTaProjectId = (id) => request(`/taProject/${id}`);

+ 1
- 1
src/utils/request.js Näytä tiedosto

@@ -36,7 +36,7 @@ instance.interceptors.request.use(
36 36
         ...headers,
37 37
         Authorization: token || "",
38 38
         "x-client-type":"pc.admin",
39
-        "Content-Type": "application/json;charset=utf-8"
39
+        // "Content-Type": "application/json;charset=utf-8"
40 40
       },
41 41
       responseType: download ? "blob" : responseType,
42 42
     };