feat: 客户配置 review 修改
parent
36702f5f90
commit
dfad8e78c4
|
|
@ -1,4 +1,5 @@
|
||||||
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
|
||||||
|
|
@ -14,6 +15,6 @@ export const getCustomerPoolConfig = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新客户公海规则设置
|
// 更新客户公海规则设置
|
||||||
export const updateCustomerPoolConfig = async (data: ConfigVO) => {
|
export const saveCustomerPoolConfig = async (data: ConfigVO) => {
|
||||||
return await request.put({ url: `/crm/customer-pool-config/update`, data })
|
return await request.put({ url: `/crm/customer-pool-config/save`, data })
|
||||||
}
|
}
|
||||||
|
|
@ -19,8 +19,16 @@
|
||||||
>
|
>
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
<el-table-column label="编号" align="center" prop="id" />
|
||||||
<el-table-column label="规则类型" align="center" prop="type" />
|
<el-table-column label="规则类型" align="center" prop="type" />
|
||||||
<el-table-column label="规则适用人群" align="center" prop="userNames" />
|
<el-table-column
|
||||||
<el-table-column label="规则适用部门" align="center" prop="deptNames" />
|
label="规则适用人群"
|
||||||
|
align="center"
|
||||||
|
:formatter="(row) => row.users?.map((user: any) => user.nickname).join(',')"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="规则适用部门"
|
||||||
|
align="center"
|
||||||
|
:formatter="(row) => row.depts?.map((dept: any) => dept.name).join(',')"
|
||||||
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="
|
:label="
|
||||||
confType === LimitConfType.CUSTOMER_QUANTITY_LIMIT ? '拥有客户数上限' : '锁定客户数上限'
|
confType === LimitConfType.CUSTOMER_QUANTITY_LIMIT ? '拥有客户数上限' : '锁定客户数上限'
|
||||||
|
|
@ -84,7 +92,7 @@ import CustomerLimitConfigForm from '@/views/crm/customerLimitConfig/CustomerLim
|
||||||
import { LimitConfType } from '@/views/crm/customerLimitConfig/customerLimitConf'
|
import { LimitConfType } from '@/views/crm/customerLimitConfig/customerLimitConf'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
|
|
||||||
defineOptions({ name: 'CustomerLimitConfDetails' })
|
defineOptions({ name: 'CustomerLimitConfigList' })
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
@ -3,17 +3,16 @@
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-tabs>
|
<el-tabs>
|
||||||
<el-tab-pane label="拥有客户数限制">
|
<el-tab-pane label="拥有客户数限制">
|
||||||
<!-- TODO @wanwan:CustomerLimitConfigList,因为它是列表哈 -->
|
<CustomerLimitConfigList :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="锁定客户数限制">
|
||||||
<CustomerLimitConfDetails :confType="LimitConfType.CUSTOMER_LOCK_LIMIT" />
|
<CustomerLimitConfigList :confType="LimitConfType.CUSTOMER_LOCK_LIMIT" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</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 CustomerLimitConfigList from '@/views/crm/customerLimitConfig/CustomerLimitConfigList.vue'
|
||||||
import { LimitConfType } from '@/views/crm/customerLimitConfig/customerLimitConf'
|
import { LimitConfType } from '@/views/crm/customerLimitConfig/customerLimitConf'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmCustomerLimitConfig' })
|
defineOptions({ name: 'CrmCustomerLimitConfig' })
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,11 @@
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as CustomerPoolConfApi from '@/api/crm/customerPoolConf'
|
import * as CustomerPoolConfigApi from '@/api/crm/customerPoolConfig'
|
||||||
import { CardTitle } from '@/components/Card'
|
import { CardTitle } from '@/components/Card'
|
||||||
|
|
||||||
// TODO @wanwan:CustomerPoolConf =》 CustomerPoolConfig;另外,我们在 crm 目录下,新建一个 config 目录,然后把 customerPoolConfig 和 customerLimitConfig 都挪进
|
// TODO @wanwan:CustomerPoolConf =》 CustomerPoolConfig;另外,我们在 crm 目录下,新建一个 config 目录,然后把 customerPoolConfig 和 customerLimitConfig 都挪进
|
||||||
defineOptions({ name: 'CustomerPoolConf' })
|
defineOptions({ name: 'CustomerPoolConfig' })
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
@ -78,7 +78,7 @@ const formRef = ref() // 表单 Ref
|
||||||
const getConfig = async () => {
|
const getConfig = async () => {
|
||||||
try {
|
try {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
const data = await CustomerPoolConfApi.getCustomerPoolConfig()
|
const data = await CustomerPoolConfigApi.getCustomerPoolConfig()
|
||||||
if (data === null) {
|
if (data === null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -97,8 +97,8 @@ const onSubmit = async () => {
|
||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = formData.value as unknown as CustomerPoolConfApi.CustomerPoolConfigVO
|
const data = formData.value as unknown as CustomerPoolConfigApi.CustomerPoolConfigVO
|
||||||
await CustomerPoolConfApi.updateCustomerPoolConfig(data)
|
await CustomerPoolConfigApi.saveCustomerPoolConfig(data)
|
||||||
message.success(t('common.updateSuccess'))
|
message.success(t('common.updateSuccess'))
|
||||||
await getConfig()
|
await getConfig()
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue