diff --git a/src/api/crm/followup/index.ts b/src/api/crm/followup/index.ts
index f6b66105..504879d3 100644
--- a/src/api/crm/followup/index.ts
+++ b/src/api/crm/followup/index.ts
@@ -7,6 +7,8 @@ export interface FollowUpRecordVO {
bizId: number // 数据编号
type: number // 跟进类型
content: string // 跟进内容
+ picUrls: string[] // 图片
+ fileUrls: string[] // 附件
nextTime: Date // 下次联系时间
businessIds: number[] // 关联的商机编号数组
contactIds: number[] // 关联的联系人编号数组
diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts
index 9a098b81..e616a404 100644
--- a/src/api/crm/permission/index.ts
+++ b/src/api/crm/permission/index.ts
@@ -2,14 +2,15 @@ import request from '@/config/axios'
export interface PermissionVO {
id?: number // 数据权限编号
- userId: number | undefined // 用户编号
- bizType: number | undefined // Crm 类型
- bizId: number | undefined // Crm 类型数据编号
- level: number | undefined // 权限级别
+ userId: number // 用户编号
+ bizType: number // Crm 类型
+ bizId: number // Crm 类型数据编号
+ level: number // 权限级别
deptName?: string // 部门名称
nickname?: string // 用户昵称
postNames?: string[] // 岗位名称数组
createTime?: Date
+ ids?: number[]
}
/**
@@ -50,11 +51,11 @@ export const updatePermission = async (data) => {
}
// 删除数据权限(删除团队成员)
-export const deletePermissionBatch = async (params) => {
- return await request.delete({ url: '/crm/permission/delete', params })
+export const deletePermissionBatch = async (val: number[]) => {
+ return await request.delete({ url: '/crm/permission/delete?ids=' + val.join(',') })
}
// 删除自己的数据权限(退出团队)
-export const deleteSelfPermission = async (id) => {
- return await request.delete({ url: '/crm/permission/quit-team?id=' + id })
+export const deleteSelfPermission = async (id: number) => {
+ return await request.delete({ url: '/crm/permission/delete-self?id=' + id })
}
diff --git a/src/components/UploadFile/src/UploadImgs.vue b/src/components/UploadFile/src/UploadImgs.vue
index 041c8ca5..aa465b56 100644
--- a/src/components/UploadFile/src/UploadImgs.vue
+++ b/src/components/UploadFile/src/UploadImgs.vue
@@ -28,7 +28,7 @@
查看
-
diff --git a/src/views/crm/followup/components/BusinessTableSelect.vue b/src/views/crm/followup/components/BusinessTableSelect.vue
new file mode 100644
index 00000000..de2db616
--- /dev/null
+++ b/src/views/crm/followup/components/BusinessTableSelect.vue
@@ -0,0 +1,88 @@
+
+
+
+
+
+
diff --git a/src/views/crm/followup/components/ContactList.vue b/src/views/crm/followup/components/ContactList.vue
index 2cd7ccf0..5e31718a 100644
--- a/src/views/crm/followup/components/ContactList.vue
+++ b/src/views/crm/followup/components/ContactList.vue
@@ -69,7 +69,7 @@ const props = withDefaults(defineProps<{ contactIds: number[] }>(), {
const list = ref([] as ContactApi.ContactVO[])
const getContactList = async () => {
list.value = (await ContactApi.getContactListByIds(
- props.contactIds
+ unref(props.contactIds)
)) as unknown as ContactApi.ContactVO[]
}
watch(
diff --git a/src/views/crm/followup/components/ContactTableSelect.vue b/src/views/crm/followup/components/ContactTableSelect.vue
new file mode 100644
index 00000000..ded9a6d4
--- /dev/null
+++ b/src/views/crm/followup/components/ContactTableSelect.vue
@@ -0,0 +1,87 @@
+
+
+
+
+
+
diff --git a/src/views/crm/followup/components/index.ts b/src/views/crm/followup/components/index.ts
index b3e7f257..48d90daa 100644
--- a/src/views/crm/followup/components/index.ts
+++ b/src/views/crm/followup/components/index.ts
@@ -1,4 +1,6 @@
import BusinessList from './BusinessList.vue'
+import BusinessTableSelect from './BusinessTableSelect.vue'
import ContactList from './ContactList.vue'
+import ContactTableSelect from './ContactTableSelect.vue'
-export { BusinessList, ContactList }
+export { BusinessList, BusinessTableSelect, ContactList, ContactTableSelect }
diff --git a/src/views/crm/permission/components/PermissionForm.vue b/src/views/crm/permission/components/PermissionForm.vue
index fa73b22a..aced2f48 100644
--- a/src/views/crm/permission/components/PermissionForm.vue
+++ b/src/views/crm/permission/components/PermissionForm.vue
@@ -17,7 +17,6 @@
/>
-
-
+
+
+
+
+
+
+
确 定
@@ -54,12 +59,7 @@ const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const formType = ref('') // 表单的类型:create - 新增;update - 修改
const userOptions = ref([]) // 用户列表
-const formData = ref({
- userId: undefined, // 用户编号
- bizType: undefined, // CRM 类型
- bizId: undefined, // CRM 类型数据编号
- level: undefined // 权限级别
-})
+const formData = ref({} as PermissionApi.PermissionVO)
const formRules = reactive({
userId: [{ required: true, message: '人员不能为空', trigger: 'blur' }],
level: [{ required: true, message: '权限级别不能为空', trigger: 'blur' }]
@@ -77,7 +77,23 @@ const open = async (type: 'create' | 'update', bizType: number, bizId: number, i
formData.value.ids = ids
}
}
-defineExpose({ open }) // 提供 open 方法,用于打开弹窗
+/** 打开修改权限弹窗 */
+const open0 = async (
+ type: 'create' | 'update',
+ bizType: number,
+ bizId: number,
+ id: number,
+ level: number
+) => {
+ dialogVisible.value = true
+ dialogTitle.value = t('action.' + type) + '团队成员'
+ formType.value = type
+ resetForm(bizType, bizId)
+ // 修改时,设置数据
+ formData.value.level = level
+ formData.value.ids = [id]
+}
+defineExpose({ open, open0 }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
@@ -108,12 +124,8 @@ const submitForm = async () => {
/** 重置表单 */
const resetForm = (bizType: number, bizId: number) => {
formRef.value?.resetFields()
- formData.value = {
- userId: undefined, // 用户编号
- bizType, // Crm 类型
- bizId, // Crm 类型数据编号
- level: undefined // 权限级别
- }
+ formData.value = {} as PermissionApi.PermissionVO
+ formData.value = { ...formData.value, bizType, bizId }
}
onMounted(async () => {
// 获得用户列表
diff --git a/src/views/crm/permission/components/PermissionList.vue b/src/views/crm/permission/components/PermissionList.vue
index b098f261..39c7aab3 100644
--- a/src/views/crm/permission/components/PermissionList.vue
+++ b/src/views/crm/permission/components/PermissionList.vue
@@ -105,8 +105,17 @@ const handleUpdate = () => {
message.warning('请先选择团队成员后操作!')
return
}
- const ids = multipleSelection.value?.map((item) => item.id) as unknown as number[]
- formRef.value?.open('update', props.bizType, props.bizId!, ids)
+ if (multipleSelection.value?.length > 1) {
+ message.warning('编辑团队成员时只能选择一个!')
+ return
+ }
+ formRef.value?.open0(
+ 'update',
+ props.bizType,
+ props.bizId!,
+ multipleSelection.value[0].id!,
+ multipleSelection.value[0].level
+ )
}
/** 移除团队成员 */
@@ -116,12 +125,10 @@ const handleDelete = async () => {
return
}
await message.delConfirm()
- const ids = multipleSelection.value?.map((item) => item.id)
- await PermissionApi.deletePermissionBatch({
- bizType: props.bizType,
- bizId: props.bizId,
- ids
- })
+ const ids = multipleSelection.value?.map((item) => item.id) as unknown as number[]
+ await PermissionApi.deletePermissionBatch(ids)
+ message.success('移除团队成员成功!')
+ await getList()
}
/** 添加团队成员 */
@@ -164,6 +171,9 @@ watch(
)
defineExpose({ openForm, validateOwnerUser, validateWrite, isPool })
+const emits = defineEmits<{
+ (e: 'quitTeam'): void
+}>()
/** 退出团队 */
const handleQuit = async () => {
const permission = list.value.find(
@@ -175,9 +185,12 @@ const handleQuit = async () => {
return
}
const userPermission = list.value.find((item) => item.userId === userStore.getUser.id)
- if (userPermission) {
- await PermissionApi.deleteSelfPermission(userPermission.id!)
+ if (!userPermission) {
+ return
}
+ await PermissionApi.deleteSelfPermission(userPermission.id!)
+ message.success('退出团队成员成功!')
+ emits('quitTeam')
}
watch(
diff --git a/src/views/mall/product/comment/CommentForm.vue b/src/views/mall/product/comment/CommentForm.vue
index df6756a0..b8d700cc 100644
--- a/src/views/mall/product/comment/CommentForm.vue
+++ b/src/views/mall/product/comment/CommentForm.vue
@@ -1,17 +1,17 @@
-