客户列表 添加渠道筛选
This commit is contained in:
@@ -19,6 +19,17 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户渠道" prop="channel_id">
|
||||
<el-select v-model="selectchannel_id" filterable placeholder="请选择客户渠道">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="item in channelOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-button type="primary" @click="exportfn" v-if="hasAuth('customer@export')">
|
||||
<i class="iconfont-sys"></i> 导出
|
||||
@@ -346,6 +357,7 @@
|
||||
const activecolor = '#3471ff'
|
||||
const { hasAuth } = useAuth()
|
||||
const selectValue = ref<string[]>([])
|
||||
const selectchannel_id = ref<string>('')
|
||||
const showMore = ref(false)
|
||||
const loading = ref(false)
|
||||
const detailDialogVisible = ref(false)
|
||||
@@ -373,6 +385,12 @@
|
||||
customer_id: '',
|
||||
user_id: ''
|
||||
})
|
||||
const channelOptions = ref<any>()
|
||||
//渠道
|
||||
const getgetChannel = async () => {
|
||||
const res = await CrmService.getChannel()
|
||||
channelOptions.value = res || []
|
||||
}
|
||||
const userOptions = ref<any>()
|
||||
const getuserList = async () => {
|
||||
// 这里调用获取用户列表的接口
|
||||
@@ -402,12 +420,13 @@
|
||||
// 表格数据
|
||||
const tableData = ref<any[]>([])
|
||||
onMounted(() => {
|
||||
getgetChannel()
|
||||
getuserList()
|
||||
gettableList()
|
||||
tagGrouplistfn()
|
||||
})
|
||||
// tabs 切换联动
|
||||
watch([selectValue, keyword], () => {
|
||||
watch([selectValue, keyword, selectchannel_id], () => {
|
||||
pagination.currentPage = 1
|
||||
gettableList()
|
||||
})
|
||||
@@ -425,6 +444,9 @@
|
||||
if (keyword.value) {
|
||||
params.keyword = keyword.value
|
||||
}
|
||||
if (selectchannel_id.value) {
|
||||
params.channel_id = selectchannel_id.value
|
||||
}
|
||||
// 标签参数,所有选中的标签id组成数组
|
||||
const selectedTagIds = Object.values(tagActiveMap).filter(Boolean)
|
||||
if (selectedTagIds.length) {
|
||||
|
||||
@@ -116,9 +116,22 @@
|
||||
<!-- 详情对话框 -->
|
||||
<el-dialog v-model="detailDialogVisible" title="详情" width="75%">
|
||||
<div>
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<el-button type="primary" @click="plzyDialogVisiblefn">
|
||||
<i class="iconfont-sys"></i> 批量转移
|
||||
</el-button>
|
||||
<el-form-item label="客户渠道" prop="channel_id">
|
||||
<el-select v-model="selectchannel_id" filterable placeholder="请选择客户渠道">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="item in channelOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<ArtTable
|
||||
ref="tableRef"
|
||||
@@ -410,11 +423,13 @@
|
||||
import { systemService } from '@/api/systemApi'
|
||||
import { formatMenuTitle } from '@/router/utils/utils'
|
||||
import { UserService } from '@/api/usersApi'
|
||||
import { CrmService } from '@/api/crmApi'
|
||||
defineOptions({ name: 'UserList' })
|
||||
const { hasAuth } = useAuth()
|
||||
const activeName = ref('1')
|
||||
const selectValue = ref('1')
|
||||
const company_id = ref('')
|
||||
const selectchannel_id = ref('')
|
||||
const keyword = ref<string>('')
|
||||
const loading = ref(false)
|
||||
const loadingkh = ref(false)
|
||||
@@ -542,6 +557,10 @@
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
watch([selectchannel_id], () => {
|
||||
paginationkh.currentPage = 1
|
||||
gettableListkh(zyForm.customer_id)
|
||||
})
|
||||
const gettableListkh = async (user_id: any) => {
|
||||
loadingkh.value = true
|
||||
try {
|
||||
@@ -551,6 +570,9 @@
|
||||
size: pageSize,
|
||||
user_id: user_id
|
||||
}
|
||||
if (selectchannel_id.value) {
|
||||
params.channel_id = selectchannel_id.value
|
||||
}
|
||||
const { data, current, size, total } = await manageService.getcrmCustomerList(params)
|
||||
tableDatakh.value = data.map((item: any) => ({
|
||||
...item
|
||||
@@ -585,7 +607,14 @@
|
||||
if (status === 0) return 'status-lost'
|
||||
return ''
|
||||
}
|
||||
const channelOptions = ref<any>()
|
||||
//渠道
|
||||
const getgetChannel = async () => {
|
||||
const res = await CrmService.getChannel()
|
||||
channelOptions.value = res || []
|
||||
}
|
||||
const gotransfer = (row: any) => {
|
||||
getgetChannel()
|
||||
paginationkh.currentPage = 1
|
||||
paginationkh.pageSize = 10
|
||||
paginationkh.total = 0
|
||||
|
||||
Reference in New Issue
Block a user