|
@@ -1,13 +1,13 @@
|
|
import React from 'react'
|
|
import React from 'react'
|
|
import type { ActionType } from '@ant-design/pro-table'
|
|
import type { ActionType } from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
-import {Button, Modal, Form, Radio, Input, message, Select, DatePicker, Upload} from 'antd'
|
|
|
|
|
|
+import {Button, Modal, Form, Input, message, Select, Upload} from 'antd'
|
|
import { withRouter } from 'react-router-dom'
|
|
import { withRouter } from 'react-router-dom'
|
|
-import { User } from '../../services/user'
|
|
|
|
|
|
+import { ComplaintApi } from '../../services/complaint'
|
|
import './index.scss'
|
|
import './index.scss'
|
|
import {PlusOutlined} from "@ant-design/icons";
|
|
import {PlusOutlined} from "@ant-design/icons";
|
|
|
|
|
|
-const Complaint: React.FC = (props: any) => {
|
|
|
|
|
|
+const ComplaintPage: React.FC = (props: any) => {
|
|
const columns: any = [
|
|
const columns: any = [
|
|
{
|
|
{
|
|
title: 'ID',
|
|
title: 'ID',
|
|
@@ -80,7 +80,7 @@ const Complaint: React.FC = (props: any) => {
|
|
title: '删除记录',
|
|
title: '删除记录',
|
|
content: '你确定删除这条记录吗?',
|
|
content: '你确定删除这条记录吗?',
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
- await User({ method: 'delete', id: row.id })
|
|
|
|
|
|
+ await ComplaintApi({ method: 'delete', id: row.id })
|
|
message.success('操作成功!')
|
|
message.success('操作成功!')
|
|
actionRef.current.reload()
|
|
actionRef.current.reload()
|
|
}
|
|
}
|
|
@@ -111,11 +111,11 @@ const Complaint: React.FC = (props: any) => {
|
|
|
|
|
|
const onSubmit = () => {
|
|
const onSubmit = () => {
|
|
form.validateFields().then(async values => {
|
|
form.validateFields().then(async values => {
|
|
- await User({
|
|
|
|
|
|
+ await ComplaintApi({
|
|
method: 'post',
|
|
method: 'post',
|
|
...values,
|
|
...values,
|
|
- group_id: 11,
|
|
|
|
- department_id: 0
|
|
|
|
|
|
+ garden_id: 1,
|
|
|
|
+ apply_pic: pic.map(({ response }) => response.data),
|
|
})
|
|
})
|
|
message.success('操作成功!')
|
|
message.success('操作成功!')
|
|
form.resetFields()
|
|
form.resetFields()
|
|
@@ -130,7 +130,7 @@ const Complaint: React.FC = (props: any) => {
|
|
headerTitle="投诉建议/投诉录入"
|
|
headerTitle="投诉建议/投诉录入"
|
|
actionRef={actionRef}
|
|
actionRef={actionRef}
|
|
rowKey="key"
|
|
rowKey="key"
|
|
- request={User}
|
|
|
|
|
|
+ request={ComplaintApi}
|
|
toolBarRender={() => [
|
|
toolBarRender={() => [
|
|
<Button
|
|
<Button
|
|
type="primary"
|
|
type="primary"
|
|
@@ -143,7 +143,7 @@ const Complaint: React.FC = (props: any) => {
|
|
columns={columns}
|
|
columns={columns}
|
|
/>
|
|
/>
|
|
<Modal
|
|
<Modal
|
|
- title='添加投诉建议'
|
|
|
|
|
|
+ title='添加投诉/建议'
|
|
visible={state.visible}
|
|
visible={state.visible}
|
|
onOk={onSubmit}
|
|
onOk={onSubmit}
|
|
onCancel={() => setState(pre => ({ ...pre, visible: false }))}
|
|
onCancel={() => setState(pre => ({ ...pre, visible: false }))}
|
|
@@ -153,22 +153,22 @@ const Complaint: React.FC = (props: any) => {
|
|
wrapperCol={{ span: 15 }}
|
|
wrapperCol={{ span: 15 }}
|
|
form={form}
|
|
form={form}
|
|
>
|
|
>
|
|
- <Form.Item label='投诉类型' name="group_id" rules={[{ required: true }]}>
|
|
|
|
|
|
+ <Form.Item label='投诉类型' name="suggestion_type" rules={[{ required: true }]}>
|
|
<Select placeholder='请选择' options={[
|
|
<Select placeholder='请选择' options={[
|
|
{ label: '投诉', value: 1 },
|
|
{ label: '投诉', value: 1 },
|
|
{ label: '建议', value: 2 },
|
|
{ label: '建议', value: 2 },
|
|
]} />
|
|
]} />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
- <Form.Item label='投诉人' name="user_name" rules={[{ required: true }]}>
|
|
|
|
|
|
+ <Form.Item label='投诉人' name="apply_people" rules={[{ required: true }]}>
|
|
<Input placeholder="请输入" />
|
|
<Input placeholder="请输入" />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
- <Form.Item label='联系方式' name="user_name" rules={[{ required: true }]}>
|
|
|
|
|
|
+ <Form.Item label='联系方式' name="apply_people_phone" rules={[{ required: true }]}>
|
|
<Input placeholder="请输入" />
|
|
<Input placeholder="请输入" />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
- <Form.Item label='投诉内容' name="user_name" rules={[{ required: true }]}>
|
|
|
|
|
|
+ <Form.Item label='投诉内容' name="apply_content" rules={[{ required: true }]}>
|
|
<Input.TextArea placeholder="多行输入" rows={4} />
|
|
<Input.TextArea placeholder="多行输入" rows={4} />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
- <Form.Item label='投诉图片' name="user_name" rules={[{ required: false }]}>
|
|
|
|
|
|
+ <Form.Item label='投诉图片' name="apply_pic" rules={[{ required: false }]}>
|
|
<Upload
|
|
<Upload
|
|
action="http://localhost:3000/api/v1/upload"
|
|
action="http://localhost:3000/api/v1/upload"
|
|
listType="picture-card"
|
|
listType="picture-card"
|
|
@@ -184,4 +184,4 @@ const Complaint: React.FC = (props: any) => {
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
|
|
-export default withRouter(Complaint)
|
|
|
|
|
|
+export default withRouter(ComplaintPage)
|