Skip to content

Commit c38bbb9

Browse files
committed
refactor: 提取公共选项定义
1 parent 7c0c651 commit c38bbb9

File tree

4 files changed

+45
-47
lines changed

4 files changed

+45
-47
lines changed

src/views/crm/backlog/tables/FollowCustomer.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- 分配给我的客户 -->
2+
<!-- WHERE followUpStatus = ? -->
23
<template>
34
<ContentWrap>
45
<div class="pb-5 text-xl">分配给我的客户</div>
@@ -108,16 +109,13 @@
108109
</template>
109110

110111
<script setup lang="ts" name="FollowCustomer">
112+
import * as CustomerApi from '@/api/crm/customer'
111113
import { DICT_TYPE } from '@/utils/dict'
112114
import { dateFormatter } from '@/utils/formatTime'
113-
import * as CustomerApi from '@/api/crm/customer'
115+
import { FOLLOWUP_STATUS } from './common'
114116
115-
const { push } = useRouter()
116117
117-
const FOLLOWUP_STATUS = [
118-
{ label: '已跟进', value: true },
119-
{ label: '待跟进', value: false }
120-
]
118+
const { push } = useRouter()
121119
122120
const loading = ref(true) // 列表的加载中
123121
const total = ref(0) // 列表的总页数

src/views/crm/backlog/tables/FollowLeads.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- TODO: dhb52 待Clue页面更新后同步更新 -->
2+
<!-- WHERE transformStatus = 0 AND followUpStatus = ? -->
23
<template>
34
<ContentWrap>
45
<div class="pb-5 text-xl">分配给我的线索</div>
@@ -81,22 +82,19 @@
8182
</template>
8283

8384
<script setup lang="ts" name="FollowLeads">
85+
import * as ClueApi from '@/api/crm/clue'
8486
import { DICT_TYPE } from '@/utils/dict'
8587
import { dateFormatter } from '@/utils/formatTime'
86-
import * as ClueApi from '@/api/crm/clue'
87-
88-
const FOLLOWUP_STATUS = [
89-
{ label: '已跟进', value: true },
90-
{ label: '待跟进', value: false }
91-
]
88+
import { FOLLOWUP_STATUS } from './common'
9289
9390
const loading = ref(true) // 列表的加载中
9491
const total = ref(0) // 列表的总页数
9592
const list = ref([]) // 列表的数据
9693
const queryParams = reactive({
9794
pageNo: 1,
9895
pageSize: 10,
99-
followUpStatus: false
96+
followUpStatus: false,
97+
transformStatus: false // 固定为【未转移】
10098
})
10199
const queryFormRef = ref() // 搜索的表单
102100

src/views/crm/backlog/tables/TodayCustomer.vue

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<template>
22
<ContentWrap>
3-
<div class="pb-5 text-xl">
4-
今日需联系客户
5-
</div>
3+
<div class="pb-5 text-xl"> 今日需联系客户 </div>
64
<!-- 搜索工作栏 -->
75
<el-form
86
ref="queryFormRef"
@@ -12,7 +10,12 @@
1210
label-width="68px"
1311
>
1412
<el-form-item label="状态" prop="contactStatus">
15-
<el-select v-model="queryParams.contactStatus" class="!w-240px" placeholder="状态" @change="handleQuery">
13+
<el-select
14+
v-model="queryParams.contactStatus"
15+
class="!w-240px"
16+
placeholder="状态"
17+
@change="handleQuery"
18+
>
1619
<el-option
1720
v-for="(option, index) in CONTACT_STATUS"
1821
:label="option.label"
@@ -22,7 +25,12 @@
2225
</el-select>
2326
</el-form-item>
2427
<el-form-item label="归属" prop="sceneType">
25-
<el-select v-model="queryParams.sceneType" class="!w-240px" placeholder="归属" @change="handleQuery">
28+
<el-select
29+
v-model="queryParams.sceneType"
30+
class="!w-240px"
31+
placeholder="归属"
32+
@change="handleQuery"
33+
>
2634
<el-option
2735
v-for="(option, index) in SCENE_TYPES"
2836
:label="option.label"
@@ -111,9 +119,12 @@
111119
</template>
112120

113121
<script lang="ts" setup name="TodayCustomer">
122+
import * as BacklogApi from '@/api/crm/backlog'
114123
import { DICT_TYPE } from '@/utils/dict'
115124
import { dateFormatter } from '@/utils/formatTime'
116-
import * as BacklogApi from '@/api/crm/backlog'
125+
import { CONTACT_STATUS, SCENE_TYPES } from './common'
126+
127+
const { push } = useRouter()
117128
118129
const loading = ref(true) // 列表的加载中
119130
const total = ref(0) // 列表的总页数
@@ -126,19 +137,6 @@ const queryParams = ref({
126137
})
127138
const queryFormRef = ref() // 搜索的表单
128139
129-
const CONTACT_STATUS = [
130-
{ label: '今日需联系', value: 1 },
131-
{ label: '已逾期', value: 2 },
132-
{ label: '已联系', value: 3 }
133-
]
134-
135-
const SCENE_TYPES = [
136-
// TODO 芋艿:貌似可以搞成全局枚举
137-
{ label: '我负责的', value: 1 },
138-
{ label: '我参与的', value: 2 },
139-
{ label: '下属负责的', value: 3 }
140-
]
141-
142140
/** 查询列表 */
143141
const getList = async () => {
144142
loading.value = true
@@ -157,22 +155,7 @@ const handleQuery = () => {
157155
getList()
158156
}
159157
160-
/** 重置按钮操作 */
161-
const resetQuery = (func: Function | undefined = undefined) => {
162-
queryFormRef.value.resetFields()
163-
queryParams.value = {
164-
pageNo: 1,
165-
pageSize: 10,
166-
contactStatus: 1,
167-
sceneType: 1
168-
}
169-
// TODO @dbh52:这里的 func 是不是可以去掉哈;
170-
func && func()
171-
handleQuery()
172-
}
173-
174158
/** 打开客户详情 */
175-
const { push } = useRouter()
176159
const openDetail = (id: number) => {
177160
push({ name: 'CrmCustomerDetail', params: { id } })
178161
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** 跟进状态 */
2+
export const FOLLOWUP_STATUS = [
3+
{ label: '已跟进', value: true },
4+
{ label: '待跟进', value: false }
5+
]
6+
7+
/** 归属范围 */
8+
export const SCENE_TYPES = [
9+
{ label: '我负责的', value: 1 },
10+
{ label: '我参与的', value: 2 },
11+
{ label: '下属负责的', value: 3 }
12+
]
13+
14+
/** 联系状态 */
15+
export const CONTACT_STATUS = [
16+
{ label: '今日需联系', value: 1 },
17+
{ label: '已逾期', value: 2 },
18+
{ label: '已联系', value: 3 }
19+
]

0 commit comments

Comments
 (0)