crm:code review 客户配置管理
This commit is contained in:
parent
c06223decd
commit
526172af60
@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- TODO @wanwan:要不要把上面这一整块,搞成一个组件,就是把 下面 + Details + BasitcInfo 合并成一个 -->
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<div class="flex items-start justify-between">
|
<div class="flex items-start justify-between">
|
||||||
<div>
|
<div>
|
||||||
@ -74,20 +75,20 @@
|
|||||||
<el-tab-pane label="客户关系" lazy> 客户关系</el-tab-pane>
|
<el-tab-pane label="客户关系" lazy> 客户关系</el-tab-pane>
|
||||||
<!-- TODO wanwan 以下标签上的数量需要接口统计返回 -->
|
<!-- TODO wanwan 以下标签上的数量需要接口统计返回 -->
|
||||||
<el-tab-pane label="联系人" lazy>
|
<el-tab-pane label="联系人" lazy>
|
||||||
<template #label> 联系人<el-badge :value="12" class="item" type="primary" /> </template>
|
<template #label> 联系人<el-badge class="item" type="primary" /> </template>
|
||||||
联系人
|
联系人
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="团队成员" lazy>
|
<el-tab-pane label="团队成员" lazy>
|
||||||
<template #label> 团队成员<el-badge :value="2" class="item" type="primary" /> </template>
|
<template #label> 团队成员<el-badge class="item" type="primary" /> </template>
|
||||||
团队成员
|
团队成员
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="商机" lazy> 商机</el-tab-pane>
|
<el-tab-pane label="商机" lazy> 商机</el-tab-pane>
|
||||||
<el-tab-pane label="合同" lazy>
|
<el-tab-pane label="合同" lazy>
|
||||||
<template #label> 合同<el-badge :value="3" class="item" type="primary" /> </template>
|
<template #label> 合同<el-badge class="item" type="primary" /> </template>
|
||||||
合同
|
合同
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="回款" lazy>
|
<el-tab-pane label="回款" lazy>
|
||||||
<template #label> 回款<el-badge :value="4" class="item" type="primary" /> </template>
|
<template #label> 回款<el-badge class="item" type="primary" /> </template>
|
||||||
回款
|
回款
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="回访" lazy> 回访</el-tab-pane>
|
<el-tab-pane label="回访" lazy> 回访</el-tab-pane>
|
||||||
@ -116,14 +117,12 @@ const { currentRoute } = useRouter() // 路由
|
|||||||
const id = Number(route.params.id)
|
const id = Number(route.params.id)
|
||||||
const loading = ref(true) // 加载中
|
const loading = ref(true) // 加载中
|
||||||
|
|
||||||
// 客户详情
|
|
||||||
const customer = ref<CustomerApi.CustomerVO>({} as CustomerApi.CustomerVO)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取详情
|
* 获取详情
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
|
const customer = ref<CustomerApi.CustomerVO>({} as CustomerApi.CustomerVO) // 客户详情
|
||||||
const getCustomerData = async (id: number) => {
|
const getCustomerData = async (id: number) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
|
@ -144,4 +144,3 @@ onMounted(() => {
|
|||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss"></style>
|
|
||||||
|
@ -83,6 +83,7 @@ const formRules = reactive({
|
|||||||
maxCount: [{ required: true, message: '数量上限不能为空', trigger: 'blur' }]
|
maxCount: [{ required: true, message: '数量上限不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
// TODO @芋艿:看看怎么搞个部门选择组件
|
||||||
const deptTree = ref() // 部门树形结构
|
const deptTree = ref() // 部门树形结构
|
||||||
const userTree = ref() // 用户树形结构
|
const userTree = ref() // 用户树形结构
|
||||||
|
|
||||||
@ -179,6 +180,7 @@ const getUserTree = async () => {
|
|||||||
handleUserData(userTree.value, deptUserMap)
|
handleUserData(userTree.value, deptUserMap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @芋艿:看看怎么搞个用户选择的组件
|
||||||
/**
|
/**
|
||||||
* 处理用户树
|
* 处理用户树
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// TODO 可以挪到它对应的 api.ts 文件里哈
|
||||||
/**
|
/**
|
||||||
* 客户限制配置类型
|
* 客户限制配置类型
|
||||||
*/
|
*/
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-tabs tab-position="left">
|
<el-tabs>
|
||||||
<el-tab-pane label="拥有客户数限制">
|
<el-tab-pane label="拥有客户数限制">
|
||||||
|
<!-- TODO @wanwan:CustomerLimitConfigList,因为它是列表哈 -->
|
||||||
<CustomerLimitConfDetails :confType="LimitConfType.CUSTOMER_QUANTITY_LIMIT" />
|
<CustomerLimitConfDetails :confType="LimitConfType.CUSTOMER_QUANTITY_LIMIT" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="锁定客户数限制">
|
<el-tab-pane label="锁定客户数限制">
|
||||||
@ -11,7 +12,6 @@
|
|||||||
</el-tabs>
|
</el-tabs>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CustomerLimitConfDetails from '@/views/crm/customerLimitConfig/CustomerLimitConfDetails.vue'
|
import CustomerLimitConfDetails from '@/views/crm/customerLimitConfig/CustomerLimitConfDetails.vue'
|
||||||
import { LimitConfType } from '@/views/crm/customerLimitConfig/customerLimitConf'
|
import { LimitConfType } from '@/views/crm/customerLimitConfig/customerLimitConf'
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
v-loading="formLoading"
|
v-loading="formLoading"
|
||||||
>
|
>
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
|
<!-- 操作 -->
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<CardTitle title="客户公海规则设置" />
|
<CardTitle title="客户公海规则设置" />
|
||||||
@ -15,11 +16,12 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
@click="onSubmit"
|
@click="onSubmit"
|
||||||
v-hasPermi="['crm:customer-pool-config:update']"
|
v-hasPermi="['crm:customer-pool-config:update']"
|
||||||
>保存</el-button
|
|
||||||
>
|
>
|
||||||
|
保存
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 表单 -->
|
||||||
<el-form-item label="客户公海规则设置" prop="enabled">
|
<el-form-item label="客户公海规则设置" prop="enabled">
|
||||||
<el-radio-group v-model="formData.enabled" class="ml-4">
|
<el-radio-group v-model="formData.enabled" class="ml-4">
|
||||||
<el-radio :label="false" size="large">不启用</el-radio>
|
<el-radio :label="false" size="large">不启用</el-radio>
|
||||||
@ -41,9 +43,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div v-if="formData.notifyEnabled">
|
<div v-if="formData.notifyEnabled">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
提前
|
提前 <el-input-number class="mx-2" v-model="formData.notifyDays" /> 天提醒
|
||||||
<el-input-number class="mx-2" v-model="formData.notifyDays" />
|
|
||||||
天提醒
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -51,12 +51,11 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as CustomerPoolConfApi from '@/api/crm/customerPoolConf'
|
import * as CustomerPoolConfApi from '@/api/crm/customerPoolConf'
|
||||||
import { CardTitle } from '@/components/Card'
|
import { CardTitle } from '@/components/Card'
|
||||||
import { CustomerPoolConfigVO } from '@/api/crm/customerPoolConf'
|
|
||||||
|
|
||||||
|
// TODO @wanwan:CustomerPoolConf =》 CustomerPoolConfig;另外,我们在 crm 目录下,新建一个 config 目录,然后把 customerPoolConfig 和 customerLimitConfig 都挪进
|
||||||
defineOptions({ name: 'CustomerPoolConf' })
|
defineOptions({ name: 'CustomerPoolConf' })
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
@ -70,15 +69,12 @@ const formData = ref({
|
|||||||
notifyEnabled: false,
|
notifyEnabled: false,
|
||||||
notifyDays: 0
|
notifyDays: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
enabled: [{ required: true, message: '是否启用客户公海不能为空', trigger: 'blur' }]
|
enabled: [{ required: true, message: '是否启用客户公海不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
/**
|
/** 获取配置 */
|
||||||
* 获取配置
|
|
||||||
*/
|
|
||||||
const getConfig = async () => {
|
const getConfig = async () => {
|
||||||
try {
|
try {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
@ -92,9 +88,7 @@ const getConfig = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** 提交配置 */
|
||||||
* 提交配置
|
|
||||||
*/
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef) return
|
if (!formRef) return
|
||||||
@ -113,6 +107,7 @@ const onSubmit = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @wanwan:el-radio-group 选择后,触发会不会更好哈;
|
||||||
watch(
|
watch(
|
||||||
() => formData.value.enabled,
|
() => formData.value.enabled,
|
||||||
(val: boolean) => {
|
(val: boolean) => {
|
||||||
@ -124,6 +119,7 @@ watch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
// TODO @wanwan:el-radio-group 选择后,触发会不会更好哈;
|
||||||
watch(
|
watch(
|
||||||
() => formData.value.notifyEnabled,
|
() => formData.value.notifyEnabled,
|
||||||
(val: boolean) => {
|
(val: boolean) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user