ClueFollowList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <ContentWrap>
  3. <div class="pb-5 text-xl">分配给我的线索</div>
  4. <!-- 搜索工作栏 -->
  5. <el-form
  6. ref="queryFormRef"
  7. :inline="true"
  8. :model="queryParams"
  9. class="-mb-15px"
  10. label-width="68px"
  11. >
  12. <el-form-item label="状态" prop="followUpStatus">
  13. <el-select
  14. v-model="queryParams.followUpStatus"
  15. class="!w-240px"
  16. placeholder="状态"
  17. @change="handleQuery"
  18. >
  19. <el-option
  20. v-for="(option, index) in FOLLOWUP_STATUS"
  21. :label="option.label"
  22. :value="option.value"
  23. :key="index"
  24. />
  25. </el-select>
  26. </el-form-item>
  27. </el-form>
  28. </ContentWrap>
  29. <!-- 列表 -->
  30. <ContentWrap>
  31. <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
  32. <el-table-column label="线索名称" align="center" prop="name" fixed="left" width="120">
  33. <template #default="scope">
  34. <el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
  35. {{ scope.row.name }}
  36. </el-link>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="线索来源" align="center" prop="source" width="100">
  40. <template #default="scope">
  41. <dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="手机号" align="center" prop="mobile" width="120" />
  45. <el-table-column label="电话" align="center" prop="telephone" width="130" />
  46. <el-table-column label="邮箱" align="center" prop="email" width="180" />
  47. <el-table-column label="地址" align="center" prop="detailAddress" width="180" />
  48. <el-table-column align="center" label="客户行业" prop="industryId" width="100">
  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="135">
  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
  59. :formatter="dateFormatter"
  60. align="center"
  61. label="下次联系时间"
  62. prop="contactNextTime"
  63. width="180px"
  64. />
  65. <el-table-column align="center" label="备注" prop="remark" width="200" />
  66. <el-table-column
  67. label="最后跟进时间"
  68. align="center"
  69. prop="contactLastTime"
  70. :formatter="dateFormatter"
  71. width="180px"
  72. />
  73. <el-table-column align="center" label="最后跟进记录" prop="contactLastContent" width="200" />
  74. <el-table-column align="center" label="负责人" prop="ownerUserName" width="100px" />
  75. <el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100" />
  76. <el-table-column
  77. label="更新时间"
  78. align="center"
  79. prop="updateTime"
  80. :formatter="dateFormatter"
  81. width="180px"
  82. />
  83. <el-table-column
  84. label="创建时间"
  85. align="center"
  86. prop="createTime"
  87. :formatter="dateFormatter"
  88. width="180px"
  89. />
  90. <el-table-column align="center" label="创建人" prop="creatorName" width="100px" />
  91. </el-table>
  92. <!-- 分页 -->
  93. <Pagination
  94. :total="total"
  95. v-model:page="queryParams.pageNo"
  96. v-model:limit="queryParams.pageSize"
  97. @pagination="getList"
  98. />
  99. </ContentWrap>
  100. </template>
  101. <script setup lang="ts">
  102. import * as ClueApi from '@/api/crm/clue'
  103. import { DICT_TYPE } from '@/utils/dict'
  104. import { dateFormatter } from '@/utils/formatTime'
  105. import { FOLLOWUP_STATUS } from './common'
  106. defineOptions({ name: 'CrmClueFollowList' })
  107. const loading = ref(true) // 列表的加载中
  108. const total = ref(0) // 列表的总页数
  109. const list = ref([]) // 列表的数据
  110. const queryParams = reactive({
  111. pageNo: 1,
  112. pageSize: 10,
  113. followUpStatus: false,
  114. transformStatus: false
  115. })
  116. const queryFormRef = ref() // 搜索的表单
  117. /** 查询列表 */
  118. const getList = async () => {
  119. loading.value = true
  120. try {
  121. const data = await ClueApi.getCluePage(queryParams)
  122. list.value = data.list
  123. total.value = data.total
  124. } finally {
  125. loading.value = false
  126. }
  127. }
  128. /** 搜索按钮操作 */
  129. const handleQuery = () => {
  130. queryParams.pageNo = 1
  131. getList()
  132. }
  133. /** 打开线索详情 */
  134. const { push } = useRouter()
  135. const openDetail = (id: number) => {
  136. push({ name: 'CrmClueDetail', params: { id } })
  137. }
  138. /** 激活时 */
  139. onActivated(async () => {
  140. await getList()
  141. })
  142. /** 初始化 **/
  143. onMounted(() => {
  144. getList()
  145. })
  146. </script>