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