dingxin 5 years ago
parent
commit
a4e6b4bc05

+ 17
- 6
src/pages/activity/helpActivity/edithelpActivity.jsx View File

80
           values.helpNum = 0
80
           values.helpNum = 0
81
         }
81
         }
82
 
82
 
83
+        // 判断助力人数不得超过200
84
+        if (values.helpNum > 200) {
85
+          message.error('限制助力人数不能超过200')
86
+          return
87
+        }
88
+
89
+        // 判断助力人数必须大于0
90
+        if (values.isEnlist === 1) {
91
+        if (values.helpNum <= 0) {
92
+          message.error('限制助力人数必须大于1')
93
+          return
94
+        }
95
+      }
83
         const { activityTime, signupTime, ...submitValue } = values
96
         const { activityTime, signupTime, ...submitValue } = values
84
         const [startDate, endDate] = activityTime
97
         const [startDate, endDate] = activityTime
85
         submitValue.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
98
         submitValue.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
135
         })(<Input />)}
148
         })(<Input />)}
136
         </Form.Item>
149
         </Form.Item>
137
 
150
 
138
-        <Form.Item label="活动主图">
151
+        <Form.Item label="活动主图" help="建议尺寸375*312px">
139
           {getFieldDecorator('img')(<ImageUploader />)}
152
           {getFieldDecorator('img')(<ImageUploader />)}
140
-          <span>建议图片尺寸:750px*560px</span>
141
         </Form.Item>
153
         </Form.Item>
142
 
154
 
143
         <Form.Item label="活动时间">
155
         <Form.Item label="活动时间">
180
         )}
192
         )}
181
         </Form.Item>
193
         </Form.Item>
182
          {
194
          {
183
-           isEnlist === 1 && <Form.Item label="请输入助力人数">
195
+           isEnlist === 1 && <Form.Item label="请输入助力人数" min={1} max={10}>
184
            {getFieldDecorator('helpNum', {
196
            {getFieldDecorator('helpNum', {
185
              rules: [
197
              rules: [
186
                {
198
                {
188
                  message: '请输入助力人数',
200
                  message: '请输入助力人数',
189
                },
201
                },
190
              ],
202
              ],
191
-           })(<Input type="number" />)}
203
+           })(<Input type="number" placeholder="助力人数限制"/>)}
192
            </Form.Item>
204
            </Form.Item>
193
          }
205
          }
194
 
206
 
195
-        <Form.Item label="活动说明">
207
+        <Form.Item label="活动说明" help="建议宽度:335px,高度不限">
196
           {getFieldDecorator('activityInstructions')(<ImageUploader />)}
208
           {getFieldDecorator('activityInstructions')(<ImageUploader />)}
197
-          <span>建议图片尺寸:750px*560px</span>
198
         </Form.Item>
209
         </Form.Item>
199
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
210
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
200
           <Button type="primary" htmlType="submit">
211
           <Button type="primary" htmlType="submit">

+ 11
- 6
src/pages/activity/helpActivity/helpRecord.jsx View File

293
     e.preventDefault();
293
     e.preventDefault();
294
     props.form.validateFields((err, values) => {
294
     props.form.validateFields((err, values) => {
295
       if (!err) {
295
       if (!err) {
296
-        getList({ pageNum: 1, pageSize: 10, customerType, ...values })
296
+        getList({ pageNum: 1, pageSize: 10, status: customerType, ...values, helpActivityId })
297
       }
297
       }
298
     });
298
     });
299
   }
299
   }
324
 
324
 
325
   function handleReset() {
325
   function handleReset() {
326
     props.form.resetFields();
326
     props.form.resetFields();
327
-    getList({ pageNumber: 1, pageSize: 10, customerType })
327
+    getList({ pageNum: 1, pageSize: 10, status: customerType, helpActivityId })
328
   }
328
   }
329
 
329
 
330
   function toCustomerDateil(record) {
330
   function toCustomerDateil(record) {
338
 
338
 
339
   function exportCustomer () {
339
   function exportCustomer () {
340
     const fieldsValue = getFieldsValue()
340
     const fieldsValue = getFieldsValue()
341
-    const code = customerType === 'helpSucceed' ? 1 : 0
342
-    request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType, helpActivityId, code } })
341
+    request({ ...apis.helpActivity.HelpInitiateRecordSucceed, responseType: 'blob', params: { ...fieldsValue, customerType, helpActivityId, condition: customerType } })
343
       .then(response => {
342
       .then(response => {
344
         download(response)
343
         download(response)
345
       }).catch(error => {
344
       }).catch(error => {
373
   // 核销
372
   // 核销
374
   setVerifierData({ visible: true, helpId: row.helpRecordInitiateId, helpActivityId: row.helpActivityId, elpRecordInitiateId: '', verificationCode: '' })
373
   setVerifierData({ visible: true, helpId: row.helpRecordInitiateId, helpActivityId: row.helpActivityId, elpRecordInitiateId: '', verificationCode: '' })
375
  }
374
  }
376
-
375
+ // 核销回调
377
  function onSuccess(e) {
376
  function onSuccess(e) {
378
    console.log('回调:', e)
377
    console.log('回调:', e)
379
    getList(e)
378
    getList(e)
380
      // 核销
379
      // 核销
381
    setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
380
    setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
382
  }
381
  }
382
+ // 返回到首页
383
+ function returList(params) {
384
+  router.push({
385
+      pathname: '/activity/helpActivity/list',
386
+    });
387
+}
383
 
388
 
384
   const publicColumns = [
389
   const publicColumns = [
385
     {
390
     {
494
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
499
             <Button style={{ marginLeft: 8 }} onClick={handleReset}>
495
               重置
500
               重置
496
             </Button>
501
             </Button>
497
-            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
502
+            <Button style={{ marginLeft: 8 }} onClick={returList}>
498
               返回
503
               返回
499
             </Button>
504
             </Button>
500
         </Form.Item>
505
         </Form.Item>

+ 3
- 3
src/pages/activity/helpActivity/list.jsx View File

91
       align: 'center',
91
       align: 'center',
92
       render: (x, row) => (
92
       render: (x, row) => (
93
         <>
93
         <>
94
-          {row.activityStatus === 1 &&
94
+          {row.activityStatus === 0 &&
95
           <AuthButton name="admin.SignList.get" noRight={null}>
95
           <AuthButton name="admin.SignList.get" noRight={null}>
96
         
96
         
97
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
97
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
100
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
100
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
101
           </AuthButton> }
101
           </AuthButton> }
102
 
102
 
103
-          {row.activityStatus === 0 &&
103
+          {row.activityStatus === 1 &&
104
            <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
104
            <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
105
                       <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
105
                       <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
106
-                      <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
106
+                      {/* <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span> */}
107
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
107
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
108
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
108
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
109
             </AuthButton>
109
             </AuthButton>