dingxin 5 years ago
parent
commit
6b7aa462b2

+ 15
- 9
src/pages/customer/customerlist/components/integralRecord.jsx View File

76
   }
76
   }
77
 
77
 
78
   // 积分类型
78
   // 积分类型
79
-  showChangeType(str) { 
79
+  showChangeType(str) {
80
     switch (str) {
80
     switch (str) {
81
       case 'goods':
81
       case 'goods':
82
         return '兑换商品'
82
         return '兑换商品'
88
         return '注册经纪人'
88
         return '注册经纪人'
89
       case 'recommend-customer':
89
       case 'recommend-customer':
90
         return '推荐客户'
90
         return '推荐客户'
91
+        case 'group':
92
+        return '拼团'
93
+        case 'recommend-customer':
94
+        return '推荐客户'
91
       default:
95
       default:
92
         return '未知类型'
96
         return '未知类型'
93
     }
97
     }
94
   }
98
   }
95
-  
99
+
96
   // 判断是否是 - 开头
100
   // 判断是否是 - 开头
97
-  subPoints(points) { 
98
-    let subStr = points.toString().substring(0, 1)
101
+  subPoints(points) {
102
+    const subStr = points.toString().substring(0, 1)
99
     if (subStr === '-') {
103
     if (subStr === '-') {
100
       return true
104
       return true
101
     }
105
     }
102
     return false
106
     return false
103
   }
107
   }
104
 
108
 
109
+// eslint-disable-next-line class-methods-use-this
105
   render() {
110
   render() {
106
     const columns = [
111
     const columns = [
107
       {
112
       {
108
         title: '序号',
113
         title: '序号',
109
         dataIndex: 'index',
114
         dataIndex: 'index',
110
         key: 'index',
115
         key: 'index',
116
+        render: (text, record, index) => <span>{(this.state.dataSource.result.total - this.state.dataSource.result.records.length) * 1 + index + 1}</span>,
111
       },
117
       },
112
       {
118
       {
113
         title: '积分类型',
119
         title: '积分类型',
114
         dataIndex: 'changeType',
120
         dataIndex: 'changeType',
115
         key: 'changeType',
121
         key: 'changeType',
116
-        render: (_, record) => { this.showChangeType(record.changeType) },
122
+        render: (_, record) => <span>{this.showChangeType(record.changeType) }</span>,
117
       },
123
       },
118
       {
124
       {
119
         title: '积分变化',
125
         title: '积分变化',
120
         dataIndex: 'pointsAmount',
126
         dataIndex: 'pointsAmount',
121
         key: 'pointsAmount',
127
         key: 'pointsAmount',
122
-        render: (_, record) => { <span style={this.subPoints(record.pointsAmount) && {color: 'red'}}>{ record.pointsAmount }</span> },
128
+        // render: (pointsAmount, record) => { <span style={this.subPoints(pointsAmount) && {color: 'red'}}>{ pointsAmount }</span> },
123
       },
129
       },
124
       {
130
       {
125
         title: '发生时间',
131
         title: '发生时间',
126
         dataIndex: 'createDate',
132
         dataIndex: 'createDate',
127
         key: 'createDate',
133
         key: 'createDate',
128
-        render: (text, records) => { moment(records.createDate).format('YYYY-MM-DD') },
134
+        render: (createDate, records) => <span> {moment(createDate).format('YYYY-MM-DD')}</span>,
129
       },
135
       },
130
     ]
136
     ]
131
     return (
137
     return (
132
       <>
138
       <>
133
         <Modal
139
         <Modal
134
-            title={ "当前可用积分:" + this.state.dataSource.totalPoints }
140
+            title={ '当前可用积分:' + this.state.dataSource.totalPoints }
135
             width={800}
141
             width={800}
136
             destroyOnClose="true"
142
             destroyOnClose="true"
137
             footer={null}
143
             footer={null}
138
             visible={this.state.visibleData.visible}
144
             visible={this.state.visibleData.visible}
139
             // onOk={() => this.handleOk()}
145
             // onOk={() => this.handleOk()}
140
-            onCancel={(e) => this.handleCancel(e)}
146
+            onCancel={e => this.handleCancel(e)}
141
           >
147
           >
142
             <Table dataSource={this.state.dataSource.result.records} columns={columns} pagination={{ total: this.state.dataSource.result.total, onChange: e => this.onChange(e) }} />
148
             <Table dataSource={this.state.dataSource.result.records} columns={columns} pagination={{ total: this.state.dataSource.result.total, onChange: e => this.onChange(e) }} />
143
           </Modal>
149
           </Modal>

+ 3
- 3
src/pages/customer/customerlist/customerDetail.jsx View File

98
     {
98
     {
99
       title: 'Name',
99
       title: 'Name',
100
       dataIndex: 'name',
100
       dataIndex: 'name',
101
-      width:500,
102
-    render: (_, record) => <span stytle={{width:'450px'}} >{record.buildingName}</span>,
101
+      width: 500,
102
+    render: (_, record) => <span>{record.buildingName}</span>,
103
     },
103
     },
104
     {
104
     {
105
       title: 'Address',
105
       title: 'Address',
169
         <div className={styles.leftBoxCentre}>
169
         <div className={styles.leftBoxCentre}>
170
           <div className={styles.tit}>
170
           <div className={styles.tit}>
171
                 <span>项目名称</span>
171
                 <span>项目名称</span>
172
-                <span style={{ marginLeft: '47%' }}>意向值</span>
172
+                <span style={{ marginLeft: '50%' }}>意向值</span>
173
           </div>
173
           </div>
174
           {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
174
           {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
175
           <div className={styles.infoItem}>
175
           <div className={styles.infoItem}>

+ 1
- 1
src/pages/customer/customerlist/index.jsx View File

135
   }
135
   }
136
 
136
 
137
   function showRecord(record) {
137
   function showRecord(record) {
138
-    setRecordVisibleData({ visible: true, customerId: record.customerId })
138
+    setRecordVisibleData({ visible: true, customerId: record.personId })
139
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
139
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
140
     setStatusVisibleData({ visible: false, customerId: '' })
140
     setStatusVisibleData({ visible: false, customerId: '' })
141
     setRecommendVisibleData({ visible: false, customerId: '' })
141
     setRecommendVisibleData({ visible: false, customerId: '' })