parent
26faf5bdfd
commit
d991d92cfc
@ -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 })
|
||||
}
|
@ -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,
|
@ -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)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
@ -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>
|
@ -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()
|
Loading…
Reference in New Issue
Block a user