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