📖 CRM:【客户配置】调整目录结构
This commit is contained in:
parent
4fbb3b88e6
commit
d71097ac31
@ -1,12 +1,11 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import { ConfigVO } from '@/api/infra/config'
|
|
||||||
|
|
||||||
export interface CustomerPoolConfigVO {
|
export interface CustomerPoolConfigVO {
|
||||||
enabled?: boolean
|
enabled?: boolean
|
||||||
contactExpireDays?: number
|
contactExpireDays?: number
|
||||||
dealExpireDays?: number
|
dealExpireDays?: number
|
||||||
notifyEnabled?: boolean
|
notifyEnabled?: boolean
|
||||||
notifyDays: number
|
notifyDays?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取客户公海规则设置
|
// 获取客户公海规则设置
|
||||||
@ -15,6 +14,6 @@ export const getCustomerPoolConfig = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新客户公海规则设置
|
// 更新客户公海规则设置
|
||||||
export const saveCustomerPoolConfig = async (data: ConfigVO) => {
|
export const saveCustomerPoolConfig = async (data: CustomerPoolConfigVO) => {
|
||||||
return await request.put({ url: `/crm/customer-pool-config/save`, data })
|
return await request.put({ url: `/crm/customer-pool-config/save`, data })
|
||||||
}
|
}
|
@ -56,12 +56,12 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as CustomerLimitConfigApi from '@/api/crm/customerLimitConfig'
|
import * as CustomerLimitConfigApi from '@/api/crm/customer/limitConfig'
|
||||||
import * as DeptApi from '@/api/system/dept'
|
import * as DeptApi from '@/api/system/dept'
|
||||||
import { defaultProps, handleTree } from '@/utils/tree'
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import { LimitConfType } from '@/api/crm/customerLimitConfig'
|
import { LimitConfType } from '@/api/crm/customer/limitConfig'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
@ -72,7 +72,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
|||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
type: undefined,
|
type: LimitConfType.CUSTOMER_LOCK_LIMIT, // 给个默认值,避免 IDE 报错
|
||||||
userIds: undefined,
|
userIds: undefined,
|
||||||
deptIds: undefined,
|
deptIds: undefined,
|
||||||
maxCount: undefined,
|
maxCount: undefined,
|
||||||
@ -88,15 +88,11 @@ const deptTree = ref() // 部门树形结构
|
|||||||
const userTree = ref() // 用户树形结构
|
const userTree = ref() // 用户树形结构
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type: string, id?: number, limitConfType?: LimitConfType) => {
|
const open = async (type: string, limitConfType: LimitConfType, id?: number) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = t('action.' + type)
|
dialogTitle.value = t('action.' + type)
|
||||||
formType.value = type
|
formType.value = type
|
||||||
resetForm()
|
resetForm()
|
||||||
// 获得部门树
|
|
||||||
await getDeptTree()
|
|
||||||
// 获得用户
|
|
||||||
await getUserTree()
|
|
||||||
// 修改时,设置数据
|
// 修改时,设置数据
|
||||||
if (id) {
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
@ -108,6 +104,10 @@ const open = async (type: string, id?: number, limitConfType?: LimitConfType) =>
|
|||||||
} else {
|
} else {
|
||||||
formData.value.type = limitConfType
|
formData.value.type = limitConfType
|
||||||
}
|
}
|
||||||
|
// 获得部门树
|
||||||
|
await getDeptTree()
|
||||||
|
// 获得用户
|
||||||
|
await getUserTree()
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ const submitForm = async () => {
|
|||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
type: undefined,
|
type: LimitConfType.CUSTOMER_LOCK_LIMIT,
|
||||||
userIds: undefined,
|
userIds: undefined,
|
||||||
deptIds: undefined,
|
deptIds: undefined,
|
||||||
maxCount: undefined,
|
maxCount: undefined,
|
@ -1,7 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-button type="primary" plain @click="handleQuery">
|
<el-button plain @click="handleQuery"> <Icon icon="ep:refresh" class="mr-5px" /> 刷新 </el-button>
|
||||||
<Icon icon="ep:refresh" class="mr-5px" /> 刷新
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
@ -87,10 +85,10 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import * as CustomerLimitConfigApi from '@/api/crm/customerLimitConfig'
|
import * as CustomerLimitConfigApi from '@/api/crm/customer/limitConfig'
|
||||||
import CustomerLimitConfigForm from '@/views/crm/config/customerLimitConfig/CustomerLimitConfigForm.vue'
|
import CustomerLimitConfigForm from './CustomerLimitConfigForm.vue'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { LimitConfType } from '@/api/crm/customerLimitConfig'
|
import { LimitConfType } from '@/api/crm/customer/limitConfig'
|
||||||
|
|
||||||
defineOptions({ name: 'CustomerLimitConfigList' })
|
defineOptions({ name: 'CustomerLimitConfigList' })
|
||||||
|
|
||||||
@ -107,8 +105,6 @@ const queryParams = reactive({
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
type: confType
|
type: confType
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
@ -125,7 +121,7 @@ const getList = async () => {
|
|||||||
/** 添加/修改操作 */
|
/** 添加/修改操作 */
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const openForm = (type: string, id?: number) => {
|
const openForm = (type: string, id?: number) => {
|
||||||
formRef.value.open(type, id, confType)
|
formRef.value.open(type, confType, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
@ -12,8 +12,8 @@
|
|||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CustomerLimitConfigList from '@/views/crm/config/customerLimitConfig/CustomerLimitConfigList.vue'
|
import CustomerLimitConfigList from './CustomerLimitConfigList.vue'
|
||||||
import { LimitConfType } from '@/api/crm/customerLimitConfig'
|
import { LimitConfType } from '@/api/crm/customer/limitConfig'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmCustomerLimitConfig' })
|
defineOptions({ name: 'CrmCustomerLimitConfig' })
|
||||||
</script>
|
</script>
|
@ -56,7 +56,7 @@
|
|||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as CustomerPoolConfigApi from '@/api/crm/customerPoolConfig'
|
import * as CustomerPoolConfigApi from '@/api/crm/customer/poolConfig'
|
||||||
import { CardTitle } from '@/components/Card'
|
import { CardTitle } from '@/components/Card'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmCustomerPoolConfig' })
|
defineOptions({ name: 'CrmCustomerPoolConfig' })
|
||||||
@ -67,10 +67,10 @@ const { t } = useI18n() // 国际化
|
|||||||
const formLoading = ref(false)
|
const formLoading = ref(false)
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
enabled: false,
|
enabled: false,
|
||||||
contactExpireDays: 0,
|
contactExpireDays: undefined,
|
||||||
dealExpireDays: 0,
|
dealExpireDays: undefined,
|
||||||
notifyEnabled: false,
|
notifyEnabled: false,
|
||||||
notifyDays: 0
|
notifyDays: undefined
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
enabled: [{ required: true, message: '是否启用客户公海不能为空', trigger: 'blur' }]
|
enabled: [{ required: true, message: '是否启用客户公海不能为空', trigger: 'blur' }]
|
||||||
@ -100,7 +100,7 @@ const onSubmit = async () => {
|
|||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = formData.value as unknown as CustomerPoolConfigApi.CustomerPoolConfigVO
|
const data = formData.value as CustomerPoolConfigApi.CustomerPoolConfigVO
|
||||||
await CustomerPoolConfigApi.saveCustomerPoolConfig(data)
|
await CustomerPoolConfigApi.saveCustomerPoolConfig(data)
|
||||||
message.success(t('common.updateSuccess'))
|
message.success(t('common.updateSuccess'))
|
||||||
await getConfig()
|
await getConfig()
|
Loading…
Reference in New Issue
Block a user