crm:code review 客户配置管理

(cherry picked from commit 526172af60)
This commit is contained in:
YunaiV 2023-11-18 22:11:42 +08:00 committed by shizhong
parent c631fa7915
commit b1892674f6
6 changed files with 21 additions and 24 deletions

View File

@ -1,4 +1,5 @@
<template>
<!-- TODO @wanwan要不要把上面这一整块搞成一个组件就是把 下面 + Details + BasitcInfo 合并成一个 -->
<div v-loading="loading">
<div class="flex items-start justify-between">
<div>
@ -74,20 +75,20 @@
<el-tab-pane label="客户关系" lazy> 客户关系</el-tab-pane>
<!-- TODO wanwan 以下标签上的数量需要接口统计返回 -->
<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 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 label="商机" lazy> 商机</el-tab-pane>
<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 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 label="回访" lazy> 回访</el-tab-pane>
@ -116,14 +117,12 @@ const { currentRoute } = useRouter() // 路由
const id = Number(route.params.id)
const loading = ref(true) //
//
const customer = ref<CustomerApi.CustomerVO>({} as CustomerApi.CustomerVO)
/**
* 获取详情
*
* @param id
*/
const customer = ref<CustomerApi.CustomerVO>({} as CustomerApi.CustomerVO) //
const getCustomerData = async (id: number) => {
loading.value = true
try {

View File

@ -144,4 +144,3 @@ onMounted(() => {
getList()
})
</script>
<style scoped lang="scss"></style>

View File

@ -83,6 +83,7 @@ const formRules = reactive({
maxCount: [{ required: true, message: '数量上限不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
// TODO @
const deptTree = ref() //
const userTree = ref() //
@ -179,6 +180,7 @@ const getUserTree = async () => {
handleUserData(userTree.value, deptUserMap)
}
// TODO @
/**
* 处理用户树
*

View File

@ -1,3 +1,4 @@
// TODO 可以挪到它对应的 api.ts 文件里哈
/**
*
*/

View File

@ -1,8 +1,9 @@
<template>
<!-- 列表 -->
<ContentWrap>
<el-tabs tab-position="left">
<el-tabs>
<el-tab-pane label="拥有客户数限制">
<!-- TODO @wanwanCustomerLimitConfigList因为它是列表哈 -->
<CustomerLimitConfDetails :confType="LimitConfType.CUSTOMER_QUANTITY_LIMIT" />
</el-tab-pane>
<el-tab-pane label="锁定客户数限制">
@ -11,7 +12,6 @@
</el-tabs>
</ContentWrap>
</template>
<script setup lang="ts">
import CustomerLimitConfDetails from '@/views/crm/customerLimitConfig/CustomerLimitConfDetails.vue'
import { LimitConfType } from '@/views/crm/customerLimitConfig/customerLimitConf'

View File

@ -8,6 +8,7 @@
v-loading="formLoading"
>
<el-card shadow="never">
<!-- 操作 -->
<template #header>
<div class="flex items-center justify-between">
<CardTitle title="客户公海规则设置" />
@ -15,11 +16,12 @@
type="primary"
@click="onSubmit"
v-hasPermi="['crm:customer-pool-config:update']"
>保存</el-button
>
保存
</el-button>
</div>
</template>
<!-- 表单 -->
<el-form-item label="客户公海规则设置" prop="enabled">
<el-radio-group v-model="formData.enabled" class="ml-4">
<el-radio :label="false" size="large">不启用</el-radio>
@ -41,9 +43,7 @@
</el-form-item>
<div v-if="formData.notifyEnabled">
<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>
</div>
</div>
@ -51,12 +51,11 @@
</el-form>
</ContentWrap>
</template>
<script setup lang="ts">
import * as CustomerPoolConfApi from '@/api/crm/customerPoolConf'
import { CardTitle } from '@/components/Card'
import { CustomerPoolConfigVO } from '@/api/crm/customerPoolConf'
// TODO @wanwanCustomerPoolConf = CustomerPoolConfig crm config customerPoolConfig customerLimitConfig
defineOptions({ name: 'CustomerPoolConf' })
const message = useMessage() //
@ -70,15 +69,12 @@ const formData = ref({
notifyEnabled: false,
notifyDays: 0
})
const formRules = reactive({
enabled: [{ required: true, message: '是否启用客户公海不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/**
* 获取配置
*/
/** 获取配置 */
const getConfig = async () => {
try {
formLoading.value = true
@ -92,9 +88,7 @@ const getConfig = async () => {
}
}
/**
* 提交配置
*/
/** 提交配置 */
const onSubmit = async () => {
//
if (!formRef) return
@ -113,6 +107,7 @@ const onSubmit = async () => {
}
}
// TODO @wanwanel-radio-group
watch(
() => formData.value.enabled,
(val: boolean) => {
@ -124,6 +119,7 @@ watch(
}
}
)
// TODO @wanwanel-radio-group
watch(
() => formData.value.notifyEnabled,
(val: boolean) => {