瀏覽代碼

客户列表

魏熙美 5 年之前
父節點
當前提交
6e4b72d0ce
共有 4 個檔案被更改,包括 204 行新增15 行删除
  1. 4
    0
      src/config/api.js
  2. 14
    0
      src/store/modules/customer.js
  3. 44
    11
      src/views/customer/editRecommend.vue
  4. 142
    4
      src/views/customer/recommendCustomer.vue

+ 4
- 0
src/config/api.js 查看文件

139
     update: {
139
     update: {
140
       method:'put',
140
       method:'put',
141
       url: `${commPrefix}/customer/recommend/edit/:id`
141
       url: `${commPrefix}/customer/recommend/edit/:id`
142
+    },
143
+    recommendCustomerList: {
144
+      method:'get',
145
+      url: `${commPrefix}/customer/recommend/:id`
142
     }
146
     }
143
   },
147
   },
144
   goods:{
148
   goods:{

+ 14
- 0
src/store/modules/customer.js 查看文件

70
         })
70
         })
71
       })
71
       })
72
     },
72
     },
73
+    recommendCustomerList({ commit }, payload) { // 推荐客户列表
74
+      return new Promise((resolve, reject) => {
75
+        request({
76
+          ...apis.recommendCustomer.recommendCustomerList,
77
+          urlData: { id: payload.customerId},
78
+          params: payload
79
+        }).then((data) => {
80
+          resolve(data)
81
+        }).catch(({ message }) => {
82
+          reject(message)
83
+        })
84
+      })
85
+    }
86
+
73
     
87
     
74
   }
88
   }
75
 }
89
 }

+ 44
- 11
src/views/customer/editRecommend.vue 查看文件

62
           </el-select>
62
           </el-select>
63
         </el-form-item>
63
         </el-form-item>
64
         <el-form-item label="归属置业顾问:">
64
         <el-form-item label="归属置业顾问:">
65
-          <p style="margin:0">{{detail.realtyConsultant}}<span @click="dialogTableVisible=true" class="choose">请选择</span></p>
65
+          <p style="margin:0">{{detail.consultantName}}<span @click="dialogTableVisible=true" class="choose">请选择</span></p>
66
         </el-form-item>
66
         </el-form-item>
67
         <el-form-item>
67
         <el-form-item>
68
           <el-button type="primary" @click="submitForm">修改并审核通过</el-button>
68
           <el-button type="primary" @click="submitForm">修改并审核通过</el-button>
69
           <el-button @click="$router.go(-1)">驳回</el-button>
69
           <el-button @click="$router.go(-1)">驳回</el-button>
70
         </el-form-item>
70
         </el-form-item>
71
-        <el-dialog title="选择置业顾问" :visible.sync="dialogTableVisible">
72
-      <el-table :data="gridData">
73
-        <el-table-column property="date" label="姓名"></el-table-column>
74
-        <el-table-column property="name" label="电话"></el-table-column>
75
-        <el-table-column property="name" label="部门"></el-table-column>
76
-        <el-table-column property="name" label="岗位"></el-table-column>
71
+    <el-dialog title="选择置业顾问" :visible.sync="dialogTableVisible">
72
+      <el-table :data="consultantList">
73
+        <el-table-column property="name" label="姓名"></el-table-column>
74
+        <el-table-column property="phone" label="电话"></el-table-column>
75
+        <el-table-column property="department" label="部门"></el-table-column>
76
+        <el-table-column property="post" label="岗位"></el-table-column>
77
         <el-table-column fixed="right" label="操作">
77
         <el-table-column fixed="right" label="操作">
78
           <template slot-scope="scope">
78
           <template slot-scope="scope">
79
             <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>
79
             <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>
80
           </template>
80
           </template>
81
         </el-table-column>
81
         </el-table-column>
82
       </el-table>
82
       </el-table>
83
+          <el-pagination
84
+                  @size-change="dialogHandleSizeChange"
85
+                  @current-change="dialogHandleCurrentChange"
86
+                  :current-page.sync="dialogForm.pageNumber"
87
+                  :page-size="dialogForm.pageSize"
88
+                  layout="total, prev, pager, next"
89
+                  :total="dialogTotal">
90
+          </el-pagination>
83
     </el-dialog>
91
     </el-dialog>
84
       </el-form>
92
       </el-form>
85
     </div>
93
     </div>
103
       upFileUrl: apis.file.upload.url,
111
       upFileUrl: apis.file.upload.url,
104
       detail: {
112
       detail: {
105
         customerId: '',
113
         customerId: '',
114
+        consultantName: '',
106
         name: undefined,
115
         name: undefined,
107
         company: undefined,
116
         company: undefined,
108
         department: undefined,
117
         department: undefined,
113
         buildings: [],
122
         buildings: [],
114
         realtyConsultant: ''
123
         realtyConsultant: ''
115
       },
124
       },
125
+      dialogForm: {
126
+        pageNumber: 1,
127
+        pageSize: 100
128
+      },
129
+      dialogTotal: 0,
130
+      consultantList: [],
116
       imageUrl: '',
131
       imageUrl: '',
117
       dialogVisible: false,
132
       dialogVisible: false,
118
       dialogImageUrl: "",
133
       dialogImageUrl: "",
140
   },
155
   },
141
   created() {
156
   created() {
142
     this.init();
157
     this.init();
158
+    this.getConsultantsList()
143
   },
159
   },
144
   computed: {
160
   computed: {
145
     ...mapBuildingState({
161
     ...mapBuildingState({
177
             type: "success",
193
             type: "success",
178
             message: "选择成功!"
194
             message: "选择成功!"
179
           });
195
           });
180
-          this.consultant = row.name
196
+          this.detail.realtyConsultant = row.personId
197
+          this.detail.consultantName = row.name
181
           this.dialogTableVisible = false;
198
           this.dialogTableVisible = false;
182
         })
199
         })
183
         .catch(() => {
200
         .catch(() => {
242
 
259
 
243
     hideLoadding() {
260
     hideLoadding() {
244
       if (this.loading) this.loading.close();
261
       if (this.loading) this.loading.close();
262
+    },
263
+    getConsultantsList() {
264
+      this.$store.dispatch('persons/getConsultants', this.dialogForm).then((res) => {
265
+        this.consultantList = res.records
266
+        this.dialogForm.pageNumber = res.current
267
+        this.dialogForm.pageSize = res.size
268
+        this.dialogTotal = res.total
269
+      }).catch(()=> {
270
+        console.log('persons/getConsultants err')
271
+      })
272
+    },
273
+    dialogHandleSizeChange(value) {
274
+      this.dialogForm.pageSize = value
275
+      this.getConsultantsList()
276
+    },
277
+    dialogHandleCurrentChange(value) {
278
+      this.dialogForm.pageNumber = 1
279
+      this.dialogForm.pageSize = value
280
+      this.getConsultantsList()
245
     }
281
     }
246
   },
282
   },
247
-  mounted() {
248
-
249
-  }
250
 };
283
 };
251
 </script>
284
 </script>
252
 
285
 

+ 142
- 4
src/views/customer/recommendCustomer.vue 查看文件

83
         <template slot-scope="scope">
83
         <template slot-scope="scope">
84
           <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">编辑</router-link>
84
           <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">编辑</router-link>
85
           &nbsp;
85
           &nbsp;
86
-          <router-link :to="{ name: 'editRecommend', query: { id: scope.row.personId } }">调整归属</router-link>
86
+          <a href="javascript: void(0);" @click="showDialogConsultants(scope.row)">调整归属</a>
87
           &nbsp;
87
           &nbsp;
88
           <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">积分记录</router-link>
88
           <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">积分记录</router-link>
89
           &nbsp;
89
           &nbsp;
90
-          <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">推荐客户</router-link>
90
+          <a href="javascript: void(0);" @click="showRecommendCustomerList(scope.row)">推荐客户</a>
91
           &nbsp;
91
           &nbsp;
92
           <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">查看详情</router-link>
92
           <router-link :to="{ name:'editRecommend', query: { id: scope.row.customerId } }">查看详情</router-link>
93
         </template>
93
         </template>
102
       @current-change="getList"
102
       @current-change="getList"
103
     >
103
     >
104
     </el-pagination>
104
     </el-pagination>
105
+
106
+
107
+    <el-dialog title="选择置业顾问" :visible.sync="dialogTableVisible">
108
+      <el-table :data="consultantList">
109
+        <el-table-column property="name" label="姓名"></el-table-column>
110
+        <el-table-column property="phone" label="电话"></el-table-column>
111
+        <el-table-column property="department" label="部门"></el-table-column>
112
+        <el-table-column property="post" label="岗位"></el-table-column>
113
+        <el-table-column fixed="right" label="操作">
114
+          <template slot-scope="scope">
115
+<!--            <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>-->
116
+            <el-radio v-model="dialogConsultantForm.realtyConsultant" :label="scope.row.personId"></el-radio>
117
+          </template>
118
+        </el-table-column>
119
+      </el-table>
120
+      <el-pagination
121
+              @size-change="dialogHandleSizeChange"
122
+              @current-change="dialogHandleCurrentChange"
123
+              :current-page.sync="dialogForm.pageNumber"
124
+              :page-size="dialogForm.pageSize"
125
+              layout="total, prev, pager, next"
126
+              :total="dialogTotal">
127
+      </el-pagination>
128
+      <el-button type="primary" @click="handleDel" size="small">确定</el-button>
129
+    </el-dialog>
130
+
131
+
132
+    <el-dialog title="推荐客户" :visible.sync="dialogRecommendedTableVisible">
133
+      <el-table :data="recommendedConsultantList">
134
+        <el-table-column property="name" label="姓名"></el-table-column>
135
+        <el-table-column property="phone" label="电话"></el-table-column>
136
+        <el-table-column property="sex" label="性别">
137
+          <template slot-scope="scope"> {{ scope.row.sex === 1 ? '男' : '女' }}</template>
138
+        </el-table-column>
139
+        <el-table-column property="intention" label="意向项目"></el-table-column>
140
+        <el-table-column property="post" label="推荐时间"></el-table-column>
141
+        <el-table-column fixed="right" label="状态">
142
+          <template slot-scope="scope">
143
+            {{ scope.row.status == 1 ? '报备': scope.row.status == 2 ? '到访' : scope.row.status == 3 ? '认购' : scope.row.status == 4 ? '签约' : '无效' }}
144
+          </template>
145
+        </el-table-column>
146
+      </el-table>
147
+      <el-pagination
148
+              @size-change="recommendedDialogHandleSizeChange"
149
+              @current-change="recommendedDialogHandleCurrentChange"
150
+              :current-page.sync="recommendedDialogConsultantForm.pageNumber"
151
+              :page-size="recommendedDialogConsultantForm.pageSize"
152
+              layout="total, prev, pager, next"
153
+              :total="recommendedDialogTotal">
154
+      </el-pagination>
155
+    </el-dialog>
105
   </div>
156
   </div>
106
 </template>
157
 </template>
107
 <script>
158
 <script>
158
           name: "签约",
209
           name: "签约",
159
           value: 4
210
           value: 4
160
         }
211
         }
161
-      ]
212
+      ],
213
+      dialogTableVisible: false, //选择置业顾问弹框
214
+      consultantList: [],
215
+      dialogForm: {
216
+        pageNumber: 1,
217
+        pageSize: 10
218
+      },
219
+      dialogTotal: 0,
220
+      dialogConsultantForm: {
221
+        customerId: '', // 客户Id
222
+        realtyConsultant: '' // 置业顾问
223
+      },
224
+      // 推荐客户
225
+      dialogRecommendedTableVisible: false,
226
+      recommendedConsultantList: [],
227
+      recommendedDialogTotal: 0,
228
+      recommendedDialogConsultantForm: {
229
+        customerId: '', // 客户Id
230
+        pageNumber: 1,
231
+        pageSize: 10
232
+      },
162
     };
233
     };
163
   },
234
   },
164
   computed: {
235
   computed: {
227
     search() {
298
     search() {
228
       this.currentPage = 1;
299
       this.currentPage = 1;
229
       this.getList();
300
       this.getList();
230
-    }
301
+    },
302
+    handleDel() {
303
+      this.dialogSubmitForm(this.dialogConsultantForm.customerId, this.dialogConsultantForm.realtyConsultant)
304
+      this.dialogTableVisible = false
305
+    },
306
+    dialogHandleSizeChange(value) {
307
+      this.dialogForm.pageSize = value
308
+      this.getConsultantsList()
309
+    },
310
+    dialogHandleCurrentChange(value) {
311
+      this.dialogForm.pageNumber = 1
312
+      this.dialogForm.pageSize = value
313
+      this.getConsultantsList()
314
+    },
315
+    getConsultantsList() {
316
+      this.$store.dispatch('persons/getConsultants', this.dialogForm).then((res) => {
317
+        this.consultantList = res.records
318
+        this.dialogForm.pageNumber = res.current
319
+        this.dialogForm.pageSize = res.size
320
+        this.dialogTotal = res.total
321
+      }).catch(()=> {
322
+        console.log('persons/getConsultants err')
323
+      })
324
+    },
325
+    dialogSubmitForm(customerId, realtyConsultant) {
326
+      console.log('提交', this.dialogConsultantForm)
327
+      this.$store.dispatch('customer/getRecommendCustomersUpdate',{customerId:  customerId, realtyConsultant:  realtyConsultant})
328
+              .then(res => {
329
+                if (res.personId) {
330
+                  this.detail = res;
331
+                }
332
+
333
+                this.$notify.info("保存成功");
334
+              })
335
+              .catch(err => {
336
+                this.$notify.error(err.message);
337
+              });
338
+    },
339
+    showDialogConsultants(row) {
340
+      this.dialogTableVisible = true
341
+      this.dialogConsultantForm.customerId = row.customerId
342
+      this.dialogConsultantForm.realtyConsultant = row.realtyConsultant
343
+      this.getConsultantsList()
344
+    },
345
+    getRecommendCustomerList() {
346
+      this.$store.dispatch('customer/recommendCustomerList', this.recommendedDialogConsultantForm).then((res) => {
347
+        this.recommendedConsultantList = res.records
348
+        this.recommendedDialogConsultantForm.pageNumber = res.current
349
+        this.recommendedDialogConsultantForm.pageSize = res.size
350
+        this.recommendedDialogTotal = res.total
351
+      }).catch(()=> {
352
+        console.log('persons/getConsultants err')
353
+      })
354
+    },
355
+    showRecommendCustomerList(row) {
356
+      this.dialogRecommendedTableVisible = true
357
+      this.recommendedDialogConsultantForm.customerId = row.customerId
358
+      this.getRecommendCustomerList()
359
+    },
360
+    recommendedDialogHandleSizeChange(value) {
361
+      this.recommendedDialogConsultantForm.pageSize = value
362
+      this.getRecommendCustomerList()
363
+    },
364
+    recommendedDialogHandleCurrentChange(value) {
365
+      this.recommendedDialogConsultantForm.pageNumber = 1
366
+      this.recommendedDialogConsultantForm.pageSize = value
367
+      this.getConsultantsList()
368
+    },
231
   }
369
   }
232
 };
370
 };
233
 </script>
371
 </script>