TodayCustomer.vue 5.6 KB

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