CRM 客户管理 数据权限修改

pull/853/head
wersd 2025-06-08 20:12:31 +08:00
parent 7f8f02ebf7
commit 293dd72420
5 changed files with 10 additions and 55 deletions

View File

@ -4,7 +4,7 @@ NODE_ENV=production
VITE_DEV=true VITE_DEV=true
# 请求路径 # 请求路径
VITE_BASE_URL='http://www.woyaoshouchong.asia:88' VITE_BASE_URL='http://www.sujieguanli.top:88'
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务 # 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=client VITE_UPLOAD_TYPE=client

View File

@ -53,23 +53,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="商机名称" prop="businessId">
<el-select
@change="handleBusinessChange"
:disabled="!formData.customerId"
v-model="formData.businessId"
class="w-1/1"
>
<el-option
v-for="item in getBusinessOptions"
:key="item.id"
:label="item.name"
:value="item.id!"
/>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
@ -288,8 +271,6 @@ const open = async (type: string, id?: number) => {
} }
// //
contactList.value = await ContactApi.getSimpleContactList() contactList.value = await ContactApi.getSimpleContactList()
//
businessList.value = await BusinessApi.getSimpleBusinessList()
} }
defineExpose({ open }) // open defineExpose({ open }) // open
@ -349,21 +330,9 @@ const handleCustomerChange = () => {
formData.value.products = [] formData.value.products = []
} }
/** 处理商机变化 */
const handleBusinessChange = async (businessId: number) => {
const business = await BusinessApi.getBusiness(businessId)
business.products.forEach((item) => {
item.contractPrice = item.businessPrice
})
formData.value.products = business.products
}
/** 动态获取客户联系人 */ /** 动态获取客户联系人 */
const getContactOptions = computed(() => const getContactOptions = computed(() =>
contactList.value.filter((item) => item.customerId == formData.value.customerId) contactList.value.filter((item) => item.customerId == formData.value.customerId)
) )
/** 动态获取商机 */
const getBusinessOptions = computed(() =>
businessList.value.filter((item) => item.customerId == formData.value.customerId)
)
</script> </script>

View File

@ -1,35 +1,34 @@
<template> <template>
<CustomerDetailsHeader :customer="customer" :loading="loading"> <CustomerDetailsHeader :customer="customer" :loading="loading">
<el-button <el-button
v-if="permissionListRef?.validateWrite"
v-hasPermi="['crm:customer:update']" v-hasPermi="['crm:customer:update']"
type="primary" type="primary"
@click="openForm" @click="openForm"
> >
编辑 编辑
</el-button> </el-button>
<el-button v-if="permissionListRef?.validateOwnerUser" v-hasPermi="['crm:customer:transfor']" type="primary" @click="transfer"> <el-button v-hasPermi="['crm:customer:transfor']" type="primary" @click="transfer">
转移 转移
</el-button> </el-button>
<!-- <el-button v-if="permissionListRef?.validateWrite" @click="handleUpdateDealStatus"> <!-- <el-button v-if="permissionListRef?.validateWrite" @click="handleUpdateDealStatus">
更改成交状态 更改成交状态
</el-button> --> </el-button> -->
<el-button <el-button
v-if="customer.lockStatus && permissionListRef?.validateOwnerUser" v-if="customer.lockStatus"
@click="handleUnlock" @click="handleUnlock"
> >
解锁 解锁
</el-button> </el-button>
<el-button <el-button
v-if="!customer.lockStatus && permissionListRef?.validateOwnerUser" v-if="!customer.lockStatus"
@click="handleLock" @click="handleLock"
> >
锁定 锁定
</el-button> </el-button>
<el-button v-if="!customer.ownerUserId" type="primary" @click="handleReceive"> </el-button> <!-- <el-button v-if="!customer.ownerUserId" type="primary" @click="handleReceive"> </el-button>
<el-button v-if="!customer.ownerUserId" type="primary" @click="handleDistributeForm"> <el-button v-if="!customer.ownerUserId" type="primary" @click="handleDistributeForm">
分配 分配
</el-button> </el-button> -->
</CustomerDetailsHeader> </CustomerDetailsHeader>
<el-col> <el-col>
<el-tabs> <el-tabs>
@ -42,7 +41,7 @@
<el-tab-pane label="联系人" lazy> <el-tab-pane label="联系人" lazy>
<ContactList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" :customer-id="customerId"/> <ContactList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" :customer-id="customerId"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="团队成员"> <!-- <el-tab-pane label="团队成员">
<PermissionList <PermissionList
ref="permissionListRef" ref="permissionListRef"
:biz-id="customer.id!" :biz-id="customer.id!"
@ -50,7 +49,7 @@
:show-action="!permissionListRef?.isPool || false" :show-action="!permissionListRef?.isPool || false"
@quit-team="close" @quit-team="close"
/> />
</el-tab-pane> </el-tab-pane> -->
<el-tab-pane label="合同" lazy> <el-tab-pane label="合同" lazy>
<ContractList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" /> <ContractList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane> </el-tab-pane>

View File

@ -91,11 +91,6 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="我负责的" name="1" />
<el-tab-pane label="我参与的" name="2" />
<el-tab-pane label="下属负责的" name="3" />
</el-tabs>
<el-table v-loading="loading" <el-table v-loading="loading"
:data="list" :data="list"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
@ -221,11 +216,6 @@ const exportLoading = ref(false) // 导出的加载中
const activeName = ref('1') // tab const activeName = ref('1') // tab
const areaList = ref([]) const areaList = ref([])
/** tab 切换 */
const handleTabClick = (tab: TabsPaneContext) => {
queryParams.sceneType = tab.paneName as string
handleQuery()
}
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {

View File

@ -18,7 +18,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="老负责人"> <!-- <el-form-item label="老负责人">
<el-radio-group v-model="oldOwnerHandler" @change="handleOwnerChange"> <el-radio-group v-model="oldOwnerHandler" @change="handleOwnerChange">
<el-radio :value="false" size="large">移除</el-radio> <el-radio :value="false" size="large">移除</el-radio>
<el-radio :value="true" size="large">加入团队</el-radio> <el-radio :value="true" size="large">加入团队</el-radio>
@ -35,7 +35,7 @@
</el-radio> </el-radio>
</template> </template>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item> -->
</el-form> </el-form>
<template #footer> <template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button> <el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
@ -68,9 +68,6 @@ const oldOwnerHandler = ref(false) // 老负责人的处理方式
const formData = ref<TransferReqVO>({} as TransferReqVO) const formData = ref<TransferReqVO>({} as TransferReqVO)
const formRules = reactive({ const formRules = reactive({
newOwnerUserId: [{ required: true, message: '新负责人不能为空', trigger: 'blur' }], newOwnerUserId: [{ required: true, message: '新负责人不能为空', trigger: 'blur' }],
oldOwnerPermissionLevel: [
{ required: true, message: '老负责人加入团队后的权限级别不能为空', trigger: 'blur' }
]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref