|
1 | 1 | <!-- 分配给我的客户 -->
|
2 |
| -<!-- TODO: 后续再统一改名字 --> |
3 | 2 | <template>
|
4 |
| - <div> |
5 |
| - TODO: 分配给我的客户 |
6 |
| - </div> |
| 3 | + <ContentWrap> |
| 4 | + <div class="pb-5 text-xl">分配给我的客户</div> |
| 5 | + <!-- 搜索工作栏 --> |
| 6 | + <el-form |
| 7 | + ref="queryFormRef" |
| 8 | + :inline="true" |
| 9 | + :model="queryParams" |
| 10 | + class="-mb-15px" |
| 11 | + label-width="68px" |
| 12 | + > |
| 13 | + <el-form-item label="状态" prop="followUpStatus"> |
| 14 | + <el-select |
| 15 | + v-model="queryParams.followUpStatus" |
| 16 | + class="!w-240px" |
| 17 | + placeholder="状态" |
| 18 | + @change="handleQuery" |
| 19 | + > |
| 20 | + <el-option |
| 21 | + v-for="(option, index) in FOLLOWUP_STATUS" |
| 22 | + :label="option.label" |
| 23 | + :value="option.value" |
| 24 | + :key="index" |
| 25 | + /> |
| 26 | + </el-select> |
| 27 | + </el-form-item> |
| 28 | + </el-form> |
| 29 | + </ContentWrap> |
| 30 | + <!-- 列表 --> |
| 31 | + <ContentWrap> |
| 32 | + <el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true"> |
| 33 | + <el-table-column align="center" label="编号" prop="id" /> |
| 34 | + <el-table-column align="center" label="客户名称" prop="name" width="160"> |
| 35 | + <template #default="scope"> |
| 36 | + <el-link :underline="false" type="primary" @click="openDetail(scope.row.id)"> |
| 37 | + {{ scope.row.name }} |
| 38 | + </el-link> |
| 39 | + </template> |
| 40 | + </el-table-column> |
| 41 | + <el-table-column align="center" label="手机" prop="mobile" width="120" /> |
| 42 | + <el-table-column align="center" label="电话" prop="telephone" width="120" /> |
| 43 | + <el-table-column align="center" label="客户来源" prop="source" width="100"> |
| 44 | + <template #default="scope"> |
| 45 | + <dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" /> |
| 46 | + </template> |
| 47 | + </el-table-column> |
| 48 | + <el-table-column align="center" label="所属行业" prop="industryId" width="120"> |
| 49 | + <template #default="scope"> |
| 50 | + <dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" /> |
| 51 | + </template> |
| 52 | + </el-table-column> |
| 53 | + <el-table-column align="center" label="客户等级" prop="level" width="120"> |
| 54 | + <template #default="scope"> |
| 55 | + <dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" /> |
| 56 | + </template> |
| 57 | + </el-table-column> |
| 58 | + <el-table-column align="center" label="网址" prop="website" width="200" /> |
| 59 | + <el-table-column |
| 60 | + :formatter="dateFormatter" |
| 61 | + align="center" |
| 62 | + label="下次联系时间" |
| 63 | + prop="contactNextTime" |
| 64 | + width="180px" |
| 65 | + /> |
| 66 | + <el-table-column align="center" label="备注" prop="remark" width="200" /> |
| 67 | + <el-table-column align="center" label="成交状态" prop="dealStatus"> |
| 68 | + <template #default="scope"> |
| 69 | + <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.dealStatus" /> |
| 70 | + </template> |
| 71 | + </el-table-column> |
| 72 | + <el-table-column align="center" label="距离进入公海" prop="poolDay"> |
| 73 | + <template #default="scope"> {{ scope.row.poolDay }} 天</template> |
| 74 | + </el-table-column> |
| 75 | + <el-table-column |
| 76 | + :formatter="dateFormatter" |
| 77 | + align="center" |
| 78 | + label="最后跟进时间" |
| 79 | + prop="contactLastTime" |
| 80 | + width="180px" |
| 81 | + /> |
| 82 | + <el-table-column |
| 83 | + :formatter="dateFormatter" |
| 84 | + align="center" |
| 85 | + label="创建时间" |
| 86 | + prop="updateTime" |
| 87 | + width="180px" |
| 88 | + /> |
| 89 | + <el-table-column |
| 90 | + :formatter="dateFormatter" |
| 91 | + align="center" |
| 92 | + label="创建时间" |
| 93 | + prop="createTime" |
| 94 | + width="180px" |
| 95 | + /> |
| 96 | + <el-table-column align="center" label="负责人" prop="ownerUserName" width="100px" /> |
| 97 | + <el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" /> |
| 98 | + <el-table-column align="center" label="创建人" prop="creatorName" width="100px" /> |
| 99 | + </el-table> |
| 100 | + <!-- 分页 --> |
| 101 | + <Pagination |
| 102 | + v-model:limit="queryParams.pageSize" |
| 103 | + v-model:page="queryParams.pageNo" |
| 104 | + :total="total" |
| 105 | + @pagination="getList" |
| 106 | + /> |
| 107 | + </ContentWrap> |
7 | 108 | </template>
|
8 | 109 |
|
9 | 110 | <script setup lang="ts" name="FollowCustomer">
|
| 111 | +import { DICT_TYPE } from '@/utils/dict' |
| 112 | +import { dateFormatter } from '@/utils/formatTime' |
| 113 | +import * as CustomerApi from '@/api/crm/customer' |
10 | 114 |
|
11 |
| -</script> |
| 115 | +const { push } = useRouter() |
| 116 | +
|
| 117 | +const FOLLOWUP_STATUS = [ |
| 118 | + { label: '已跟进', value: true }, |
| 119 | + { label: '待跟进', value: false } |
| 120 | +] |
| 121 | +
|
| 122 | +const loading = ref(true) // 列表的加载中 |
| 123 | +const total = ref(0) // 列表的总页数 |
| 124 | +const list = ref([]) // 列表的数据 |
| 125 | +const queryParams = ref({ |
| 126 | + pageNo: 1, |
| 127 | + pageSize: 10, |
| 128 | + followUpStatus: false, |
| 129 | + sceneType: 1 |
| 130 | +}) |
| 131 | +const queryFormRef = ref() // 搜索的表单 |
| 132 | +
|
| 133 | +/** 查询列表 */ |
| 134 | +const getList = async () => { |
| 135 | + loading.value = true |
| 136 | + try { |
| 137 | + const data = await CustomerApi.getCustomerPage(queryParams.value) |
| 138 | + list.value = data.list |
| 139 | + total.value = data.total |
| 140 | + } finally { |
| 141 | + loading.value = false |
| 142 | + } |
| 143 | +} |
12 | 144 |
|
13 |
| -<style scoped> |
| 145 | +/** 搜索按钮操作 */ |
| 146 | +const handleQuery = () => { |
| 147 | + queryParams.value.pageNo = 1 |
| 148 | + getList() |
| 149 | +} |
| 150 | +
|
| 151 | +/** 打开客户详情 */ |
| 152 | +const openDetail = (id: number) => { |
| 153 | + push({ name: 'CrmCustomerDetail', params: { id } }) |
| 154 | +} |
| 155 | +
|
| 156 | +/** 初始化 **/ |
| 157 | +onMounted(() => { |
| 158 | + getList() |
| 159 | +}) |
| 160 | +</script> |
14 | 161 |
|
15 |
| -</style> |
| 162 | +<style scoped></style> |
0 commit comments