Przeglądaj źródła

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev

顾绍勇 5 lat temu
rodzic
commit
43dbb2c10a

+ 2
- 2
config/config.js Wyświetl plik

83
   targets: {
83
   targets: {
84
     ie: 11,
84
     ie: 11,
85
   },
85
   },
86
-  publicPath: './',
87
-  // publicPath: 'https://njcjweb.oss-accelerate.aliyuncs.com/admin/',
86
+  // publicPath: './',
87
+  publicPath: 'https://njcjweb.oss-accelerate.aliyuncs.com/admin/',
88
   history: 'hash',
88
   history: 'hash',
89
   devtool: isAntDesignProPreview ? 'source-map' : false,
89
   devtool: isAntDesignProPreview ? 'source-map' : false,
90
   // umi routes: https://umijs.org/zh/guide/router.html
90
   // umi routes: https://umijs.org/zh/guide/router.html

BIN
public/favicon.png Wyświetl plik


+ 1
- 1
src/components/SelectButton/BuildSelect.jsx Wyświetl plik

55
       filterOption={(input, option) =>
55
       filterOption={(input, option) =>
56
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
56
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
57
       }>
57
       }>
58
-          <Option key="" value="">全部项目</Option>
58
+          {/* <Option key="" value="">全部项目</Option> */}
59
           {data.map(building => (
59
           {data.map(building => (
60
             <Option key={building.buildingId} value={building.buildingId}>{building.buildingName}</Option>
60
             <Option key={building.buildingId} value={building.buildingId}>{building.buildingName}</Option>
61
           ))}
61
           ))}

+ 1
- 1
src/components/SelectButton/channelSelect.jsx Wyświetl plik

37
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
37
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
38
       }>
38
       }>
39
           {data.map(Item => (
39
           {data.map(Item => (
40
-            <Option key={Item.channelId} value={Item.channelId}> {console.log(Item)}{Item.channelName} </Option>
40
+            <Option key={Item.channelId} value={Item.channelId}> {Item.channelName} </Option>
41
           ))}
41
           ))}
42
       </Select>
42
       </Select>
43
   )
43
   )

+ 2
- 2
src/pages/activity/ActivityList.jsx Wyświetl plik

43
   }, [])
43
   }, [])
44
 
44
 
45
   // 跳转到编辑商品
45
   // 跳转到编辑商品
46
-  const toEditGoods = dynamicId => () => {
46
+  const toEditGoods = dynamicId  => () => {
47
     router.push({
47
     router.push({
48
       pathname: '/activity/editActivity',
48
       pathname: '/activity/editActivity',
49
       query: {
49
       query: {
196
           {<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={toDataReacord(row.dynamicId)}>数据记录<Icon type="form" className={styles.edit} /></span>}
196
           {<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={toDataReacord(row.dynamicId)}>数据记录<Icon type="form" className={styles.edit} /></span>}
197
           {/* </AuthButton> */}
197
           {/* </AuthButton> */}
198
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
198
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
199
-            {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>}
199
+            {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId,row.count)}>编辑<Icon type="form" className={styles.edit} /></span>}
200
           </AuthButton>
200
           </AuthButton>
201
           
201
           
202
           {/* {(row.activityStatus === 0 || row.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>{'下载二维码'} {<Icon type="qrcode" className={styles.shoppingCart} />}</span>} */}
202
           {/* {(row.activityStatus === 0 || row.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>{'下载二维码'} {<Icon type="qrcode" className={styles.shoppingCart} />}</span>} */}

+ 1
- 0
src/pages/activity/dataRecord/index.jsx Wyświetl plik

46
     return <>
46
     return <>
47
         <div>
47
         <div>
48
             <div>
48
             <div>
49
+                <span>{data.activityName || '0'}</span>
49
                 <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
50
                 <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
50
                 <Modal
51
                 <Modal
51
                     title="指标说明(数据会存在一定时间延迟)"
52
                     title="指标说明(数据会存在一定时间延迟)"

+ 5
- 4
src/pages/activity/editActivity.jsx Wyświetl plik

121
             message.info(checks)
121
             message.info(checks)
122
             return
122
             return
123
           }
123
           }
124
-          console.log(data.count,values.personNum)
125
-          if (data.count || 0 > values.personNum) {
124
+          console.log(data.enlistNum,values.personNum,'143')
125
+
126
+          if (data.enlistNum > values.personNum) {
126
             message.info('活动人数必须大于已报名人数')
127
             message.info('活动人数必须大于已报名人数')
127
             return
128
             return
128
           }
129
           }
257
               //   message: '活动人数必须大于已报名人数',
258
               //   message: '活动人数必须大于已报名人数',
258
               // },
259
               // },
259
             ],
260
             ],
260
-          })(<Input type="number"   />)}
261
+          })(<Input type="number" />)}
261
         </Form.Item>
262
         </Form.Item>
262
         <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
263
         <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
263
           {getFieldDecorator('maxEnlistByPerson', {
264
           {getFieldDecorator('maxEnlistByPerson', {
320
   const { dynamicId } = props.location.query
321
   const { dynamicId } = props.location.query
321
 
322
 
322
 
323
 
323
-  const Poster = (props) => {
324
+  const Poster = props => {
324
     const [inputValue, changeInput] = useState('')
325
     const [inputValue, changeInput] = useState('')
325
     const [textAreaValue, changeTextArea] = useState('')
326
     const [textAreaValue, changeTextArea] = useState('')
326
     const [imgValue, changeImg] = useState('')
327
     const [imgValue, changeImg] = useState('')

+ 1
- 1
src/pages/activity/groupActivity/detailActivity.jsx Wyświetl plik

121
           <img src={detailData.bannerListImg} height="125px" width="375px" />
121
           <img src={detailData.bannerListImg} height="125px" width="375px" />
122
         </Form.Item>
122
         </Form.Item>
123
         <Form.Item label="活动时间">
123
         <Form.Item label="活动时间">
124
-          <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(detailData.endDate).format('YYYY-MM-DD HH:mm:ss')}`}</span>
124
+      <span>{`${moment(detailData.startTime).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(detailData.endTime).format('YYYY-MM-DD HH:mm:ss')}`}</span>
125
         </Form.Item>
125
         </Form.Item>
126
         <Form.Item label="成团人数">
126
         <Form.Item label="成团人数">
127
             <span>{detailData.groupBuyPeople}</span>
127
             <span>{detailData.groupBuyPeople}</span>

+ 337
- 337
src/pages/activity/groupActivity/editGroupActivity.jsx Wyświetl plik

27
   });
27
   });
28
 }
28
 }
29
 
29
 
30
-/**
31
- *
32
- *
33
- * @param {*} props
34
- * @returns
35
- */
36
-const Edit = props => {
37
-  const [tab, changeTab] = useState('basic')
38
-  // 判断是否展示助力次数的输入框
39
-  const { groupActivityId } = props.location.query
40
-  const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
41
-  const [scoreData, setScoreData] = useState({})
42
-  const [activityStatus, setActivityStatus] = useState({})
43
-  const [disable, setDisable] = useState(false)
44
 
30
 
45
-  useEffect(() => {
46
-    request(apis.groupActivity.avgScore).then((data) => {
47
-      setScoreData(data);
48
-    })
49
-  }, [])
31
+const Basic = props => {
32
+  const { dynamicData, disable, activityStatus, scoreData, groupActivityId } = props;
50
 
33
 
51
-    useEffect(() => {
52
-      if (groupActivityId) {
53
-      getDynamicData(groupActivityId);
54
-    }
55
-    }, [groupActivityId])
34
+  const fields = [
35
+    {
36
+      label: '选择项目',
37
+      name: 'buildingId',
38
+      render: <BuildSelect disabled={disable}/>,
39
+      value: dynamicData.buildingId,
40
+      rules: [
41
+        { required: true, message: '请选择项目' },
42
+      ],
43
+    },
44
+    {
45
+      label: '活动标题',
46
+      name: 'activityName',
47
+      type: FieldTypes.Text,
48
+      value: dynamicData.activityName,
49
+      rules: [
50
+        { required: true, message: '请输入活动标题' },
51
+      ]
52
+    },
53
+    {
54
+      label: '拼团详情主图',
55
+      name: 'mainImg',
56
+      type: FieldTypes.ImageUploader,
57
+      value: dynamicData.mainImg,
58
+      rules: [
59
+        { required: true, message: '请输入拼团详情主图' },
60
+      ],
61
+      help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:拼团活动详情',
62
+    },
63
+    {
64
+      label: '拼团封面图1',
65
+      name: 'listImg',
66
+      type: FieldTypes.ImageUploader,
67
+      value: dynamicData.listImg,
68
+      rules: [
69
+        { required: true, message: '请输入拼团封面图1' },
70
+      ],
71
+      help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于:活动列表/首页推荐',
72
+    },
73
+    {
74
+      label: '拼团封面图2',
75
+      name: 'bannerListImg',
76
+      type: FieldTypes.ImageUploader,
77
+      value: dynamicData.bannerListImg,
78
+      rules: [
79
+        { required: true, message: '请输入拼团封面图2' },
80
+      ],
81
+      help: '建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页',
82
+    },
83
+    {
84
+      label: '活动时间',
85
+      name: 'activityTime',
86
+      type: FieldTypes.RangePicker,
87
+      value: dynamicData.startTime != null ? [moment(dynamicData.startTime, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endTime, 'YYYY-MM-DD HH:mm')] : null,
88
+      props: { showTime: { format: 'HH:mm' } },
89
+      rules: [
90
+        { required: true, message: '请选择活动时间' },
91
+      ],
92
+    },
93
+    {
94
+      label: '成团人数',
95
+      name: 'groupBuyPeople',
96
+      type: FieldTypes.Text,
97
+      value: dynamicData.groupBuyPeople,
98
+      props: { disabled: activityStatus === 0 },
99
+      help: '注:成团所需人数',
100
+      rules: [
101
+        { required: true, message: '请输入成团人数' },
102
+      ]
103
+    },
104
+    {
105
+      label: '所需积分',
106
+      name: 'integral',
107
+      type: FieldTypes.Text,
108
+      value: dynamicData.integral,
109
+      props: { disabled: activityStatus === 0 },
110
+      help: `注:用户平均积分${scoreData.averageScore}`,
111
+      rules: [
112
+        { required: true, message: '请输入所需积分' },
113
+      ]
114
+    },
115
+    {
116
+      label: '活动说明',
117
+      name: 'descImg',
118
+      type: FieldTypes.ImageUploader,
119
+      value: dynamicData.descImg,
120
+      rules: [
121
+        { required: true, message: '请输入活动说明' },
122
+      ],
123
+      help: '建议宽度:750px,高度不限,格式:jpg,用于活动详情',
124
+    },
125
+    {
126
+      label: '权重',
127
+      name: 'heavy',
128
+      type: FieldTypes.Number,
129
+      render: <Input type="number" style={{ width: 80}} />,
130
+      value: dynamicData.heavy,
131
+      rules: [
132
+        { required: true, message: '请输入权重' },
133
+      ],
134
+      help: '数字越大越靠前',
135
+    },
136
+  ]
56
 
137
 
57
-    // 详情
58
-    const getDynamicData = (groupActivityId) => {
59
-      request({ ...apis.groupActivity.details, urlData: { id: groupActivityId } }).then((data) => {
60
-        setDynamicData(data)
61
-        setActivityStatus(data.activityStatus)
62
-        setDisable(data.activityStatus === 0 ? true : false)
63
-      })
138
+  function compareDate(dateTime1, dateTime2) {
139
+    return new Date(dateTime1) > new Date(dateTime2);
64
   }
140
   }
65
 
141
 
66
-  const radioOnChange = e => {
67
-    console.log(e.target.value)
68
-    setDynamicData({ ...dynamicData, isEnlist: e.target.value })
69
-  }
142
+  const handleSubmit = val => {
143
+    const { activityTime, signupTime, ...submitValue } = val
70
 
144
 
71
-  const Basic = props => {
72
-    const fields = [
73
-      {
74
-        label: '选择项目',
75
-        name: 'buildingId',
76
-        render: <BuildSelect disabled={disable}/>,
77
-        value: dynamicData.buildingId,
78
-        rules: [
79
-          { required: true, message: '请选择项目' },
80
-        ],
81
-      },
82
-      {
83
-        label: '活动标题',
84
-        name: 'activityName',
85
-        type: FieldTypes.Text,
86
-        value: dynamicData.activityName,
87
-        rules: [
88
-          { required: true, message: '请输入活动标题' },
89
-        ]
90
-      },
91
-      {
92
-        label: '拼团详情主图',
93
-        name: 'mainImg',
94
-        type: FieldTypes.ImageUploader,
95
-        value: dynamicData.mainImg,
96
-        rules: [
97
-          { required: true, message: '请输入拼团详情主图' },
98
-        ],
99
-        help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:拼团活动详情',
100
-      },
101
-      {
102
-        label: '拼团封面图1',
103
-        name: 'listImg',
104
-        type: FieldTypes.ImageUploader,
105
-        value: dynamicData.listImg,
106
-        rules: [
107
-          { required: true, message: '请输入拼团封面图1' },
108
-        ],
109
-        help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于:活动列表/首页推荐',
110
-      },
111
-      {
112
-        label: '拼团封面图2',
113
-        name: 'bannerListImg',
114
-        type: FieldTypes.ImageUploader,
115
-        value: dynamicData.bannerListImg,
116
-        rules: [
117
-          { required: true, message: '请输入拼团封面图2' },
118
-        ],
119
-        help: '建议图片尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页',
120
-      },
121
-      {
122
-        label: '活动时间',
123
-        name: 'activityTime',
124
-        type: FieldTypes.RangePicker,
125
-        value: dynamicData.startTime != null ? [moment(dynamicData.startTime, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endTime, 'YYYY-MM-DD HH:mm')] : null,
126
-        props: { showTime: { format: 'HH:mm' } },
127
-        rules: [
128
-          { required: true, message: '请选择活动时间' },
129
-        ],
130
-      },
131
-      {
132
-        label: '成团人数',
133
-        name: 'groupBuyPeople',
134
-        type: FieldTypes.Text,
135
-        value: dynamicData.groupBuyPeople,
136
-        props: {disabled: activityStatus === 0 ? true : false },
137
-        help: '注:成团所需人数',
138
-        rules: [
139
-          { required: true, message: '请输入成团人数' },
140
-        ]
141
-      },
142
-      {
143
-        label: '所需积分',
144
-        name: 'integral',
145
-        type: FieldTypes.Text,
146
-        value: dynamicData.integral,
147
-        props: {disabled: activityStatus === 0 ? true : false },
148
-        help: '注:用户平均积分' + scoreData.averageScore,
149
-        rules: [
150
-          { required: true, message: '请输入所需积分' },
151
-        ]
152
-      },
153
-      {
154
-        label: '活动说明',
155
-        name: 'descImg',
156
-        type: FieldTypes.ImageUploader,
157
-        value: dynamicData.descImg,
158
-        rules: [
159
-          { required: true, message: '请输入活动说明' },
160
-        ],
161
-        help: '建议宽度:750px,高度不限,格式:jpg,用于活动详情',
162
-      },
163
-      {
164
-        label: '权重',
165
-        name: 'heavy',
166
-        type: FieldTypes.Number,
167
-        render: <Input type="number" style={{ width: 80}} />,
168
-        value: dynamicData.heavy,
169
-        rules: [
170
-          { required: true, message: '请输入权重' },
171
-        ],
172
-        help: '数字越大越靠前',
173
-      },
174
-    ]
145
+    const [startTime, endTime] = activityTime
146
+    submitValue.startTime = moment(startTime).format('YYYY-MM-DD HH:mm');
147
+    submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
175
 
148
 
176
-    function compareDate(dateTime1, dateTime2) {
177
-      var formatDate1 = new Date(dateTime1)
178
-      var formatDate2 = new Date(dateTime2)
179
-      if (formatDate1 > formatDate2) {
180
-        return true;
181
-      }
182
-      else {
183
-        return false;
149
+    if (groupActivityId) {
150
+      const nowDate = new Date()
151
+      if (!compareDate(nowDate, startTime)) {
152
+        message.info('修改后的开始时间不得大于当前时间(会存在已经成功助力或者发起助力的用户)')
153
+        return
184
       }
154
       }
155
+      submitValue.groupActivityId = groupActivityId
156
+      request({ ...apis.groupActivity.update, data: submitValue }).then(data => {
157
+        message.info('保存成功')
158
+        // cancelPage()
159
+      }).catch(() => {
160
+        // message.info(err.msg || err.message)
161
+      })
162
+    } else {
163
+      request({ ...apis.groupActivity.add, data: submitValue }).then(data => {
164
+        router.push({
165
+          pathname: '/activity/groupActivity/editGroupActivity',
166
+          query: {
167
+            groupActivityId: data,
168
+          },
169
+        });
170
+        message.info("保存成功")
171
+        // cancelPage()
172
+      }).catch(() => {
173
+        // message.info(err.msg || err.message)
174
+      })
185
     }
175
     }
176
+  }
186
 
177
 
187
-    const handleSubmit = val => {
188
-      const { activityTime, signupTime, ...submitValue } = val
189
-      console.log('val', val)
190
-      const [startTime, endTime] = activityTime
191
-      submitValue.startTime = moment(startTime).format('YYYY-MM-DD HH:mm');
192
-      submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
193
-      console.log('submit data --->', submitValue)
194
-      if (groupActivityId) {
178
+  return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
179
+}
195
 
180
 
196
-        const nowDate = new Date()
197
-        if (!compareDate(nowDate, startTime)) {
181
+const Poster = props => {
182
+  const { groupActivityId } = props;
183
+  const [inputValue, changeInput] = useState('')
184
+  const [textAreaValue, changeTextArea] = useState('')
185
+  const [imgValue, changeImg] = useState('')
186
+  const [posterId, setPosterId] = useState('')
187
+  // const [miniappName, setMiniappName] = useState('')
198
 
188
 
199
-          message.info("修改后的开始时间不得大于当前时间(会存在已经成功助力或者发起助力的用户)")
200
-          return
189
+  useEffect(() => {
190
+    if (groupActivityId) {
191
+      request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then(data => {
192
+        if (data.length > 0) {
193
+          setPosterId(data[0].posterId)
194
+          changeImg(data[0].posterImg)
195
+          changeTextArea(data[0].posterDescription)
196
+          changeInput(data[0].posterTitle)
201
         }
197
         }
202
-        submitValue.groupActivityId = groupActivityId
203
-        request({ ...apis.groupActivity.update, data: submitValue }).then((data) => {
204
-          message.info("保存成功")
205
-          // cancelPage()
206
-        }).catch((err) => {
207
-          // message.info(err.msg || err.message)
208
-        })
209
-      } else {
210
-        request({ ...apis.groupActivity.add, data: submitValue }).then((data) => {
211
-          router.push({
212
-            pathname: '/activity/groupActivity/editGroupActivity',
213
-            query: {
214
-              groupActivityId: data,
215
-            },
216
-          });
217
-          message.info("保存成功")
218
-          // cancelPage()
219
-        }).catch((err) => {
220
-          // message.info(err.msg || err.message)
221
-        })
222
-      }
198
+      }).catch(err => {
199
+        message.info(err.msg || err.message)
200
+      })
223
     }
201
     }
224
 
202
 
225
-    return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
226
-  }
203
+    // getMiniappName()
204
+  }, [])
227
 
205
 
228
-  const Poster = (props) => {
229
-    const [inputValue, changeInput] = useState('')
230
-    const [textAreaValue, changeTextArea] = useState('')
231
-    const [imgValue, changeImg] = useState('')
232
-    const [posterId, setPosterId] = useState('')
206
+  // // 获取小程序名称
207
+  // function getMiniappName() {
208
+  //   request({ ...apis.building.getMiniappName }).then(res => {
209
+  //     setMiniappName(res)
210
+  //   })
211
+  // }
233
 
212
 
213
+  const submitPoster = () => {
234
     if (groupActivityId) {
214
     if (groupActivityId) {
235
-      console.log(groupActivityId, 'groupActivityId')
236
-      useEffect(() => {
237
-        request({ ...apis.activity.poster, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then((data) => {
238
-          if (data.length > 0) {
239
-            setPosterId(data[0].posterId)
240
-            changeImg(data[0].posterImg)
241
-            changeTextArea(data[0].posterDescription)
242
-            changeInput(data[0].posterTitle)
243
-          }
244
-        }).catch((err) => {
215
+      if (posterId) {
216
+        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: groupActivityId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then(data => {
217
+          message.info('保存成功')
218
+        }).catch(err => {
245
           message.info(err.msg || err.message)
219
           message.info(err.msg || err.message)
246
         })
220
         })
247
-        getMiniappName()
248
-      }, [])
249
-    }else{
250
-      getMiniappName()
251
-    }
252
-    // 获取小程序名称
253
-    const [miniappName, setMiniappName] = useState('')
254
-    function getMiniappName() {
255
-      request({ ...apis.building.getMiniappName }).then(res => {
256
-        console.log(res, "0000000000000")
257
-        setMiniappName(res)
258
-      })
259
-    }
260
-
261
-    const submitPoster = () => {
262
-      if (groupActivityId) {
263
-        if (posterId) {
264
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: groupActivityId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
265
-            message.info("保存成功")
266
-          }).catch((err) => {
267
-            message.info(err.msg || err.message)
268
-          })
269
-        } else {
270
-          request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
271
-            setPosterId(data.posterId)
272
-            message.info("保存成功")
273
-          }).catch((err) => {
274
-            message.info(err.msg || err.message)
275
-          })
276
-        }
277
       } else {
221
       } else {
278
-        message.warn("请先保存基本信息数据")
222
+        request({ ...apis.activity.addPoster, data: { targetId: groupActivityId, targetType: 'groupActivity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then(data => {
223
+          setPosterId(data.posterId)
224
+          message.info('保存成功')
225
+        }).catch(err => {
226
+          message.info(err.msg || err.message)
227
+        })
279
       }
228
       }
229
+    } else {
230
+      message.warn('请先保存基本信息数据')
280
     }
231
     }
232
+  }
281
 
233
 
282
-    return <div>
283
-      <div style={{ display: 'flex' }}>
284
-        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
285
-          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
286
-            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
287
-            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
288
-              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
289
-              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
290
-              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
291
-              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
292
-            </div>
293
-            <p style={{
294
-              margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
295
-              display: '-webkit-box', lineClamp: '3', height: '60px',
296
-              WebkitLineClamp: '2',
297
-              WebkitBoxOrient: 'vertical',
298
-              overflow: 'hidden',
299
-              textOverflow: 'ellipsis'
300
-            }}>{inputValue ? inputValue : '海报标题'}</p>
301
-
302
-            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
303
-            <p style={{
304
-              margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
305
-              display: '-webkit-box', lineClamp: '3', height: '72px',
306
-              WebkitLineClamp: '3',
307
-              WebkitBoxOrient: 'vertical',
308
-              overflow: 'hidden',
309
-              textOverflow: 'ellipsis'
310
-            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
311
-            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
312
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
313
-              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
314
-              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
315
-            </div>
234
+  return <div>
235
+    <div style={{ display: 'flex' }}>
236
+      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
237
+        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
238
+          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
239
+          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
240
+            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
241
+            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
242
+            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
243
+            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
316
           </div>
244
           </div>
317
-          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
318
-        </div>
245
+          <p style={{
246
+            margin: '10px 20px',
247
+            fontSize: '20px',
248
+            color: '#222',
249
+            fontWeight: '600',
250
+            display: '-webkit-box',
251
+            lineClamp: '3',
252
+            height: '60px',
253
+            WebkitLineClamp: '2',
254
+            WebkitBoxOrient: 'vertical',
255
+            overflow: 'hidden',
256
+            textOverflow: 'ellipsis',
257
+          }}>{inputValue || '海报标题'}</p>
319
 
258
 
320
-        <div >
321
-          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
322
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
323
-            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
324
-          </div>
325
-          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600,比例5:4,格式:jpg,用于拼团活动海报</p>
326
-          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
327
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
328
-            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
329
-          </div>
330
-          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
331
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
332
-            <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
259
+          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
260
+          <p style={{
261
+            margin: '16px 20px 28px 20px',
262
+            fontSize: '17px',
263
+            color: '#999',
264
+            display: '-webkit-box',
265
+            lineClamp: '3',
266
+            height: '72px',
267
+            WebkitLineClamp: '3',
268
+            WebkitBoxOrient: 'vertical',
269
+            overflow: 'hidden',
270
+            textOverflow: 'ellipsis',
271
+          }}>{ textAreaValue || '海报描述'}</p>
272
+          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
273
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
274
+            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
275
+            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
333
           </div>
276
           </div>
277
+        </div>
278
+        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
279
+      </div>
334
 
280
 
281
+      <div >
282
+        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
283
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
284
+          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
285
+        </div>
286
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600,比例5:4,格式:jpg,用于拼团活动海报</p>
287
+        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
288
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
289
+          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
335
         </div>
290
         </div>
291
+        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
292
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
293
+          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
294
+        </div>
295
+
336
       </div>
296
       </div>
337
-      <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
338
-      <Button onClick={() => cancelPage()}>取消</Button>
339
     </div>
297
     </div>
340
-
341
-  }
298
+    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
299
+    <Button onClick={() => cancelPage()}>取消</Button>
300
+  </div>
301
+}
342
 
302
 
343
 
303
 
304
+const Share = props => {
305
+  const { groupActivityId } = props
306
+  const [inputValue, changeInput] = useState('')
307
+  const [imgValue, changeImg] = useState('')
308
+  const [shareContentId, setShareContentId] = useState('')
344
 
309
 
345
-  const Share = (props) => {
346
-    const [inputValue, changeInput] = useState('')
347
-    const [imgValue, changeImg] = useState('')
348
-    const [shareContentId, setShareContentId] = useState('')
310
+  useEffect(() => {
311
+      if (groupActivityId) {
312
+      request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' } }).then(data => {
313
+        if (data.length > 0) {
314
+          setShareContentId(data[0].shareContentId)
315
+          changeImg(data[0].shareContentImg)
316
+          changeInput(data[0].shareContentTitle)
317
+        }
318
+      }).catch(err => {
319
+        message.info(err.msg || err.message)
320
+      })
321
+    }
322
+  }, [])
349
 
323
 
324
+  const submitShare = () => {
350
     if (groupActivityId) {
325
     if (groupActivityId) {
351
-      useEffect(() => {
352
-        request({ ...apis.activity.shareContent, params: { targetId: groupActivityId, targetType: 'groupActivity' }, }).then((data) => {
353
-          console.log(data, "2222")
354
-          if (data.length > 0) {
355
-            setShareContentId(data[0].shareContentId)
356
-            changeImg(data[0].shareContentImg)
357
-            changeInput(data[0].shareContentTitle)
358
-          }
359
-        }).catch((err) => {
326
+      if (shareContentId) {
327
+        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
328
+          message.info('保存成功')
329
+        }).catch(err => {
360
           message.info(err.msg || err.message)
330
           message.info(err.msg || err.message)
361
         })
331
         })
362
-      }, [])
363
-    }
364
-
365
-    const submitShare = () => {
366
-      if (groupActivityId) {
367
-        if (shareContentId) {
368
-          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
369
-            message.info("保存成功")
370
-          }).catch((err) => {
371
-            message.info(err.msg || err.message)
372
-          })
373
-        } else {
374
-          request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
375
-            setShareContentId(data.shareContentId)
376
-            message.info("保存成功")
377
-          }).catch((err) => {
378
-            message.info(err.msg || err.message)
379
-          })
380
-        }
381
       } else {
332
       } else {
382
-        message.warn("请先保存基本信息数据")
333
+        request({ ...apis.activity.addShareContent, data: { targetId: groupActivityId, shareContentType: 'groupActivity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then(data => {
334
+          setShareContentId(data.shareContentId)
335
+          message.info('保存成功')
336
+        }).catch(err => {
337
+          message.info(err.msg || err.message)
338
+        })
383
       }
339
       }
340
+    } else {
341
+      message.warn('请先保存基本信息数据')
384
     }
342
     }
343
+  }
385
 
344
 
386
-    return <div style={{ padding: '20px' }}>
387
-      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
388
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
389
-        <div>
390
-          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
391
-          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
392
-          <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
393
-        </div>
394
-      </div>
395
-      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
396
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
397
-        <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
398
-      </div>
399
-      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
400
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
401
-        <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
345
+  return <div style={{ padding: '20px' }}>
346
+    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
347
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
348
+      <div>
349
+        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />橙蕉互动</p>
350
+        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue || '置业V客厅 精准获客平台'}</p>
351
+        <img style={{ width: '200px', height: '160px' }} src={imgValue || poster2} alt="" />
402
       </div>
352
       </div>
403
-      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
404
-      <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
405
-      <Button onClick={() => cancelPage()}>取消</Button>
406
     </div>
353
     </div>
354
+    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
355
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
356
+      <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
357
+    </div>
358
+    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
359
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
360
+      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
361
+    </div>
362
+    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
363
+    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
364
+    <Button onClick={() => cancelPage()}>取消</Button>
365
+  </div>
366
+}
367
+
368
+
369
+/**
370
+ *
371
+ *
372
+ * @param {*} props
373
+ * @returns
374
+ */
375
+const Edit = props => {
376
+  const [tab, changeTab] = useState('basic')
377
+  // 判断是否展示助力次数的输入框
378
+  const { groupActivityId } = props.location.query
379
+  const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
380
+  const [scoreData, setScoreData] = useState({})
381
+  const [activityStatus, setActivityStatus] = useState({})
382
+  const [disable, setDisable] = useState(false)
383
+
384
+  // 详情
385
+  const getDynamicData = id => {
386
+    request({ ...apis.groupActivity.details, urlData: { id } }).then(data => {
387
+      setDynamicData(data)
388
+      setActivityStatus(data.activityStatus)
389
+      setDisable(data.activityStatus === 0)
390
+    })
407
   }
391
   }
408
 
392
 
393
+  useEffect(() => {
394
+    request(apis.groupActivity.avgScore).then(data => {
395
+      setScoreData(data);
396
+    })
397
+  }, [])
398
+
399
+  useEffect(() => {
400
+    if (groupActivityId) {
401
+      getDynamicData(groupActivityId);
402
+    }
403
+  }, [groupActivityId])
404
+
405
+  // const radioOnChange = e => {
406
+  //   setDynamicData({ ...dynamicData, isEnlist: e.target.value })
407
+  // }
408
+
409
   return (
409
   return (
410
     <div>
410
     <div>
411
       <div>
411
       <div>
416
         </Radio.Group>
416
         </Radio.Group>
417
       </div>
417
       </div>
418
       <div>
418
       <div>
419
-        {tab === 'basic' && <Basic />}
420
-        {tab === 'poster' && <Poster />}
419
+        {tab === 'basic' && <Basic dynamicData={dynamicData} disable={disable} activityStatus={activityStatus} scoreData={scoreData} groupActivityId={groupActivityId} />}
420
+        {tab === 'poster' && <Poster groupActivityId={groupActivityId}/>}
421
         {tab === 'share' && <Share />}
421
         {tab === 'share' && <Share />}
422
       </div>
422
       </div>
423
       <Prompt message={location =>
423
       <Prompt message={location =>
424
-        location.pathname.startsWith("/activity/groupActivity")
424
+        (location.pathname.startsWith('/activity/groupActivity')
425
           ? true
425
           ? true
426
-          : localStorage.removeItem("groupActivePageParams")} />
426
+          : localStorage.removeItem('groupActivePageParams'))} />
427
     </div>
427
     </div>
428
   );
428
   );
429
 }
429
 }

+ 1
- 0
src/pages/channel/brokerList.jsx Wyświetl plik

43
     dataIndex: 'nickname',
43
     dataIndex: 'nickname',
44
     key: 'nickname',
44
     key: 'nickname',
45
     align: 'center',
45
     align: 'center',
46
+    render: (text, list) => <><span>{ list.name || list.nickname }</span></>,
46
   },
47
   },
47
   {
48
   {
48
     title: '电话',
49
     title: '电话',

+ 11
- 7
src/pages/channel/channelList.jsx Wyświetl plik

68
       render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toBroker(record)} >{ record.brokerCount }</a>,
68
       render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toBroker(record)} >{ record.brokerCount }</a>,
69
   },
69
   },
70
   {
70
   {
71
-    title: '推荐客户有效',
71
+    title: '推荐客户有效',
72
     dataIndex: 'recommendCount',
72
     dataIndex: 'recommendCount',
73
     key: 'recommendCount',
73
     key: 'recommendCount',
74
     align: 'center',
74
     align: 'center',
144
   }
144
   }
145
   // 查询
145
   // 查询
146
   function queryList() {
146
   function queryList() {
147
+   
147
     getList({ pageNum: 1, pageSize: 10, channelId: channelNmae })
148
     getList({ pageNum: 1, pageSize: 10, channelId: channelNmae })
148
   }
149
   }
149
   // 重置
150
   // 重置
150
   function reset() {
151
   function reset() {
152
+    setChannelNmae()
151
     getList({ pageNum: 1, pageSize: 10 })
153
     getList({ pageNum: 1, pageSize: 10 })
152
   }
154
   }
153
 
155
 
163
 
165
 
164
   // 分页
166
   // 分页
165
   function onChange(pageNumber) {
167
   function onChange(pageNumber) {
166
-    props.form.validateFields((err, values) => {
167
-      if (!err) {
168
-        getList({ pageNum: pageNumber, pageSize: 10, ...values })
169
-      }
170
-    });
168
+    getList({ pageNum: pageNumber, pageSize: 10, channelId: channelNmae })
169
+    // getList({ pageNum: pageNumber, pageSize: 10, ...values })
170
+    // props.form.validateFields((err, values) => {
171
+    //   if (!err) {
172
+    //     getList({ pageNum: pageNumber, pageSize: 10, ...values })
173
+    //   }
174
+    // });
171
   }
175
   }
172
 
176
 
173
   function onChannelChange(value) {
177
   function onChannelChange(value) {
193
         <AuthButton name="admin.channel.search" noRight={null}>
197
         <AuthButton name="admin.channel.search" noRight={null}>
194
           <Button type="primary" onClick={() => queryList()}>查询</Button>
198
           <Button type="primary" onClick={() => queryList()}>查询</Button>
195
           </AuthButton>
199
           </AuthButton>
196
-          {/* <Button onClick={() => reset() }>重置</Button> */}
200
+          <Button onClick={() => reset() } style={{marginLeft:'8px'}}>重置</Button>
197
         </div>
201
         </div>
198
       </div>
202
       </div>
199
       <AuthButton name="admin.channel.post" noRight={null}>
203
       <AuthButton name="admin.channel.post" noRight={null}>

+ 74
- 53
src/pages/channel/independentList/index.jsx Wyświetl plik

24
   }
24
   }
25
 
25
 
26
   // 挂载之后
26
   // 挂载之后
27
-  componentDidMount () {
27
+  componentDidMount() {
28
     this.getList({ pageNumber: 1, pageSize: 5 })
28
     this.getList({ pageNumber: 1, pageSize: 5 })
29
   }
29
   }
30
 
30
 
31
-  componentDidUpdate (preProps, preState) {
31
+  componentDidUpdate(preProps, preState) {
32
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
32
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
33
       this.getList({ pageNumber: 1, pageSize: 5 })
33
       this.getList({ pageNumber: 1, pageSize: 5 })
34
       this.setState({ visibleData: this.props.visibleData });
34
       this.setState({ visibleData: this.props.visibleData });
37
 
37
 
38
   // 弹框确定按钮
38
   // 弹框确定按钮
39
   // eslint-disable-next-line react/sort-comp
39
   // eslint-disable-next-line react/sort-comp
40
-  handleOk () {
40
+  handleOk() {
41
     this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
41
     this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
42
   }
42
   }
43
 
43
 
44
   // 弹框取消按钮
44
   // 弹框取消按钮
45
-  handleCancel () {
45
+  handleCancel() {
46
     this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
46
     this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
47
   }
47
   }
48
 
48
 
49
-  getList (params) {
49
+  getList(params) {
50
     console.log('this.state.visibleData', this.state.visibleData)
50
     console.log('this.state.visibleData', this.state.visibleData)
51
     const { customerId } = this.state.visibleData
51
     const { customerId } = this.state.visibleData
52
     if (customerId === '' || customerId === undefined) {
52
     if (customerId === '' || customerId === undefined) {
70
   }
70
   }
71
 
71
 
72
   // 分页
72
   // 分页
73
-  onChange (pageNum) {
74
-    props.form.validateFields((err, values) => {
75
-      if (!err) {
76
-        getList({ pageNumber: pageNum, pageSize: 5, ...values })
77
-      }
78
-    });
73
+  onChange(pageNum) {
74
+
75
+    this.getList({ pageNumber: pageNum, pageSize: 5, })
76
+
79
   }
77
   }
80
 
78
 
81
-  render () {
79
+  render() {
82
     const columns = [
80
     const columns = [
83
       {
81
       {
84
         title: '头像',
82
         title: '头像',
85
         // eslint-disable-next-line jsx-a11y/alt-text
83
         // eslint-disable-next-line jsx-a11y/alt-text
86
-        render: (text, records) => <img src={records.picture} width={50} height={50} />,
84
+        render: (text, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
85
+        // render: (text, records) => <img src={records.picture} width={50} height={50} />,
87
       },
86
       },
88
       {
87
       {
89
         title: '用户名',
88
         title: '用户名',
90
         dataIndex: 'name',
89
         dataIndex: 'name',
91
         key: 'name',
90
         key: 'name',
91
+        // render: (row) => <><span>{console.log(row, 'row')}{row.name || row.nickname}</span></>,
92
       },
92
       },
93
       {
93
       {
94
         title: '电话',
94
         title: '电话',
110
         title: '推荐时间',
110
         title: '推荐时间',
111
         dataIndex: 'createDate',
111
         dataIndex: 'createDate',
112
         key: 'createDate',
112
         key: 'createDate',
113
-        render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
113
+        render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
114
       },
114
       },
115
       {
115
       {
116
         title: '状态',
116
         title: '状态',
117
         // eslint-disable-next-line consistent-return
117
         // eslint-disable-next-line consistent-return
118
         render: (text, records) => {
118
         render: (text, records) => {
119
           console.log("retrun", records)
119
           console.log("retrun", records)
120
-          if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
120
+          //     if (records.status === 1) { return '报备' }
121
+          // if (records.status === 2) { return '推荐' }
122
+          // if (records.status === 3) { return '认购' }
123
+          // if (records.status === 4) { return '签约' }
124
+          // if (records.verifyStatus === 1) { return '待审核' }
125
+          // if (records.verifyStatus === 2) { return '审核同意' }
126
+          // if (records.verifyStatus === 3) { return '签约' }
127
+          // if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
128
+          // if (records.status === 2) { return '到访' }
129
+          // if (records.status === 3) { return '认购' }
130
+          // if (records.status === 4) { return '签约' }
131
+          // if (records.verifyStatus === 1) { return '待审核' }
132
+          // if (records.verifyStatus === 2) { return '审核同意' }
133
+          // if (records.verifyStatus === 3) { return '签约' }
134
+          if (records.status === 1) {
135
+            if (records.verifyStatus === 0) { return '待审核' }
136
+            if (records.verifyStatus === 1) { return '报备' }
137
+            // if (records.reportRecommendStatus === 1) { return '报备' }
138
+            // if (records.reportRecommendStatus === 2) { return '推荐' }}
139
+            if (records.verifyStatus === 2) { return '审核驳回' }
140
+           }
121
           if (records.status === 2) { return '到访' }
141
           if (records.status === 2) { return '到访' }
122
           if (records.status === 3) { return '认购' }
142
           if (records.status === 3) { return '认购' }
123
           if (records.status === 4) { return '签约' }
143
           if (records.status === 4) { return '签约' }
124
-          if (records.verifyStatus === 1) { return '待审核' }
125
-          if (records.verifyStatus === 2) { return '审核同意' }
126
-          if (records.verifyStatus === 3) { return '签约' }
127
           // reportRecommendStatus
144
           // reportRecommendStatus
128
         },
145
         },
129
       },
146
       },
160
   }
177
   }
161
 
178
 
162
   // 挂载之后
179
   // 挂载之后
163
-  componentDidMount () {
164
-    
180
+  componentDidMount() {
181
+
165
   }
182
   }
166
 
183
 
167
-  componentDidUpdate (preProps, preState) {
184
+  componentDidUpdate(preProps, preState) {
168
     const { customerId } = this.props.visibleData
185
     const { customerId } = this.props.visibleData
169
-    
186
+
170
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
187
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
171
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
188
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
172
       this.setState({ visibleData: this.props.visibleData });
189
       this.setState({ visibleData: this.props.visibleData });
175
 
192
 
176
   // 弹框确定按钮
193
   // 弹框确定按钮
177
   // eslint-disable-next-line react/sort-comp
194
   // eslint-disable-next-line react/sort-comp
178
-  handleOk () {
195
+  handleOk() {
179
     this.setState({ dataSource: { records: [] } })
196
     this.setState({ dataSource: { records: [] } })
180
     this.props.onCancel()
197
     this.props.onCancel()
181
   }
198
   }
182
 
199
 
183
   // 弹框取消按钮
200
   // 弹框取消按钮
184
-  handleCancel () {
201
+  handleCancel() {
185
     this.setState({ dataSource: { records: [] } })
202
     this.setState({ dataSource: { records: [] } })
186
     this.props.onCancel()
203
     this.props.onCancel()
187
   }
204
   }
188
 
205
 
189
-  getList (params) {
206
+  getList(params) {
190
     const { id } = params
207
     const { id } = params
191
     console.log(id)
208
     console.log(id)
192
     if (id === '' || id === undefined) {
209
     if (id === '' || id === undefined) {
196
       this.setState({ dataSource: res })
213
       this.setState({ dataSource: res })
197
     }).catch(err => {
214
     }).catch(err => {
198
       // eslint-disable-next-line no-unused-expressions
215
       // eslint-disable-next-line no-unused-expressions
199
-    
216
+
200
     })
217
     })
201
   }
218
   }
202
 
219
 
203
   // 分页
220
   // 分页
204
-  onChange (pageNum) {
221
+  onChange(pageNum) {
205
     this.getList({ pageNumber: pageNum, pageSize: 5 })
222
     this.getList({ pageNumber: pageNum, pageSize: 5 })
206
   }
223
   }
207
 
224
 
208
-  render () {
225
+  render() {
209
     const columns = [
226
     const columns = [
210
       {
227
       {
211
         title: '头像',
228
         title: '头像',
219
         dataIndex: 'nickname',
236
         dataIndex: 'nickname',
220
         key: 'nickname',
237
         key: 'nickname',
221
         align: 'center',
238
         align: 'center',
222
-        render: text => <a>{text}</a>,
239
+        render: (row) => <><span>{console.log(row, 'row')}{row.name || row.nickname}</span></>,
223
       },
240
       },
224
       {
241
       {
225
         title: '电话',
242
         title: '电话',
259
  * @param {*} props
276
  * @param {*} props
260
  * @returns
277
  * @returns
261
  */
278
  */
262
-function body (props) {
263
-  const { getFieldDecorator } = props.form
279
+function body(props) {
280
+  const { getFieldDecorator, getFieldsValue } = props.form
264
 
281
 
265
   // eslint-disable-next-line react-hooks/rules-of-hooks
282
   // eslint-disable-next-line react-hooks/rules-of-hooks
266
   const [dataSource, setDataSource] = useState({ records: [] })
283
   const [dataSource, setDataSource] = useState({ records: [] })
271
   }, [])
288
   }, [])
272
 
289
 
273
 
290
 
274
-  function openNotificationWithIcon (type, message) {
291
+  function openNotificationWithIcon(type, message) {
275
     notification[type]({
292
     notification[type]({
276
       message,
293
       message,
277
       description:
294
       description:
279
     });
296
     });
280
   }
297
   }
281
 
298
 
282
-  function getList (params) {
299
+  function getList(params) {
283
     // 网路请求
300
     // 网路请求
284
     request({ ...apis.customer.agents, params: { ...params } }).then(res => {
301
     request({ ...apis.customer.agents, params: { ...params } }).then(res => {
285
       setDataSource(res)
302
       setDataSource(res)
289
   }
306
   }
290
 
307
 
291
   // 提交事件
308
   // 提交事件
292
-  function handleSubmit (e) {
309
+  function handleSubmit(e) {
293
     e.preventDefault();
310
     e.preventDefault();
294
     props.form.validateFields((err, values) => {
311
     props.form.validateFields((err, values) => {
295
       if (!err) {
312
       if (!err) {
302
   // eslint-disable-next-line react-hooks/rules-of-hooks
319
   // eslint-disable-next-line react-hooks/rules-of-hooks
303
   const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
320
   const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
304
   // Change 事件
321
   // Change 事件
305
-  function handleSelectChange (e) {
322
+  function handleSelectChange(e) {
306
     // eslint-disable-next-line no-console
323
     // eslint-disable-next-line no-console
307
     console.log(e)
324
     console.log(e)
308
   }
325
   }
309
-  function gM (row) {
326
+  function gM(row) {
310
     setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
327
     setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
311
 
328
 
312
     setGInviteData({ visible: false })
329
     setGInviteData({ visible: false })
313
   }
330
   }
314
 
331
 
315
-  function Invite (row) {
332
+  function Invite(row) {
316
     setGInviteData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
333
     setGInviteData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
317
 
334
 
318
     setGVisibleData({ visible: false })
335
     setGVisibleData({ visible: false })
319
   }
336
   }
320
 
337
 
321
   // 分页
338
   // 分页
322
-  function onChange (pageNum) {
339
+  function onChange(pageNum) {
323
     // eslint-disable-next-line react-hooks/rules-of-hooks
340
     // eslint-disable-next-line react-hooks/rules-of-hooks
324
     getList({ pageNumber: pageNum, pageSize: 10 })
341
     getList({ pageNumber: pageNum, pageSize: 10 })
325
   }
342
   }
327
   /**
344
   /**
328
     * 重置搜索
345
     * 重置搜索
329
     */
346
     */
330
-  function handleReset () {
347
+  function handleReset() {
331
     props.form.resetFields();
348
     props.form.resetFields();
349
+    getList({ pageNumber: 1, pageSize: 10 })
332
   }
350
   }
333
 
351
 
334
-  function toAudit (cuurentId) {
352
+  function toAudit(cuurentId) {
335
     router.push({
353
     router.push({
336
       pathname: '/customer/recommendCustomer/audit',
354
       pathname: '/customer/recommendCustomer/audit',
337
       query: {
355
       query: {
340
     })
358
     })
341
   }
359
   }
342
 
360
 
343
-  function exportIndependen () {
344
-    request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob' })
361
+  function exportIndependen() {
362
+    const fieldsValue = getFieldsValue()
363
+    console.log('fieldsValue', fieldsValue)
364
+    request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob', params: { ...fieldsValue } })
345
       .then(response => {
365
       .then(response => {
346
         download(response)
366
         download(response)
347
       }).catch(error => {
367
       }).catch(error => {
349
       })
369
       })
350
   }
370
   }
351
 
371
 
352
-  function download (data) {
372
+  function download(data) {
353
     if (!data) {
373
     if (!data) {
354
       return
374
       return
355
     }
375
     }
373
       title: '姓名',
393
       title: '姓名',
374
       dataIndex: 'nickname',
394
       dataIndex: 'nickname',
375
       key: 'nickname',
395
       key: 'nickname',
396
+      render: (_, record) => <><span>{record.name || record.nickname}</span></>,
376
     },
397
     },
377
     {
398
     {
378
       title: '电话',
399
       title: '电话',
396
       title: '所属渠道',
417
       title: '所属渠道',
397
       dataIndex: 'channelName',
418
       dataIndex: 'channelName',
398
       key: 'channelName',
419
       key: 'channelName',
399
-      render: (_, record) => <><span>{record.channelName }</span></>,
420
+      render: (_, record) => <><span>{record.channelName}</span></>,
400
     },
421
     },
401
     {
422
     {
402
       title: '操作',
423
       title: '操作',
436
   return (
457
   return (
437
     <>
458
     <>
438
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
459
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
439
-      <Form.Item>
460
+        <Form.Item>
440
           {getFieldDecorator('channelId')(
461
           {getFieldDecorator('channelId')(
441
-           <ChannelSelect />
442
-          //   <Select defaultValue="渠道名称" style={{ width: 180 }} onChange={handleChange}>
443
-          //   <option value="">全部</option>
444
-          //   {data.channelNmae.map(Item =>
445
-          //     <Option value={Item.channelId}> {Item.channelName} </Option>,
446
-          //   )}
447
-      
448
-          // </Select>,
462
+            <ChannelSelect />
463
+            //   <Select defaultValue="渠道名称" style={{ width: 180 }} onChange={handleChange}>
464
+            //   <option value="">全部</option>
465
+            //   {data.channelNmae.map(Item =>
466
+            //     <Option value={Item.channelId}> {Item.channelName} </Option>,
467
+            //   )}
468
+
469
+            // </Select>,
449
           )}
470
           )}
450
         </Form.Item>
471
         </Form.Item>
451
         <Form.Item>
472
         <Form.Item>

+ 41
- 24
src/pages/channel/recommendClients.jsx Wyświetl plik

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select,Avatar } from 'antd';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Avatar } from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
52
     // key: 'img',
52
     // key: 'img',
53
     align: 'center',
53
     align: 'center',
54
 
54
 
55
-    render: (text, record) =>  <Avatar shape="square"   src={record.picture} size={64} icon="user" /> ,
55
+    render: (text, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
56
   },
56
   },
57
   {
57
   {
58
     title: '用户姓名',
58
     title: '用户姓名',
59
     dataIndex: 'name',
59
     dataIndex: 'name',
60
     key: 'name',
60
     key: 'name',
61
     align: 'center',
61
     align: 'center',
62
-    render: text => <a>{text}</a>,
62
+    render: (text, record) => <div>{record.name}</div>,
63
   },
63
   },
64
   {
64
   {
65
     title: '电话',
65
     title: '电话',
72
     dataIndex: 'sex',
72
     dataIndex: 'sex',
73
     key: 'sex',
73
     key: 'sex',
74
     align: 'center',
74
     align: 'center',
75
-    render: (text, record) => <span>{ record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知' }</span>
75
+    render: (text, record) => <span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span>
76
   },
76
   },
77
   {
77
   {
78
     title: '意向项目',
78
     title: '意向项目',
85
     dataIndex: 'createDate',
85
     dataIndex: 'createDate',
86
     key: 'createDate',
86
     key: 'createDate',
87
     align: 'center',
87
     align: 'center',
88
-    render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
88
+    render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
89
   },
89
   },
90
   {
90
   {
91
     title: '状态',
91
     title: '状态',
94
     align: 'center',
94
     align: 'center',
95
     // eslint-disable-next-line consistent-return
95
     // eslint-disable-next-line consistent-return
96
     render: (text, records) => {
96
     render: (text, records) => {
97
-      if (records.status === 1) { return '报备' }
98
-      if (records.status === 2) { return '推荐' }
97
+      //    if (records.status === 1) { if(records.reportRecommendStatus === 0) {return '未审核'} if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
98
+      // if (records.status === 2) { return '到访' }
99
+      // if (records.status === 3) { return '认购' }
100
+      // if (records.status === 4) { return '签约' }
101
+      // if (records.verifyStatus === 1) { return '待审核' }
102
+      // if (records.verifyStatus === 2) { return '审核同意' }
103
+      // if (records.verifyStatus === 3) { return '签约' }
104
+      // if (records.status === 1) { return '报备' }
105
+      // if (records.status === 2) { return '推荐' }
106
+      // if (records.status === 3) { return '认购' }
107
+      // if (records.status === 4) { return '签约' }
108
+      // if (records.verifyStatus === 1) { return '待审核' }
109
+      // if (records.verifyStatus === 2) { return '审核同意' }
110
+      // if (records.verifyStatus === 3) { return '签约' }
111
+      if (records.status === 1) {
112
+        if (records.verifyStatus === 0) { return '待审核' }
113
+        if (records.verifyStatus === 1) { return '报备' }
114
+        // if (records.reportRecommendStatus === 1) { return '报备' }
115
+        // if (records.reportRecommendStatus === 2) { return '推荐' }}
116
+        if (records.verifyStatus === 2) { return '审核驳回' }
117
+       }
118
+      if (records.status === 2) { return '到访' }
99
       if (records.status === 3) { return '认购' }
119
       if (records.status === 3) { return '认购' }
100
       if (records.status === 4) { return '签约' }
120
       if (records.status === 4) { return '签约' }
101
-      if (records.verifyStatus === 1) { return '待审核' }
102
-      if (records.verifyStatus === 2) { return '审核同意' }
103
-      if (records.verifyStatus === 3) { return '签约' }
104
-    },
121
+    }
105
   },
122
   },
106
 ];
123
 ];
107
 
124
 
108
 const header = props => {
125
 const header = props => {
109
   // eslint-disable-next-line react-hooks/rules-of-hooks
126
   // eslint-disable-next-line react-hooks/rules-of-hooks
110
   const [data, setData] = useState({})
127
   const [data, setData] = useState({})
111
-//   const [page, changePage] = useState({})
128
+  //   const [page, changePage] = useState({})
112
   // eslint-disable-next-line react-hooks/rules-of-hooks
129
   // eslint-disable-next-line react-hooks/rules-of-hooks
113
   useEffect(() => {
130
   useEffect(() => {
114
     getListRecommend({ pageNumber: 1, pageSize: 10 })
131
     getListRecommend({ pageNumber: 1, pageSize: 10 })
129
   function getListRecommend(params) {
146
   function getListRecommend(params) {
130
     request({ ...apis.channelList.getListRecommend, urlData: { id: props.location.query.id }, params: { ...params } }).then((data) => {
147
     request({ ...apis.channelList.getListRecommend, urlData: { id: props.location.query.id }, params: { ...params } }).then((data) => {
131
       setData(data)
148
       setData(data)
132
-  }).catch((err) => {
149
+    }).catch((err) => {
133
       console.log(err)
150
       console.log(err)
134
       message.info(err.msg || err.message)
151
       message.info(err.msg || err.message)
135
-  })
152
+    })
136
   }
153
   }
137
 
154
 
138
 
155
 
139
-   // 分页
140
- function onChange(pageNum) {
141
-      // eslint-disable-next-line react-hooks/rules-of-hooks
142
-      getListRecommend({ pageNumber: pageNum, pageSize: 9 })
143
-    }
144
-return (
145
-  <>
146
-  <Table dataSource={data.records} rowKey="recommendClist" columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
147
-  </>
148
-)
156
+  // 分页
157
+  function onChange(pageNum) {
158
+    // eslint-disable-next-line react-hooks/rules-of-hooks
159
+    getListRecommend({ pageNumber: pageNum, pageSize: 9 })
160
+  }
161
+  return (
162
+    <>
163
+      <Table dataSource={data.records} rowKey="recommendClist" columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} />
164
+    </>
165
+  )
149
 }
166
 }
150
 
167
 
151
 function handleMenuClick(e) {
168
 function handleMenuClick(e) {

+ 1
- 1
src/pages/customer/customerlist/customerDetail.jsx Wyświetl plik

151
               <p className={styles.rightItem}>国家:{dataConsultant && dataConsultant.country}</p>
151
               <p className={styles.rightItem}>国家:{dataConsultant && dataConsultant.country}</p>
152
               <p className={styles.rightItem}>省份:{dataConsultant && dataConsultant.provience}</p>
152
               <p className={styles.rightItem}>省份:{dataConsultant && dataConsultant.provience}</p>
153
               <p className={styles.rightItem}>城市:{dataConsultant && dataConsultant.city}</p>
153
               <p className={styles.rightItem}>城市:{dataConsultant && dataConsultant.city}</p>
154
-              <p className={styles.rightItem}>来访渠道:{data.personFrom ? data.personFrom : "其他"}</p>
154
+              <p className={styles.rightItem}>来渠道:{data.personFrom ? data.personFrom : "其他"}</p>
155
               {/* <p className={styles.rightItem}>详细信息:</p> */}
155
               {/* <p className={styles.rightItem}>详细信息:</p> */}
156
               {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */}
156
               {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */}
157
               {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
157
               {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}

+ 1
- 1
src/pages/customer/customerlist/publicCustomerDetail.jsx Wyświetl plik

139
           <div className={publicStyle.Centered}>
139
           <div className={publicStyle.Centered}>
140
           <p>访问时长:{ data.duration }秒</p>
140
           <p>访问时长:{ data.duration }秒</p>
141
           <p>访问次数:{ data.visitTimes }次</p>
141
           <p>访问次数:{ data.visitTimes }次</p>
142
-          <p className={publicStyle.rightItem}>来访渠道:{data.personFrom ? data.personFrom : '其他'}</p>
142
+          <p className={publicStyle.rightItem}>来渠道:{data.personFrom ? data.personFrom : '其他'}</p>
143
           {/* <p>预约人数:{ data.visiteNum }</p> */}
143
           {/* <p>预约人数:{ data.visiteNum }</p> */}
144
           </div>
144
           </div>
145
           {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
145
           {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}

+ 24
- 14
src/pages/recommend/recommendCustomer/audit.jsx Wyświetl plik

56
   function getById(currentId) {
56
   function getById(currentId) {
57
     request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
57
     request({ ...apis.customer.recommendGetById, urlData: { id: currentId } }).then(res => {
58
       res.reportDate = moment(res.reportDate)
58
       res.reportDate = moment(res.reportDate)
59
-     props.form.setFieldsValue(res)
59
+      props.form.setFieldsValue(res)
60
     })
60
     })
61
   }
61
   }
62
 
62
 
63
   function submitDate(params) {
63
   function submitDate(params) {
64
     // props.form.setFieldsValue(res)
64
     // props.form.setFieldsValue(res)
65
+    console.log(params, 'params')
65
     request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
66
     request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
66
       // eslint-disable-next-line no-unused-expressions
67
       // eslint-disable-next-line no-unused-expressions
67
       openNotificationWithIcon('success', '操作成功')
68
       openNotificationWithIcon('success', '操作成功')
77
     e.preventDefault();
78
     e.preventDefault();
78
     props.form.validateFields((err, values) => {
79
     props.form.validateFields((err, values) => {
79
       if (!err) {
80
       if (!err) {
80
-        submitDate({ ...values })
81
+        submitDate({ verifyStatus: '1' })
82
+        // submitDate({ ...values })
81
       }
83
       }
82
     });
84
     });
83
   }
85
   }
195
               <Option value={1}>已通过</Option>
197
               <Option value={1}>已通过</Option>
196
               <Option value={2}>已驳回</Option>
198
               <Option value={2}>已驳回</Option>
197
             </Select>,
199
             </Select>,
198
-          )}
200
+          )}onClick={() => submitDate({ verifyStatus: '1' })}
199
         </Form.Item> */}
201
         </Form.Item> */}
200
-        <Form.Item label="归属置业顾问">
201
-            <Row gutter={8}>
202
-              <Col span={12}>
203
-                {getFieldDecorator('consultantName')(<Input placeholder="请选择置业顾问" />)}
204
-              </Col>
205
-              <Col span={12}>
206
-                <Button onClick={() => showConsultant()}>选择</Button>
207
-              </Col>
208
-            </Row>
202
+        <Form.Item label="归属置业顾问"
203
+      >
204
+          <Row gutter={8}>
205
+            <Col span={12}>
206
+              {getFieldDecorator('consultantName', {
207
+                rules: [
208
+                  {
209
+                    required: true,
210
+                    message: '请选择置业顾问',
211
+                  },
212
+                ],
213
+              })(<Input placeholder="请选择置业顾问" />)}
214
+            </Col>
215
+            <Col span={12}>
216
+              <Button onClick={() => showConsultant()}>选择</Button>
217
+            </Col>
218
+          </Row>
209
         </Form.Item>
219
         </Form.Item>
210
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
220
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
211
-          <Button type="primary" className={Styles.SubmitButton} onClick={() => submitDate({ verifyStatus: '1' })}>
221
+          <Button type="primary" className={Styles.SubmitButton} htmlType="submit" >
212
             审核通过
222
             审核通过
213
           </Button>
223
           </Button>
214
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
224
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
219
       </Form>
229
       </Form>
220
 
230
 
221
       {/* 选择置业顾问 */}
231
       {/* 选择置业顾问 */}
222
-      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)}/>
232
+      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)} />
223
     </>
233
     </>
224
   );
234
   );
225
 }
235
 }