📖 CRM:【客户配置】调整目录结构

pull/351/head^2
YunaiV 2024-01-03 20:09:56 +08:00
parent 4fbb3b88e6
commit d71097ac31
6 changed files with 23 additions and 28 deletions

View File

@ -1,12 +1,11 @@
import request from '@/config/axios'
import { ConfigVO } from '@/api/infra/config'
export interface CustomerPoolConfigVO {
enabled?: boolean
contactExpireDays?: number
dealExpireDays?: number
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 })
}

View File

@ -56,12 +56,12 @@
</Dialog>
</template>
<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 { defaultProps, handleTree } from '@/utils/tree'
import * as UserApi from '@/api/system/user'
import { cloneDeep } from 'lodash-es'
import { LimitConfType } from '@/api/crm/customerLimitConfig'
import { LimitConfType } from '@/api/crm/customer/limitConfig'
const { t } = useI18n() //
const message = useMessage() //
@ -72,7 +72,7 @@ const formLoading = ref(false) // 表单的加载中1修改时的数据加
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
type: undefined,
type: LimitConfType.CUSTOMER_LOCK_LIMIT, // IDE
userIds: undefined,
deptIds: undefined,
maxCount: undefined,
@ -88,15 +88,11 @@ const deptTree = 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
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
await getDeptTree()
//
await getUserTree()
//
if (id) {
formLoading.value = true
@ -108,6 +104,10 @@ const open = async (type: string, id?: number, limitConfType?: LimitConfType) =>
} else {
formData.value.type = limitConfType
}
//
await getDeptTree()
//
await getUserTree()
}
defineExpose({ open }) // open
@ -141,7 +141,7 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: undefined,
type: undefined,
type: LimitConfType.CUSTOMER_LOCK_LIMIT,
userIds: undefined,
deptIds: undefined,
maxCount: undefined,

View File

@ -1,7 +1,5 @@
<template>
<el-button type="primary" plain @click="handleQuery">
<Icon icon="ep:refresh" class="mr-5px" /> 刷新
</el-button>
<el-button plain @click="handleQuery"> <Icon icon="ep:refresh" class="mr-5px" /> 刷新 </el-button>
<el-button
type="primary"
plain
@ -87,10 +85,10 @@
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import * as CustomerLimitConfigApi from '@/api/crm/customerLimitConfig'
import CustomerLimitConfigForm from '@/views/crm/config/customerLimitConfig/CustomerLimitConfigForm.vue'
import * as CustomerLimitConfigApi from '@/api/crm/customer/limitConfig'
import CustomerLimitConfigForm from './CustomerLimitConfigForm.vue'
import { DICT_TYPE } from '@/utils/dict'
import { LimitConfType } from '@/api/crm/customerLimitConfig'
import { LimitConfType } from '@/api/crm/customer/limitConfig'
defineOptions({ name: 'CustomerLimitConfigList' })
@ -107,8 +105,6 @@ const queryParams = reactive({
pageSize: 10,
type: confType
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
@ -125,7 +121,7 @@ const getList = async () => {
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id, confType)
formRef.value.open(type, confType, id)
}
/** 删除按钮操作 */

View File

@ -12,8 +12,8 @@
</ContentWrap>
</template>
<script setup lang="ts">
import CustomerLimitConfigList from '@/views/crm/config/customerLimitConfig/CustomerLimitConfigList.vue'
import { LimitConfType } from '@/api/crm/customerLimitConfig'
import CustomerLimitConfigList from './CustomerLimitConfigList.vue'
import { LimitConfType } from '@/api/crm/customer/limitConfig'
defineOptions({ name: 'CrmCustomerLimitConfig' })
</script>

View File

@ -56,7 +56,7 @@
</ContentWrap>
</template>
<script setup lang="ts">
import * as CustomerPoolConfigApi from '@/api/crm/customerPoolConfig'
import * as CustomerPoolConfigApi from '@/api/crm/customer/poolConfig'
import { CardTitle } from '@/components/Card'
defineOptions({ name: 'CrmCustomerPoolConfig' })
@ -67,10 +67,10 @@ const { t } = useI18n() // 国际化
const formLoading = ref(false)
const formData = ref({
enabled: false,
contactExpireDays: 0,
dealExpireDays: 0,
contactExpireDays: undefined,
dealExpireDays: undefined,
notifyEnabled: false,
notifyDays: 0
notifyDays: undefined
})
const formRules = reactive({
enabled: [{ required: true, message: '是否启用客户公海不能为空', trigger: 'blur' }]
@ -100,7 +100,7 @@ const onSubmit = async () => {
//
formLoading.value = true
try {
const data = formData.value as unknown as CustomerPoolConfigApi.CustomerPoolConfigVO
const data = formData.value as CustomerPoolConfigApi.CustomerPoolConfigVO
await CustomerPoolConfigApi.saveCustomerPoolConfig(data)
message.success(t('common.updateSuccess'))
await getConfig()