소스 검색

Merge branch 'master' of http://git.ycjcjy.com/nanyang/machinery-admin

[baozhangchao] 3 년 전
부모
커밋
d7b18cfd36

+ 89
- 2
config/routes.js 파일 보기

@@ -20,7 +20,7 @@ export default [
20 20
   },
21 21
   {
22 22
     path: '/welcome',
23
-    name: 'welcome',
23
+    name: '工作台',
24 24
     icon: 'smile',
25 25
     component: './Welcome',
26 26
   },
@@ -63,6 +63,57 @@ export default [
63 63
     ],
64 64
   },
65 65
 
66
+  {
67
+    path: '/Machinery',
68
+    name: '农机管理',
69
+    icon: 'InsertRowLeftOutlined',
70
+    component: '../layouts/BasicLayout',
71
+    routes: [
72
+      {
73
+        path: '/Machinery/Cooperative',
74
+        name: '合作社列表',
75
+        component: './Machinery/Cooperative',
76
+      },
77
+      {
78
+        path: '/Machinery/Cooperative/edit.jsx',
79
+        name: '合作社编辑',
80
+        component: './Machinery/Cooperative/edit.jsx',
81
+        hideInMenu: true,
82
+      },
83
+    ],
84
+  },
85
+  {
86
+    path: '/MonitoringScreen',
87
+    name: '农机监控大屏',
88
+    icon: 'InsertRowLeftOutlined',
89
+    component: '../layouts/BasicLayout',
90
+    routes: [
91
+      {
92
+        path: '/MonitoringScreen/index.jsx',
93
+        name: '农机监控大屏',
94
+        component: './MonitoringScreen',
95
+      },
96
+      {
97
+        path: '/MonitoringScreen/detail.jsx',
98
+        name: '农机轨迹',
99
+        component: './MonitoringScreen/detail.jsx',
100
+        hideInMenu: true,
101
+      },
102
+    ],
103
+  },
104
+  {
105
+    path: '/MachineryGIS',
106
+    name: '农机GIS',
107
+    icon: 'InsertRowLeftOutlined',
108
+    component: '../layouts/BasicLayout',
109
+    routes: [
110
+      {
111
+        path: '/MachineryGIS/index.jsx',
112
+        name: '农机GIS',
113
+        component: './MachineryGIS',
114
+      },
115
+    ],
116
+  },
66 117
   {
67 118
     path: '/OrderManage',
68 119
     name: '订单调度',
@@ -70,12 +121,48 @@ export default [
70 121
     component: '../layouts/BasicLayout',
71 122
     routes: [
72 123
       {
73
-        path: '/OrderManage',
124
+        path: '/OrderManage/index.jsx',
74 125
         name: '订单调度',
75 126
         component: './OrderManage',
76 127
       },
77 128
     ],
78 129
   },
130
+  {
131
+    path: '/JobWarning',
132
+    name: '作业预警',
133
+    icon: 'InsertRowLeftOutlined',
134
+    component: '../layouts/BasicLayout',
135
+    routes: [
136
+      {
137
+        path: '/JobWarning/index.jsx',
138
+        name: '作业预警',
139
+        component: './JobWarning',
140
+      },
141
+    ],
142
+  },
143
+  {
144
+    path: '/JobStatistics',
145
+    name: '作业统计',
146
+    icon: 'InsertRowLeftOutlined',
147
+    component: '../layouts/BasicLayout',
148
+    routes: [
149
+      {
150
+        path: '/JobStatistics/Machinery',
151
+        name: '农机统计',
152
+        component: './JobStatistics/Machinery',
153
+      },
154
+      {
155
+        path: '/JobStatistics/Order',
156
+        name: '订单统计',
157
+        component: './JobStatistics/Order',
158
+      },
159
+      {
160
+        path: '/JobStatistics/RevenueExpenditure',
161
+        name: '收支统计',
162
+        component: './JobStatistics/RevenueExpenditure',
163
+      },
164
+    ],
165
+  },
79 166
   {
80 167
     path: '/Finance',
81 168
     name: '财务管理',

+ 3
- 0
src/pages/JobStatistics/Machinery/index.jsx 파일 보기

@@ -0,0 +1,3 @@
1
+export default (props) => {
2
+  return <div>农机统计</div>;
3
+};

+ 3
- 0
src/pages/JobStatistics/Order/index.jsx 파일 보기

@@ -0,0 +1,3 @@
1
+export default (props) => {
2
+  return <div>订单统计</div>;
3
+};

+ 3
- 0
src/pages/JobStatistics/RevenueExpenditure/index.jsx 파일 보기

@@ -0,0 +1,3 @@
1
+export default (props) => {
2
+  return <div>收支统计</div>;
3
+};

+ 94
- 0
src/pages/JobWarning/index.jsx 파일 보기

@@ -0,0 +1,94 @@
1
+import React from 'react';
2
+// import { getPersonList, exportPersonList } from '@/services/person';
3
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
4
+import moment from 'moment';
5
+import PageTable from '@/components/PageTable';
6
+
7
+const formatterTime = (val) => {
8
+  return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '';
9
+};
10
+
11
+export default (props) => {
12
+  const columns = [
13
+    {
14
+      title: '订单编号',
15
+      dataIndex: 'orderNum',
16
+      key: 'orderNum',
17
+    },
18
+    {
19
+      title: '农机名',
20
+      dataIndex: 'machineryName',
21
+      key: 'machineryName',
22
+    },
23
+    {
24
+      title: '农机型号',
25
+      dataIndex: 'type',
26
+      key: 'type',
27
+    },
28
+    {
29
+      title: '农机数量',
30
+      dataIndex: 'machineryNum',
31
+      key: 'machineryNum',
32
+    },
33
+    {
34
+      title: '需求时间',
35
+      dataIndex: 'appointment_date',
36
+      key: 'appointment_date',
37
+    },
38
+    {
39
+      title: '农机价格',
40
+      dataIndex: 'price',
41
+      key: 'price',
42
+      search: false,
43
+    },
44
+    {
45
+      title: '押金',
46
+      dataIndex: 'deposit',
47
+      key: 'deposit',
48
+    },
49
+    {
50
+      title: '费用',
51
+      dataIndex: 'laborCost',
52
+      key: 'laborCost',
53
+    },
54
+    {
55
+      title: '状态',
56
+      dataIndex: 'state',
57
+      key: 'state',
58
+      valueType: 'select',
59
+      valueEnum: {
60
+        '': { text: '不限', status: 'Default' },
61
+        1: { text: '未付款' },
62
+        2: { text: '已付款' },
63
+        3: { text: '待确认' },
64
+        4: { text: '进行中' },
65
+        5: { text: '待评价' },
66
+        6: { text: '已评价' },
67
+        7: { text: '申请退款' },
68
+        8: { text: '已退款' },
69
+      },
70
+    },
71
+    {
72
+      title: '下单时间',
73
+      dataIndex: 'createDate',
74
+      key: 'createDate',
75
+      search: false,
76
+      render: (t) => formatterTime(t),
77
+      width: 200,
78
+    },
79
+    // 显示待确认和需求时间差距2小时的订单  可以查看订单给农机手打电话和农户打电话
80
+  ];
81
+
82
+  return (
83
+    <PageHeaderWrapper>
84
+      <PageTable
85
+        // request={getPersonList}
86
+        // expfunc={exportPersonList}
87
+        columns={columns}
88
+        rowKey="orderId"
89
+        options={false}
90
+        scroll={{ x: 1000 }}
91
+      />
92
+    </PageHeaderWrapper>
93
+  );
94
+};

+ 154
- 0
src/pages/Machinery/Cooperative/edit.jsx 파일 보기

@@ -0,0 +1,154 @@
1
+import { Form, Input, Card, InputNumber, Select, message, Button } from 'antd';
2
+import { history } from 'umi';
3
+import ProCard from '@ant-design/pro-card';
4
+import { useState, useEffect } from 'react';
5
+// import { getTagList } from '@/services/tag';
6
+// import { addAttaList, gettaTouristForm, EditaddAttaList } from '@/services/AttaList'
7
+
8
+const { TextArea } = Input;
9
+const { Option } = Select;
10
+const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
11
+
12
+const goBack = () => {
13
+  history.goBack();
14
+};
15
+const FormItem = Form.Item;
16
+export default (props) => {
17
+  const { location } = props;
18
+  const { id } = location.query;
19
+  const [form] = Form.useForm();
20
+  const [listForm, setListForm] = useState({});
21
+  const [loading, setLoading] = useState(false);
22
+  const [imageList, setImageList] = useState([]);
23
+
24
+  const Submit = (data) => {
25
+    const typeList = (data.typeList || []).map((x) => {
26
+      return { ...x, targetId: id, targetType: 'tourist' };
27
+    });
28
+    setLoading(true);
29
+
30
+    // if (id) {
31
+    //   EditaddAttaList(id, { ...listForm, ...data, imageList, typeList }).then(() => {
32
+    //     setLoading(false);
33
+    //     message.success('数据更新成功');
34
+    //     goBack();
35
+    //   })
36
+    //     .catch(err => {
37
+    //       setLoading(false);
38
+    //       message.error(err.message || err);
39
+    //     });
40
+    // } else {
41
+    //   addAttaList({ ...data, imageList, typeList }).then((res) => {
42
+    //     setLoading(false);
43
+    //     message.success('数据保存成功');
44
+    //     history.replace(`/Attractions/Edit?id=${res.touristId}`)
45
+    //   })
46
+    //     .catch(err => {
47
+    //       setLoading(false);
48
+    //       message.error(err.message || err);
49
+    //     });
50
+    // }
51
+  };
52
+
53
+  //地址--占位
54
+  const [newLocName, setLocName] = useState('');
55
+  const [newAddress, setAddress] = useState('');
56
+
57
+  const selectTagList = (params) => {
58
+    // return getTagList({
59
+    // }).then((res) => {
60
+    // }).catch((err) => {
61
+    //   return {
62
+    //     success: false,
63
+    //   }
64
+    // })
65
+  };
66
+
67
+  const imageInput = (image) => {
68
+    return {
69
+      uid: image.imageId,
70
+      url: image.url,
71
+    };
72
+  };
73
+
74
+  const imageOutput = (image) => {
75
+    return {
76
+      imageId: image?.raw?.imageId,
77
+      shopId: id,
78
+      url: image.url,
79
+    };
80
+  };
81
+  useEffect(() => {
82
+    selectTagList();
83
+    // if (id) {
84
+    //   gettaTouristForm(id).then((res) => {
85
+    //     setListForm(res)
86
+    //     form.setFieldsValue(res)
87
+    //     setImageList(res?.imageList || [])
88
+    //   })
89
+    // }
90
+  }, [id]);
91
+
92
+  return (
93
+    <Card>
94
+      <ProCard tabs={{ type: 'card' }}>
95
+        <ProCard.TabPane key={1} tab="合作社编辑">
96
+          <Form {...formItemLayout} onFinish={Submit} form={form}>
97
+            <FormItem
98
+              label="合作社名称"
99
+              name="title"
100
+              rules={[{ required: true, message: '请输入合作社名称16个字符以内' }]}
101
+            >
102
+              <Input
103
+                placeholder="请输入合作社名称16个字符以内"
104
+                maxLength="16"
105
+                style={{ width: '350px' }}
106
+              />
107
+            </FormItem>
108
+            <FormItem
109
+              label="信用代码"
110
+              name="creditCode"
111
+              rules={[{ required: true, message: '请输入' }]}
112
+            >
113
+              <Input placeholder="请输入信用代码" style={{ width: '350px' }} />
114
+            </FormItem>
115
+            <FormItem
116
+              label="联系人"
117
+              name="name"
118
+              rules={[{ required: true, message: '请输入联系人' }]}
119
+            >
120
+              <Input placeholder="请输入联系人" rows={4} style={{ width: '350px' }} />
121
+            </FormItem>
122
+            <FormItem
123
+              label="联系方式"
124
+              name="phone"
125
+              rules={[{ required: true, message: '请输入联系方式' }]}
126
+            >
127
+              <Input placeholder="请输入联系方式" rows={4} style={{ width: '350px' }} />
128
+            </FormItem>
129
+            <FormItem
130
+              label="地址"
131
+              name="address"
132
+              rules={[{ required: true, message: '请输入地址' }]}
133
+            >
134
+              <TextArea placeholder="请输入地址" style={{ width: '350px' }} />
135
+            </FormItem>
136
+            <FormItem label=" " colon={false}>
137
+              <Button type="default" onClick={() => goBack()}>
138
+                返回
139
+              </Button>
140
+              <Button
141
+                type="primary"
142
+                loading={loading}
143
+                htmlType="submit"
144
+                style={{ marginLeft: '4em' }}
145
+              >
146
+                保存
147
+              </Button>
148
+            </FormItem>
149
+          </Form>
150
+        </ProCard.TabPane>
151
+      </ProCard>
152
+    </Card>
153
+  );
154
+};

+ 89
- 0
src/pages/Machinery/Cooperative/index.jsx 파일 보기

@@ -0,0 +1,89 @@
1
+import React from 'react';
2
+import { history, Link } from 'umi';
3
+import { Button, Popconfirm, message, Tooltip } from 'antd';
4
+// import { getPersonList, exportPersonList } from '@/services/person';
5
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
6
+import moment from 'moment';
7
+import PageTable from '@/components/PageTable';
8
+
9
+const formatterTime = (val) => {
10
+  return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '';
11
+};
12
+
13
+export default (props) => {
14
+  const columns = [
15
+    {
16
+      title: '合作社名',
17
+      dataIndex: 'title',
18
+      key: 'title',
19
+    },
20
+    {
21
+      title: '地址',
22
+      dataIndex: 'address',
23
+      key: 'address',
24
+    },
25
+    {
26
+      title: '联系人',
27
+      dataIndex: 'name',
28
+      key: 'name',
29
+    },
30
+    {
31
+      title: '手机号',
32
+      dataIndex: 'phone',
33
+      key: 'phone',
34
+    },
35
+    {
36
+      title: '农机数',
37
+      dataIndex: 'machineryNum',
38
+      key: 'machineryNum',
39
+    },
40
+    {
41
+      title: '员工数',
42
+      dataIndex: 'employeesNum',
43
+      key: 'employeesNum',
44
+    },
45
+    {
46
+      title: '完成订单数',
47
+      dataIndex: 'orderNum',
48
+      key: 'orderNum',
49
+      search: false,
50
+    },
51
+    {
52
+      title: '评分',
53
+      dataIndex: 'score',
54
+      key: 'score',
55
+    },
56
+    {
57
+      title: '操作',
58
+      valueType: 'option',
59
+      render: (_, record) => [
60
+        <Link key={1} to={`./edit.jsx`}>
61
+          编辑
62
+        </Link>,
63
+        <Popconfirm
64
+          key={2}
65
+          title="您是否确认删除 ?"
66
+          onConfirm={() => handleDelete(record.cooperativeId)}
67
+          okText="确定"
68
+          cancelText="取消"
69
+        >
70
+          <a href="#">删除</a>
71
+        </Popconfirm>,
72
+      ],
73
+    },
74
+    // 农机列表点击进入详情页 下面是轨迹上面是时间
75
+  ];
76
+  const handleDelete = () => {};
77
+  return (
78
+    <PageHeaderWrapper>
79
+      <PageTable
80
+        // request={getPersonList}
81
+        // expfunc={exportPersonList}
82
+        columns={columns}
83
+        rowKey="cooperativeId"
84
+        options={false}
85
+        scroll={{ x: 1000 }}
86
+      />
87
+    </PageHeaderWrapper>
88
+  );
89
+};

+ 3
- 0
src/pages/MachineryGIS/index.jsx 파일 보기

@@ -0,0 +1,3 @@
1
+export default (props) => {
2
+  return <div>农机GIS</div>;
3
+};

+ 3
- 0
src/pages/MonitoringScreen/detail.jsx 파일 보기

@@ -0,0 +1,3 @@
1
+export default (props) => {
2
+  return <div>监控轨迹</div>;
3
+};

+ 49
- 0
src/pages/MonitoringScreen/index.jsx 파일 보기

@@ -0,0 +1,49 @@
1
+import React from 'react';
2
+import { history, Link } from 'umi';
3
+// import { getPersonList, exportPersonList } from '@/services/person';
4
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
5
+import moment from 'moment';
6
+import PageTable from '@/components/PageTable';
7
+
8
+const formatterTime = (val) => {
9
+  return val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : '';
10
+};
11
+
12
+export default (props) => {
13
+  const columns = [
14
+    {
15
+      title: '农机名',
16
+      dataIndex: 'machineryName',
17
+      key: 'machineryName',
18
+    },
19
+    {
20
+      title: '农机型号',
21
+      dataIndex: 'type',
22
+      key: 'type',
23
+    },
24
+    {
25
+      title: '操作',
26
+      valueType: 'option',
27
+      width: '300px',
28
+      render: (_, record) => [
29
+        <Link key={2} to={`./detail.jsx`}>
30
+          查看轨迹
31
+        </Link>,
32
+      ],
33
+    },
34
+    // 农机列表点击进入详情页 下面是轨迹上面是时间
35
+  ];
36
+
37
+  return (
38
+    <PageHeaderWrapper>
39
+      <PageTable
40
+        // request={getPersonList}
41
+        // expfunc={exportPersonList}
42
+        columns={columns}
43
+        rowKey="machineryId"
44
+        options={false}
45
+        scroll={{ x: 1000 }}
46
+      />
47
+    </PageHeaderWrapper>
48
+  );
49
+};

+ 1
- 0
src/pages/OrderManage/index.jsx 파일 보기

@@ -39,6 +39,7 @@ export default (props) => {
39 39
       title: '农机价格',
40 40
       dataIndex: 'price',
41 41
       key: 'price',
42
+      search: false,
42 43
     },
43 44
     {
44 45
       title: '押金',