CustomerFollowList.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!-- 分配给我的客户 -->
  2. <!-- WHERE followUpStatus = ? -->
  3. <template>
  4. <ContentWrap>
  5. <div class="pb-5 text-xl">分配给我的客户</div>
  6. <!-- 搜索工作栏 -->
  7. <el-form
  8. ref="queryFormRef"
  9. :inline="true"
  10. :model="queryParams"
  11. class="-mb-15px"
  12. label-width="68px"
  13. >
  14. <el-form-item label="状态" prop="followUpStatus">
  15. <el-select
  16. v-model="queryParams.followUpStatus"
  17. class="!w-240px"
  18. placeholder="状态"
  19. @change="handleQuery"
  20. >
  21. <el-option
  22. v-for="(option, index) in FOLLOWUP_STATUS"
  23. :label="option.label"
  24. :value="option.value"
  25. :key="index"
  26. />
  27. </el-select>
  28. </el-form-item>
  29. </el-form>
  30. </ContentWrap>
  31. <!-- 列表 -->
  32. <ContentWrap>
  33. <el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
  34. <el-table-column align="center" label="客户名称" fixed="left" 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="source" width="100">
  42. <template #default="scope">
  43. <dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="手机" align="center" prop="mobile" width="120" />
  47. <el-table-column label="电话" align="center" prop="telephone" width="130" />
  48. <el-table-column label="邮箱" align="center" prop="email" width="180" />
  49. <el-table-column align="center" label="客户级别" prop="level" width="135">
  50. <template #default="scope">
  51. <dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
  52. </template>
  53. </el-table-column>
  54. <el-table-column align="center" label="客户行业" prop="industryId" width="100">
  55. <template #default="scope">
  56. <dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" />
  57. </template>
  58. </el-table-column>
  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="lockStatus">
  68. <template #default="scope">
  69. <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.lockStatus" />
  70. </template>
  71. </el-table-column>
  72. <el-table-column align="center" label="成交状态" prop="dealStatus">
  73. <template #default="scope">
  74. <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.dealStatus" />
  75. </template>
  76. </el-table-column>
  77. <el-table-column
  78. :formatter="dateFormatter"
  79. align="center"
  80. label="最后跟进时间"
  81. prop="contactLastTime"
  82. width="180px"
  83. />
  84. <el-table-column align="center" label="最后跟进记录" prop="contactLastContent" width="200" />
  85. <el-table-column label="地址" align="center" prop="detailAddress" width="180" />
  86. <el-table-column align="center" label="距离进入公海天数" prop="poolDay" width="140">
  87. <template #default="scope"> {{ scope.row.poolDay }} 天</template>
  88. </el-table-column>
  89. <el-table-column align="center" label="负责人" prop="ownerUserName" width="100px" />
  90. <el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" />
  91. <el-table-column
  92. :formatter="dateFormatter"
  93. align="center"
  94. label="更新时间"
  95. prop="updateTime"
  96. width="180px"
  97. />
  98. <el-table-column
  99. :formatter="dateFormatter"
  100. align="center"
  101. label="创建时间"
  102. prop="createTime"
  103. width="180px"
  104. />
  105. <el-table-column align="center" label="创建人" prop="creatorName" width="100px" />
  106. </el-table>
  107. <!-- 分页 -->
  108. <Pagination
  109. v-model:limit="queryParams.pageSize"
  110. v-model:page="queryParams.pageNo"
  111. :total="total"
  112. @pagination="getList"
  113. />
  114. </ContentWrap>
  115. </template>
  116. <script setup lang="ts">
  117. import * as CustomerApi from '@/api/crm/customer'
  118. import { DICT_TYPE } from '@/utils/dict'
  119. import { dateFormatter } from '@/utils/formatTime'
  120. import { FOLLOWUP_STATUS } from './common'
  121. defineOptions({ name: 'CrmCustomerFollowList' })
  122. const { push } = useRouter()
  123. const loading = ref(true) // 列表的加载中
  124. const total = ref(0) // 列表的总页数
  125. const list = ref([]) // 列表的数据
  126. const queryParams = ref({
  127. pageNo: 1,
  128. pageSize: 10,
  129. sceneType: 1,
  130. followUpStatus: false
  131. })
  132. const queryFormRef = ref() // 搜索的表单
  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. }
  144. /** 搜索按钮操作 */
  145. const handleQuery = () => {
  146. queryParams.value.pageNo = 1
  147. getList()
  148. }
  149. /** 打开客户详情 */
  150. const openDetail = (id: number) => {
  151. push({ name: 'CrmCustomerDetail', params: { id } })
  152. }
  153. /** 激活时 */
  154. onActivated(async () => {
  155. await getList()
  156. })
  157. /** 初始化 **/
  158. onMounted(() => {
  159. getList()
  160. })
  161. </script>