Browse Source

新增联系人

outaozhen 5 years atrás
parent
commit
9502796e07

+ 0 - 8
src/components/PopContent/Contacts/ContanctLowerList.jsx

@@ -8,13 +8,6 @@ const ContanctLowerList = props => {
   const { log, servicelistName,collapsed } = props
   useEffect(() => {
     // console.log(log)
-    // const journallistData = () => {
-    //   const { dispatch } = props
-    //   dispatch({
-    //     type: 'journallist/fetch'
-    //   }) // 派发出这个action就会调用contact中的fetch函数,然后就会请求数据
-    // }
-    // journallistData()
     // const servicelisData = () => {
     //   const { dispatch } = props
     //   dispatch({
@@ -28,7 +21,6 @@ const ContanctLowerList = props => {
   // const needSubtractWidth = (collapsed ? 208 : 48) + 48 + 48 + 48 // 需要被裁掉的高度
 
   const [x, y] = useAutoTable(collapsed, needSubtractHeight)
-  // const journallist = [...journalName.list]
   // const servicelist = [...servicelistName.lists]
   const servicecolumns = [
     {

+ 156 - 0
src/pages/Customer/Contact/Addcontact/index.jsx

@@ -0,0 +1,156 @@
+import React, { useEffect } from 'react'
+import { Form, Input, Modal, Row, Col, Select } from 'antd'
+import LazyCascader from '@/components/LazyCascader'
+
+const Addcontact = props => {
+  const { visible, onCancel } = props
+  const { Option } = Select
+  const layout = {
+    labelCol: { span: 6 }
+  }
+  useEffect(() => {
+  }, [visible])
+  return (
+    <div>
+      <Modal
+        title="添加联系人"
+        width={800}
+        onCancel={onCancel}
+        onOk={onCancel}
+        visible={visible}
+      >
+        <Form
+          {...layout}
+          name="basic"
+        >
+          <Row>
+            <Col span={12}>
+              <Form.Item
+                label="姓名"
+                name="clientName"
+                rules={[{ required: true, message: '姓名' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12} />
+            <Col span={12}>
+              <Form.Item
+                label="联系人地区"
+                name=""
+                rules={[{ message: '联系人地区' }]}
+              >
+                <LazyCascader key="LazyCascader" />
+              </Form.Item>
+            </Col>
+            <Col span={12} />
+            <Col span={12}>
+              <Form.Item
+                label="性别"
+                name="gender"
+                rules={[{ message: '性别' }]}
+              >
+                <Select>
+                  <Option>男</Option>
+                  <Option>女</Option>
+                </Select>
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="昵称"
+                name="niceName"
+                rules={[{ message: '昵称' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="手机"
+                name="telephone"
+                rules={[{ required: true, message: '手机' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="QQ"
+                name="qq"
+                rules={[{ required: true, message: 'QQ' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="电话"
+                name="phone"
+                rules={[{ required: true, message: '电话' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="邮箱"
+                name="email"
+                rules={[{ required: true, message: '邮箱' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="联系人地址"
+                name="address"
+                rules={[{ message: '联系人地址' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="联系人乘车"
+                name="ride"
+                rules={[{ message: '联系人乘车' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="联系人地标"
+                name="landmarks"
+                rules={[{ message: '联系人地标' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="联系人住宿"
+                name="stay"
+                rules={[{ message: '联系人住宿' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item
+                label="备注"
+                name="mark"
+                rules={[{ message: '备注' }]}
+              >
+                <Input />
+              </Form.Item>
+            </Col>
+          </Row>
+        </Form>
+      </Modal>
+    </div>
+  )
+}
+
+export default Addcontact

+ 16 - 8
src/pages/Customer/Contact/index.jsx

@@ -1,4 +1,5 @@
 import Contacts from '@/components/PopContent/Contacts'
+import Addcontact from'@/pages/Customer/Contact/Addcontact'
 import ProTable from '@ant-design/pro-table'
 // import { PageHeaderWrapper } from '@ant-design/pro-layout';
 import { Button, Tag } from 'antd'
@@ -25,6 +26,7 @@ const Contact = props => {
     id: '',
     visible: false
   })
+  const [visible, setVisible] = useState(false)
 
   const initData = async payload => {
     const {
@@ -332,7 +334,6 @@ const Contact = props => {
     <div>
       <div className={styles.tableContent}>
         <ProTable
-          // className={styles.tableContent}
           rowKey={record => record.id}
           size="middle"
           columns={columns}
@@ -347,20 +348,27 @@ const Contact = props => {
             search: {
               onSearch: handleSearch
             },
-            actions: [<LazyCascader onSelect={handleOnselect} key="LazyCascader" />]
+            actions: [
+              <LazyCascader onSelect={handleOnselect} key="LazyCascader" />,
+              <Button key="button" type="primary" onClick={() => setVisible(true)}>
+                <SvgIcon type="icon-plus" />
+                联系人
+              </Button>
+            ]
           }}
           scroll={{ x, y }}
           columnsStateMap={columnsStateMap}
           onColumnsStateChange={map => setColumnsStateMap(map)}
           headerTitle="联系人"
-          toolBarRender={() => [
-            <Button key="button" type="primary">
-              <SvgIcon type="icon-plus" />
-              联系人
-            </Button>
-          ]}
+          // toolBarRender={() => [
+          //   <Button key="button" type="primary">
+          //     <SvgIcon type="icon-plus" />
+          //     联系人
+          //   </Button>
+          // ]}
         />
       </div>
+      <Addcontact onOk={() => setVisible(false)} visible={visible} onCancel={() => setVisible(false)}/>
       <Contacts onClose={hideDrawer} visible={state.visible} onCreate={onCreate} id={state.id} />
     </div>
   )

+ 0 - 1
src/pages/Customer/customer.less

@@ -1 +0,0 @@
-@import '~antd/es/style/themes/default.less';