|
@@ -10,6 +10,11 @@
|
10
|
10
|
<el-form-item label="客户车牌号">
|
11
|
11
|
<el-input v-model="formInline.platNumber" placeholder="车牌号"></el-input>
|
12
|
12
|
</el-form-item>
|
|
13
|
+ <el-form-item label="经纪人">
|
|
14
|
+ <el-select v-model="formInline.agentUserId" placeholder="请选择经纪人">
|
|
15
|
+ <el-option v-for="item in SysUserList.records" :label="item.username" :value="item.userId" :key="item.userId"/>
|
|
16
|
+ </el-select>
|
|
17
|
+ </el-form-item>
|
13
|
18
|
<el-form-item>
|
14
|
19
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
15
|
20
|
<el-button type="info" @click="clear">重置</el-button>
|
|
@@ -108,10 +113,22 @@
|
108
|
113
|
prop="status"
|
109
|
114
|
label="状态">
|
110
|
115
|
</el-table-column> -->
|
|
116
|
+ <el-table-column
|
|
117
|
+ prop="agentUserName"
|
|
118
|
+ label="经纪人"
|
|
119
|
+ >
|
|
120
|
+ </el-table-column>
|
111
|
121
|
<el-table-column
|
112
|
122
|
prop="createDate"
|
113
|
123
|
label="创建时间">
|
114
|
124
|
</el-table-column>
|
|
125
|
+ <el-table-column
|
|
126
|
+ prop="customerId"
|
|
127
|
+ label="操作">
|
|
128
|
+ <template slot-scope="scope">
|
|
129
|
+ <el-button type="text" @click="showAgent(scope.row)" size="small">调整经纪人</el-button>
|
|
130
|
+ </template>
|
|
131
|
+ </el-table-column>
|
115
|
132
|
<!-- <el-table-column
|
116
|
133
|
prop="consultantId"
|
117
|
134
|
label="置业ID">
|
|
@@ -131,11 +148,29 @@
|
131
|
148
|
layout="total, sizes, prev, pager, next, jumper"
|
132
|
149
|
:total="FollowupList.total || 0">
|
133
|
150
|
</el-pagination>
|
|
151
|
+
|
|
152
|
+ <!-- 经济人弹框 -->
|
|
153
|
+ <el-dialog
|
|
154
|
+ title="选择经纪人"
|
|
155
|
+ :visible.sync="agentDialogVisible"
|
|
156
|
+ width="25%"
|
|
157
|
+ :before-close="handleClose">
|
|
158
|
+
|
|
159
|
+ <el-select v-model="agent.toUserId" placeholder="请选择经纪人">
|
|
160
|
+ <el-option v-for="item in SysUserList.records" :label="item.username" :value="item.userId" :key="item.userId"/>
|
|
161
|
+ </el-select>
|
|
162
|
+ <div style="display: flex; justify-content: flex-end;">
|
|
163
|
+ <el-button @click="agentDialogVisible = false">取 消</el-button>
|
|
164
|
+ <el-button type="primary" @click="agentSubmit(true)" v-if="agent.transferId === ''">确 定</el-button>
|
|
165
|
+ <el-button type="primary" @click="agentSubmit(false)" v-else>确 定</el-button>
|
|
166
|
+ </div>
|
|
167
|
+ </el-dialog>
|
134
|
168
|
</div>
|
135
|
169
|
</template>
|
136
|
170
|
<script>
|
137
|
171
|
import { createNamespacedHelpers } from 'vuex'
|
138
|
172
|
const {mapState: mapFollowupState, mapActions: mapFollowupActions } = createNamespacedHelpers('followup')
|
|
173
|
+const {mapState: mapUserState, mapActions: mapUserActions} = createNamespacedHelpers('sysuser')
|
139
|
174
|
|
140
|
175
|
export default {
|
141
|
176
|
name: 'followup-index',
|
|
@@ -146,26 +181,64 @@ export default {
|
146
|
181
|
personName: '',
|
147
|
182
|
phone: '',
|
148
|
183
|
platNumber: '',
|
|
184
|
+ agentUserId: '',
|
149
|
185
|
pageNum: 1,
|
150
|
186
|
pageSize: 10
|
|
187
|
+ },
|
|
188
|
+ listQuery: {
|
|
189
|
+ name: '',
|
|
190
|
+ phone: '',
|
|
191
|
+ identity: undefined,
|
|
192
|
+ },
|
|
193
|
+ pageNavi: {
|
|
194
|
+ page: 1,
|
|
195
|
+ size: 1000,
|
|
196
|
+ total: 0,
|
|
197
|
+ },
|
|
198
|
+ agentDialogVisible: false,
|
|
199
|
+ tempToUserId: '', // 经纪人ID,零时存储
|
|
200
|
+ agent: {
|
|
201
|
+ customerId: '', // 客户ID
|
|
202
|
+ toUserId: '', // 经纪人ID
|
|
203
|
+ transferId: ''
|
151
|
204
|
}
|
152
|
205
|
}
|
153
|
206
|
},
|
154
|
207
|
computed: {
|
155
|
208
|
...mapFollowupState({
|
156
|
209
|
FollowupList: x => x.followup
|
|
210
|
+ }),
|
|
211
|
+ ...mapUserState({
|
|
212
|
+ SysUserList: x => x.list
|
157
|
213
|
})
|
158
|
214
|
},
|
159
|
215
|
created() {
|
160
|
216
|
this.getPage()
|
|
217
|
+ this.getUserList()
|
161
|
218
|
},
|
162
|
219
|
methods: {
|
163
|
220
|
...mapFollowupActions([
|
164
|
|
- 'getFollowup'
|
|
221
|
+ 'getFollowup',
|
|
222
|
+ 'addAgent',
|
|
223
|
+ 'updateAgent'
|
|
224
|
+ ]),
|
|
225
|
+ ...mapUserActions([
|
|
226
|
+ 'getSysUserList'
|
165
|
227
|
]),
|
166
|
228
|
onSubmit() {
|
167
|
229
|
this.getPage()
|
168
|
230
|
},
|
|
231
|
+ getUserList () {
|
|
232
|
+ this.getSysUserList({
|
|
233
|
+ pageNum: this.pageNavi.page || 1,
|
|
234
|
+ pageSize: this.pageNavi.size,
|
|
235
|
+ identity: this.listQuery.identity === '%' ? undefined : this.listQuery.identity,
|
|
236
|
+ ...this.listQuery,
|
|
237
|
+ }).then((data) => {
|
|
238
|
+ const { current: page, size, total } = data
|
|
239
|
+ this.pageNavi = { page, size, total }
|
|
240
|
+ })
|
|
241
|
+ },
|
169
|
242
|
getPage() {
|
170
|
243
|
this.getFollowup(this.formInline)
|
171
|
244
|
// window.console.log(this.$store)
|
|
@@ -208,7 +281,42 @@ export default {
|
208
|
281
|
this.formInline.platNumber = ''
|
209
|
282
|
this.formInline.pageNum = 1
|
210
|
283
|
this.formInline.pageSize = 10
|
|
284
|
+ this.formInline.agentUserId = ''
|
211
|
285
|
this.getPage()
|
|
286
|
+ },
|
|
287
|
+ showAgent(row) {
|
|
288
|
+ this.agentDialogVisible = true
|
|
289
|
+
|
|
290
|
+ // 关联 ta_customer_transfer 主键ID
|
|
291
|
+ // 主键存在表示修改,不存在就是添加
|
|
292
|
+ this.agent.transferId = row.transferId
|
|
293
|
+ if (row.transferId === null) {
|
|
294
|
+ this.agent.transferId = ''
|
|
295
|
+ }
|
|
296
|
+
|
|
297
|
+ this.agent.toUserId = row.agentUserId
|
|
298
|
+ if (row.agentUserId === null) {
|
|
299
|
+ this.agent.toUserId = ''
|
|
300
|
+ }
|
|
301
|
+
|
|
302
|
+ this.agent.customerId = row.customerId
|
|
303
|
+ },
|
|
304
|
+ handleClose(done) { // 关闭经纪人弹框
|
|
305
|
+ done();
|
|
306
|
+ },
|
|
307
|
+ agentSubmit(obj) {
|
|
308
|
+ if (obj) {
|
|
309
|
+ this.agent.transferId = ''
|
|
310
|
+ this.addAgent(this.agent).then(() => {
|
|
311
|
+ this.getPage()
|
|
312
|
+ })
|
|
313
|
+ } else {
|
|
314
|
+ this.updateAgent(this.agent).then(() => {
|
|
315
|
+ this.getPage()
|
|
316
|
+ })
|
|
317
|
+ }
|
|
318
|
+
|
|
319
|
+ this.agentDialogVisible = false
|
212
|
320
|
}
|
213
|
321
|
|
214
|
322
|
}
|