周立森 5 年 前
コミット
ab4c2328c1

+ 2
- 2
src/pages/activity/drainage/DrainageList.jsx ファイルの表示

@@ -102,7 +102,7 @@ const header = (props) => {
102 102
       align: 'center',
103 103
       render: (x, row) => (
104 104
         <>
105
-          <span>{row.createDate && moment(row.createDate).format('YYYY-MM-DD hh:mm:ss')}</span>
105
+          <span>{row.createDate && moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}</span>
106 106
         </>
107 107
       ),
108 108
     },
@@ -113,7 +113,7 @@ const header = (props) => {
113 113
       align: 'center',
114 114
       render: (x, row) => (
115 115
         <>
116
-          <span>{row.endDate && moment(row.endDate).format('YYYY-MM-DD hh:mm:ss')}</span>
116
+          <span>{row.endDate && moment(row.endDate).format('YYYY-MM-DD HH:mm:ss')}</span>
117 117
         </>
118 118
       ),
119 119
     },

+ 2
- 1
src/pages/building/list/add/components/base.jsx ファイルの表示

@@ -65,6 +65,7 @@ function AddBuilding(props) {
65 65
       }
66 66
 
67 67
       res.avatarImage = res.buildingImg.map(item => item.url)
68
+      res.mapCoordinate = res.coordinate
68 69
       props.form.setFieldsValue(res)
69 70
     })
70 71
   }
@@ -219,7 +220,7 @@ function AddBuilding(props) {
219 220
             })(<Input disabled />)}
220 221
           </Form.Item>
221 222
           <Form.Item label="地图位置" >
222
-            {getFieldDecorator('coordinate')(<Amap />)}
223
+            {getFieldDecorator('mapCoordinate')(<Amap onChange={e => props.form.setFieldsValue({ coordinate: e })}/>)}
223 224
           </Form.Item>
224 225
           <Form.Item label="周边交通" >
225 226
             {getFieldDecorator('buildingTransport')(

+ 11
- 3
src/pages/customer/recommendCustomer/audit.jsx ファイルの表示

@@ -38,7 +38,7 @@ function body(props) {
38 38
   const { getFieldDecorator } = props.form
39 39
 
40 40
   // eslint-disable-next-line react-hooks/rules-of-hooks
41
-  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
41
+  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
42 42
 
43 43
   // eslint-disable-next-line react-hooks/rules-of-hooks
44 44
   const [dataSource, setDataSource] = useState({ picture: '' })
@@ -90,16 +90,17 @@ function body(props) {
90 90
 
91 91
   // 显示选择置业顾问的窗口
92 92
   function showConsultant() {
93
-    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant') })
93
+    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant'), buildingId: props.form.getFieldValue('buildingId') })
94 94
   }
95 95
 
96 96
   // 关闭选择置业顾问的窗口
97 97
   function closeConsultant() {
98
-    setVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
98
+    setVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
99 99
   }
100 100
 
101 101
   // 选择置业顾问弹窗
102 102
   function consultantSuccess(e) {
103
+    console.log(e)
103 104
     props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
104 105
   }
105 106
 
@@ -113,6 +114,13 @@ function body(props) {
113 114
             />,
114 115
           )}
115 116
         </Form.Item>
117
+        <Form.Item label="项目ID" style={{ display: 'none' }}>
118
+          {getFieldDecorator('buildingId')(
119
+            <Input
120
+              placeholder="项目ID"
121
+            />,
122
+          )}
123
+        </Form.Item>
116 124
         <Form.Item label="归属人" style={{ display: 'none' }}>
117 125
           {getFieldDecorator('realtyConsultant')(
118 126
             <Input

+ 26
- 16
src/pages/customer/recommendCustomer/components/attribution.jsx ファイルの表示

@@ -21,18 +21,18 @@ class ModalAttribution extends React.Component {
21 21
     super(props);
22 22
     this.state = {
23 23
        dataSource: { records: [] },
24
-       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '', buildingId: '' },
25 25
     }
26 26
   }
27 27
 
28 28
   // 挂载之后
29 29
   componentDidMount() {
30
-    this.getList({ pageNumber: 1, pageSize: 5 })
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31 31
   }
32 32
 
33 33
   componentDidUpdate(preProps, preState) {
34 34
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
-      this.getList({ pageNumber: 1, pageSize: 5 })
35
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
36 36
       this.setState({ visibleData: this.props.visibleData });
37 37
     }
38 38
   }
@@ -49,8 +49,12 @@ class ModalAttribution extends React.Component {
49 49
   }
50 50
 
51 51
   getList(params) {
52
+    if (params.buildingId === '') {
53
+      return
54
+    }
55
+
52 56
     // 网路请求
53
-    request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
57
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
54 58
       this.setState({ dataSource: res })
55 59
     }).catch(err => {
56 60
       // eslint-disable-next-line no-unused-expressions
@@ -68,21 +72,27 @@ class ModalAttribution extends React.Component {
68 72
 
69 73
    // 分页
70 74
   onChange(pageNum) {
71
-    this.getList({ pageNumber: pageNum, pageSize: 5 })
75
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.props.visibleData.buildingId })
72 76
   }
73 77
 
74 78
   // 提交
75 79
   submitGm(record) {
76
-    // 网路请求
77
-    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
78
-      // eslint-disable-next-line no-unused-expressions
79
-      this.openNotificationWithIcon('success', '操作成功')
80
-      this.handleCancel()
81
-      this.props.onSuccess({ realtyConsultant: record.personId, name: record.name })
82
-    }).catch(err => {
83
-      // eslint-disable-next-line no-unused-expressions
84
-      // this.openNotificationWithIcon('error', err)
85
-    })
80
+
81
+    console.log('传递之前:', record)
82
+    this.handleCancel()
83
+    this.props.onSuccess({ realtyConsultant: record.userId, name: record.userName })
84
+
85
+
86
+    // // 网路请求
87
+    // request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
88
+    //   // eslint-disable-next-line no-unused-expressions
89
+    //   this.openNotificationWithIcon('success', '操作成功')
90
+    //   this.handleCancel()
91
+    //   this.props.onSuccess({ realtyConsultant: record.personId, name: record.name })
92
+    // }).catch(err => {
93
+    //   // eslint-disable-next-line no-unused-expressions
94
+    //   // this.openNotificationWithIcon('error', err)
95
+    // })
86 96
   }
87 97
 
88 98
   render() {
@@ -117,7 +127,7 @@ class ModalAttribution extends React.Component {
117 127
         dataIndex: 'personId',
118 128
         key: 'personId',
119 129
         // eslint-disable-next-line no-nested-ternary
120
-        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
130
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.userId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
121 131
       },
122 132
     ]
123 133
     return (