Browse Source

新需求

weichaochao 5 years ago
parent
commit
911e1c4ef7

+ 21
- 24
src/pages/house/add/index.jsx View File

@@ -35,7 +35,7 @@ const header = props => {
35 35
 
36 36
   const cancelPage = () =>{
37 37
     router.push({
38
-      pathname: '/system/housingPolicy',
38
+      pathname: '/house/list',
39 39
     });
40 40
   }
41 41
     const fields = [
@@ -85,8 +85,9 @@ const header = props => {
85 85
       {
86 86
         label: '预选时间',
87 87
         name: 'preSelectTime',
88
-        type: FieldTypes.RangePicker,
89
-        value: saleBatchData.preselectionStartTime != null ? [moment(saleBatchData.preselectionStartTime, 'YYYY-MM-DD HH:mm'), moment(saleBatchData.preselectionEndTime, 'YYYY-MM-DD HH:mm')] : null,
88
+        type: FieldTypes.RangePicker,       
89
+        value: saleBatchData.preselectionStartTime != null ? [moment(saleBatchData.preselectionStartTime, 'YYYY-MM-DD HH:mm:ss'), moment(saleBatchData.preselectionEndTime, 'YYYY-MM-DD HH:mm')] : null,
90
+        props: { showTime: { format: 'HH:mm:ss' }},
90 91
         rules: [
91 92
           { required: true, message: '请选择预选时间' },
92 93
         ],
@@ -106,30 +107,26 @@ const header = props => {
106 107
       },
107 108
     ]
108 109
   
109
-    const handleSubmit = val => { 
110
-      console.log('submit data --->', val)
111
-      console.log(val.body, 'val.body')
112
-      if (val.body == '<p><br></p>'){
113
-        message.info("政策详情必填")
114
-        return
115
-      }
110
+    const handleSubmit = values => { 
111
+     console.log('submit data --->', values)
116 112
       
117
-      if(policyId){
118
-        val.policyId = policyId
119
-        request({ ...apis.system.updateTaPolicy, urlData: {id: policyId},data: val, }).then((data) => {
113
+     let {preSelectTime, ...submitValue} = values
114
+        if(null != preSelectTime && preSelectTime.length > 0){
115
+          const [preselectionStartTime, preselectionEndTime] = preSelectTime
116
+          submitValue.preselectionStartTime = moment(preselectionStartTime).format('YYYY-MM-DD HH:mm:ss');
117
+          submitValue.preselectionEndTime = moment(preselectionEndTime).format('YYYY-MM-DD HH:mm:ss');
118
+        }else{
119
+          submitValue.preselectionStartTime = null
120
+          submitValue.preselectionEndTime = null
121
+        }        
122
+        // getList({ pageNum: pageNumber, pageSize: 10, ...submitValue })
123
+        console.log(submitValue)
124
+        request({ ...apis.house.addTaSalesBatch, data: { ...submitValue },}).then((data) => {
120 125
           message.info("保存成功")
121 126
           cancelPage()
122
-        }).catch((err) => {
123
-          message.info(err.msg || err.message)
124
-        })
125
-      }else{
126
-        request({ ...apis.system.addTaPolicy,data: val, }).then((data) => {
127
-          message.info("保存成功")
128
-          cancelPage()
129
-        }).catch((err) => {
130
-          message.info(err.msg || err.message)
131
-        })
132
-      }
127
+      }).catch((err) => {
128
+        message.info(err.msg || err.message)
129
+      })
133 130
     }
134 131
      
135 132
 

+ 16
- 23
src/pages/house/edit/components/base.jsx View File

@@ -24,7 +24,7 @@ const Base = props => {
24 24
 
25 25
   // 查询列表
26 26
   const getSaleBatchData = (salesBatchId) => {
27
-    request({ ...apis.system.taPolicy, urlData: {id: salesBatchId} }).then((data) => {
27
+    request({ ...apis.house.getTaSalesBatch, urlData: {id: salesBatchId} }).then((data) => {
28 28
         console.log(data)
29 29
         setSaleBatchData(data)
30 30
     })
@@ -33,7 +33,7 @@ const Base = props => {
33 33
 
34 34
   const cancelPage = () =>{
35 35
     router.push({
36
-      pathname: '/system/housingPolicy',
36
+      pathname: '/house/list',
37 37
     });
38 38
   }
39 39
   const fields = [
@@ -104,30 +104,23 @@ const Base = props => {
104 104
     },
105 105
   ]
106 106
   
107
-    const handleSubmit = val => { 
108
-      console.log('submit data --->', val)
109
-      console.log(val.body, 'val.body')
110
-      if (val.body == '<p><br></p>'){
111
-        message.info("政策详情必填")
112
-        return
113
-      }
114
-      
115
-      if(policyId){
116
-        val.policyId = policyId
117
-        request({ ...apis.system.updateTaPolicy, urlData: {id: policyId},data: val, }).then((data) => {
107
+    const handleSubmit = values => { 
108
+      let {preSelectTime, ...submitValue} = values
109
+        if(null != preSelectTime && preSelectTime.length > 0){
110
+          const [preselectionStartTime, preselectionEndTime] = preSelectTime
111
+          submitValue.preselectionStartTime = moment(preselectionStartTime).format('YYYY-MM-DD HH:mm:ss');
112
+          submitValue.preselectionEndTime = moment(preselectionEndTime).format('YYYY-MM-DD HH:mm:ss');
113
+        }else{
114
+          submitValue.preselectionStartTime = null
115
+          submitValue.preselectionEndTime = null
116
+        }        
117
+        console.log(submitValue)
118
+        request({ ...apis.house.updateTaSalesBatch, urlData: {id: salesBatchId},data: values, }).then((data) => {
118 119
           message.info("保存成功")
119 120
           cancelPage()
120 121
         }).catch((err) => {
121
-          message.info(err.msg || err.message)
122
-        })
123
-      }else{
124
-        request({ ...apis.system.addTaPolicy,data: val, }).then((data) => {
125
-          message.info("保存成功")
126
-          cancelPage()
127
-        }).catch((err) => {
128
-          message.info(err.msg || err.message)
129
-        })
130
-      }
122
+        message.info(err.msg || err.message)
123
+      })
131 124
     }
132 125
      
133 126
 

+ 1
- 1
src/pages/house/edit/components/shareRecord.jsx View File

@@ -22,7 +22,7 @@ const header = (props) => {
22 22
 
23 23
   // 查询列表
24 24
   const getList = (params) => {
25
-    request({ ...apis.activity.taHouseShare, params: { ...params },}).then((data) => {
25
+    request({ ...apis.house.taHouseShare, params: { ...params },}).then((data) => {
26 26
         console.log(data)
27 27
         setData(data)
28 28
     })

+ 6
- 7
src/pages/house/list/index.jsx View File

@@ -22,7 +22,7 @@ const header = props => {
22 22
   //==========看这里-- 新功能都用house为中间单词,我已经创建好了,你只要修改list的指向链接就行,看完删除=========
23 23
   // 查询列表
24 24
   const getList = params => {
25
-    request({ ...apis.house.list, params: { ...params } }).then(data => {
25
+    request({ ...apis.house.taSalesBatch, params: { ...params } }).then(data => {
26 26
       console.log(data)
27 27
       setData(data)
28 28
     })
@@ -94,8 +94,7 @@ const header = props => {
94 94
       dataIndex: 'salesBatchName',
95 95
       key: 'salesBatchName',
96 96
       align: 'center',
97
-      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>
98
-                              <span style={{color: 'blue',cursor: 'pointer'}} onClick={toAddHouse(7)}>{row.title}</span></div></>,
97
+      render:  (x, row) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={toAddHouse(row.salesBatchId)}>{row.salesBatchName}</span></>,
99 98
     },
100 99
     {
101 100
       title: '楼盘名称',
@@ -114,14 +113,14 @@ const header = props => {
114 113
       dataIndex: 'preselectionStartTime',
115 114
       key: 'preselectionStartTime',
116 115
       align: 'center',
117
-      render: (x, row) => <><span>{`${moment(row.preselectionStartTime).format('YYYY-MM-DD')}`}</span></>,
116
+      render: (x, row) => <><span>{`${moment(row.preselectionStartTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
118 117
     },
119 118
     {
120 119
       title: '预选结束时间',
121 120
       dataIndex: 'preselectionEndTime',
122 121
       key: 'preselectionEndTime',
123 122
       align: 'center',
124
-      render: (x, row) => <><span>{`${moment(row.preselectionEndTime).format('YYYY-MM-DD')}`}</span></>,
123
+      render: (x, row) => <><span>{`${moment(row.preselectionEndTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
125 124
     },
126 125
     {
127 126
       title: '发布状态',
@@ -284,7 +283,7 @@ const header = props => {
284 283
           )}
285 284
         </Form.Item>
286 285
         <Form.Item>
287
-          {getFieldDecorator('title')(
286
+          {getFieldDecorator('status')(
288 287
             <Select style={{ width: '180px' }} placeholder="发布状态">
289 288
             <Option value="1">是</Option>
290 289
             <Option value="0">否</Option>
@@ -306,7 +305,7 @@ const header = props => {
306 305
         <Button type="danger" className={styles.addBtn} onClick={toAddHouse()}>新增</Button>
307 306
       </AuthButton>
308 307
       <Table
309
-       dataSource={data.list} columns={columns} pagination={false} rowKey="activityList" />
308
+       dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
310 309
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
311 310
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current}/>
312 311
       </div>

+ 25
- 10
src/services/apis.js View File

@@ -562,12 +562,7 @@ export default {
562 562
         url: `${prefix}/clickCountList`,
563 563
         method: 'GET',
564 564
         action: 'admin.clickCountList.get',
565
-      },
566
-      taHouseShare:{
567
-        url: `${prefix}/taHouseShare`,
568
-        method: 'GET',
569
-        action: 'admin.taHouseShare.get',
570
-      },
565
+      },      
571 566
   },
572 567
   integralMall: {
573 568
     tdPointsRules: {
@@ -1089,15 +1084,35 @@ export default {
1089 1084
    },
1090 1085
  },
1091 1086
  house: {
1092
-  list: {
1087
+  taSalesBatch: {
1088
+    method: 'GET',
1089
+    url: `${prefix}/taSalesBatch`,
1090
+    action: 'admin.taSalesBatch.get',
1091
+  },
1092
+  addTaSalesBatch: {
1093
+    method: 'POST',
1094
+    url: `${prefix}/taSalesBatch`,
1095
+    action: 'admin.taSalesBatch.post',
1096
+  },
1097
+  taHouseShare:{
1098
+    url: `${prefix}/taHouseShare`,
1093 1099
     method: 'GET',
1094
-    url: `${prefix}/iBuildingDynamicList`,
1095
-    action: 'admin.iBuildingDynamicList.get',
1100
+    action: 'admin.taHouseShare.get',
1101
+  },
1102
+  getTaSalesBatch:{
1103
+    url: `${prefix}/taSalesBatch/:id`,
1104
+    method: 'get',
1105
+    action: 'admin.taHouseShare.get',
1106
+  },
1107
+  updateTaSalesBatch:{
1108
+    url: `${prefix}/taSalesBatch/:id`,
1109
+    method: 'put',
1110
+    action: 'admin.taHouseShare.put',
1096 1111
   },
1097 1112
   taHousingResources: {
1098 1113
     method: 'GET',
1099 1114
     url: `${prefix}/taHousingResources`,
1100 1115
     action: 'admin.taHousingResources.id.get',
1101
-  }
1116
+  },
1102 1117
  },
1103 1118
 }