Skip to content

Commit d71097a

Browse files
committed
📖 CRM:【客户配置】调整目录结构
1 parent 4fbb3b8 commit d71097a

File tree

6 files changed

+23
-28
lines changed

6 files changed

+23
-28
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import request from '@/config/axios'
2-
import { ConfigVO } from '@/api/infra/config'
32

43
export interface CustomerPoolConfigVO {
54
enabled?: boolean
65
contactExpireDays?: number
76
dealExpireDays?: number
87
notifyEnabled?: boolean
9-
notifyDays: number
8+
notifyDays?: number
109
}
1110

1211
// 获取客户公海规则设置
@@ -15,6 +14,6 @@ export const getCustomerPoolConfig = async () => {
1514
}
1615

1716
// 更新客户公海规则设置
18-
export const saveCustomerPoolConfig = async (data: ConfigVO) => {
17+
export const saveCustomerPoolConfig = async (data: CustomerPoolConfigVO) => {
1918
return await request.put({ url: `/crm/customer-pool-config/save`, data })
2019
}

src/views/crm/config/customerLimitConfig/CustomerLimitConfigForm.vue renamed to src/views/crm/customer/limitConfig/CustomerLimitConfigForm.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@
5656
</Dialog>
5757
</template>
5858
<script setup lang="ts">
59-
import * as CustomerLimitConfigApi from '@/api/crm/customerLimitConfig'
59+
import * as CustomerLimitConfigApi from '@/api/crm/customer/limitConfig'
6060
import * as DeptApi from '@/api/system/dept'
6161
import { defaultProps, handleTree } from '@/utils/tree'
6262
import * as UserApi from '@/api/system/user'
6363
import { cloneDeep } from 'lodash-es'
64-
import { LimitConfType } from '@/api/crm/customerLimitConfig'
64+
import { LimitConfType } from '@/api/crm/customer/limitConfig'
6565
6666
const { t } = useI18n() // 国际化
6767
const message = useMessage() // 消息弹窗
@@ -72,7 +72,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
7272
const formType = ref('') // 表单的类型:create - 新增;update - 修改
7373
const formData = ref({
7474
id: undefined,
75-
type: undefined,
75+
type: LimitConfType.CUSTOMER_LOCK_LIMIT, // 给个默认值,避免 IDE 报错
7676
userIds: undefined,
7777
deptIds: undefined,
7878
maxCount: undefined,
@@ -88,15 +88,11 @@ const deptTree = ref() // 部门树形结构
8888
const userTree = ref() // 用户树形结构
8989
9090
/** 打开弹窗 */
91-
const open = async (type: string, id?: number, limitConfType?: LimitConfType) => {
91+
const open = async (type: string, limitConfType: LimitConfType, id?: number) => {
9292
dialogVisible.value = true
9393
dialogTitle.value = t('action.' + type)
9494
formType.value = type
9595
resetForm()
96-
// 获得部门树
97-
await getDeptTree()
98-
// 获得用户
99-
await getUserTree()
10096
// 修改时,设置数据
10197
if (id) {
10298
formLoading.value = true
@@ -108,6 +104,10 @@ const open = async (type: string, id?: number, limitConfType?: LimitConfType) =>
108104
} else {
109105
formData.value.type = limitConfType
110106
}
107+
// 获得部门树
108+
await getDeptTree()
109+
// 获得用户
110+
await getUserTree()
111111
}
112112
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
113113
@@ -141,7 +141,7 @@ const submitForm = async () => {
141141
const resetForm = () => {
142142
formData.value = {
143143
id: undefined,
144-
type: undefined,
144+
type: LimitConfType.CUSTOMER_LOCK_LIMIT,
145145
userIds: undefined,
146146
deptIds: undefined,
147147
maxCount: undefined,

src/views/crm/config/customerLimitConfig/CustomerLimitConfigList.vue renamed to src/views/crm/customer/limitConfig/CustomerLimitConfigList.vue

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<template>
2-
<el-button type="primary" plain @click="handleQuery">
3-
<Icon icon="ep:refresh" class="mr-5px" /> 刷新
4-
</el-button>
2+
<el-button plain @click="handleQuery"> <Icon icon="ep:refresh" class="mr-5px" /> 刷新 </el-button>
53
<el-button
64
type="primary"
75
plain
@@ -87,10 +85,10 @@
8785
</template>
8886
<script setup lang="ts">
8987
import { dateFormatter } from '@/utils/formatTime'
90-
import * as CustomerLimitConfigApi from '@/api/crm/customerLimitConfig'
91-
import CustomerLimitConfigForm from '@/views/crm/config/customerLimitConfig/CustomerLimitConfigForm.vue'
88+
import * as CustomerLimitConfigApi from '@/api/crm/customer/limitConfig'
89+
import CustomerLimitConfigForm from './CustomerLimitConfigForm.vue'
9290
import { DICT_TYPE } from '@/utils/dict'
93-
import { LimitConfType } from '@/api/crm/customerLimitConfig'
91+
import { LimitConfType } from '@/api/crm/customer/limitConfig'
9492
9593
defineOptions({ name: 'CustomerLimitConfigList' })
9694
@@ -107,8 +105,6 @@ const queryParams = reactive({
107105
pageSize: 10,
108106
type: confType
109107
})
110-
const queryFormRef = ref() // 搜索的表单
111-
const exportLoading = ref(false) // 导出的加载中
112108
113109
/** 查询列表 */
114110
const getList = async () => {
@@ -125,7 +121,7 @@ const getList = async () => {
125121
/** 添加/修改操作 */
126122
const formRef = ref()
127123
const openForm = (type: string, id?: number) => {
128-
formRef.value.open(type, id, confType)
124+
formRef.value.open(type, confType, id)
129125
}
130126
131127
/** 删除按钮操作 */

src/views/crm/config/customerLimitConfig/index.vue renamed to src/views/crm/customer/limitConfig/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</ContentWrap>
1313
</template>
1414
<script setup lang="ts">
15-
import CustomerLimitConfigList from '@/views/crm/config/customerLimitConfig/CustomerLimitConfigList.vue'
16-
import { LimitConfType } from '@/api/crm/customerLimitConfig'
15+
import CustomerLimitConfigList from './CustomerLimitConfigList.vue'
16+
import { LimitConfType } from '@/api/crm/customer/limitConfig'
1717
1818
defineOptions({ name: 'CrmCustomerLimitConfig' })
1919
</script>

src/views/crm/config/customerPoolConfig/index.vue renamed to src/views/crm/customer/poolConfig/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
</ContentWrap>
5757
</template>
5858
<script setup lang="ts">
59-
import * as CustomerPoolConfigApi from '@/api/crm/customerPoolConfig'
59+
import * as CustomerPoolConfigApi from '@/api/crm/customer/poolConfig'
6060
import { CardTitle } from '@/components/Card'
6161
6262
defineOptions({ name: 'CrmCustomerPoolConfig' })
@@ -67,10 +67,10 @@ const { t } = useI18n() // 国际化
6767
const formLoading = ref(false)
6868
const formData = ref({
6969
enabled: false,
70-
contactExpireDays: 0,
71-
dealExpireDays: 0,
70+
contactExpireDays: undefined,
71+
dealExpireDays: undefined,
7272
notifyEnabled: false,
73-
notifyDays: 0
73+
notifyDays: undefined
7474
})
7575
const formRules = reactive({
7676
enabled: [{ required: true, message: '是否启用客户公海不能为空', trigger: 'blur' }]
@@ -100,7 +100,7 @@ const onSubmit = async () => {
100100
// 提交请求
101101
formLoading.value = true
102102
try {
103-
const data = formData.value as unknown as CustomerPoolConfigApi.CustomerPoolConfigVO
103+
const data = formData.value as CustomerPoolConfigApi.CustomerPoolConfigVO
104104
await CustomerPoolConfigApi.saveCustomerPoolConfig(data)
105105
message.success(t('common.updateSuccess'))
106106
await getConfig()

0 commit comments

Comments
 (0)