|
@@ -29,18 +29,20 @@
|
|
|
<TableRowStatus :statusMsg="accountStatusMsg" :useStatus="row.status" />
|
|
<TableRowStatus :statusMsg="accountStatusMsg" :useStatus="row.status" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
+ <!-- 公海跟进 -->
|
|
|
<template #publicFollowStatus="{row}">
|
|
<template #publicFollowStatus="{row}">
|
|
|
<el-switch
|
|
<el-switch
|
|
|
:model-value="Boolean(row.publicFollowStatus)"
|
|
:model-value="Boolean(row.publicFollowStatus)"
|
|
|
- @change="(val)=>HandleCardSwitchOnOff({id:row.id,onOffVal:val})"
|
|
|
|
|
|
|
+ @change="(val)=>HandleCardSwitchOnOff({id:row.id,onOffVal:val,type:'public'})"
|
|
|
style="--el-switch-on-color: #2e64fa; --el-switch-off-color: #bbbbbb"
|
|
style="--el-switch-on-color: #2e64fa; --el-switch-off-color: #bbbbbb"
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
+ <!-- 历史跟进 -->
|
|
|
<template #historyFollowStatus="{row}">
|
|
<template #historyFollowStatus="{row}">
|
|
|
<el-switch
|
|
<el-switch
|
|
|
:model-value="Boolean(row.historyFollowStatus)"
|
|
:model-value="Boolean(row.historyFollowStatus)"
|
|
|
- @change="(val)=>HandleCardSwitchOnOff({id:row.id,onOffVal:val})"
|
|
|
|
|
|
|
+ @change="(val)=>HandleCardSwitchOnOff({id:row.id,onOffVal:val,type:'history'})"
|
|
|
style="--el-switch-on-color: #2e64fa; --el-switch-off-color: #bbbbbb"
|
|
style="--el-switch-on-color: #2e64fa; --el-switch-off-color: #bbbbbb"
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
@@ -49,14 +51,14 @@
|
|
|
<div class="table_row_option">
|
|
<div class="table_row_option">
|
|
|
<span class="option_button_editor" @click="OpenUserFormDialog(row)">编辑</span>
|
|
<span class="option_button_editor" @click="OpenUserFormDialog(row)">编辑</span>
|
|
|
<span class="option_button_editor" @click="OpenresetPasswordFormDialog(row)">重置密码</span>
|
|
<span class="option_button_editor" @click="OpenresetPasswordFormDialog(row)">重置密码</span>
|
|
|
- <span class="option_button_editor" @click="OpenForbiddenDialog(row,'forbidden')">禁用</span>
|
|
|
|
|
|
|
+ <span class="option_button_editor" @click="OpenForbiddenDialog(row,'forbidden')">{{row.status === 1 ? '禁用' : '启用' }}</span>
|
|
|
<span class="el_button_delete" @click="OpenForbiddenDialog(row,'delete')">删除</span>
|
|
<span class="el_button_delete" @click="OpenForbiddenDialog(row,'delete')">删除</span>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</Table>
|
|
</Table>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- 新增用户 弹窗 -->
|
|
|
|
|
|
|
+ <!-- 新增/修改用户 弹窗 -->
|
|
|
<FormDialog
|
|
<FormDialog
|
|
|
class="user_form_dialog"
|
|
class="user_form_dialog"
|
|
|
width="482px"
|
|
width="482px"
|
|
@@ -121,7 +123,6 @@ import {
|
|
|
} from '@/api/userManage'
|
|
} from '@/api/userManage'
|
|
|
|
|
|
|
|
import {genderNumToName, accountStatusMsg} from '@/components/dict'
|
|
import {genderNumToName, accountStatusMsg} from '@/components/dict'
|
|
|
-import { historyFollowSearchList } from '@/views/myCustomer/myCustomerDetail/customerStatusOverview/searchBlock';
|
|
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -130,15 +131,42 @@ import { ElMessage } from 'element-plus';
|
|
|
const currentPage = ref(1)
|
|
const currentPage = ref(1)
|
|
|
const pageSize = ref(20)
|
|
const pageSize = ref(20)
|
|
|
const totalNum = ref(0)
|
|
const totalNum = ref(0)
|
|
|
-
|
|
|
|
|
const userTableData = ref([])
|
|
const userTableData = ref([])
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
const searchParams = ref({
|
|
const searchParams = ref({
|
|
|
defaultUserType:1, // 默认展示的用户类型
|
|
defaultUserType:1, // 默认展示的用户类型
|
|
|
queryStr:"",
|
|
queryStr:"",
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+// 筛选不同的用户状态数据
|
|
|
|
|
+const HandleUserTypeChange = (val)=>{
|
|
|
|
|
+ searchParams.value.defaultUserType = val
|
|
|
|
|
+ GetUserList()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 筛选模糊查询数据
|
|
|
|
|
+const HandleBlurSearch = (params,key)=>{
|
|
|
|
|
+ searchParams.value = {
|
|
|
|
|
+ ...searchParams.value,
|
|
|
|
|
+ ...params,
|
|
|
|
|
+ }
|
|
|
|
|
+ GetUserList()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 获取 启用/禁用 用户
|
|
|
|
|
+const GetUserList = async()=>{
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ queryStr: searchParams.value.queryStr,
|
|
|
|
|
+ "status": searchParams.value.defaultUserType,
|
|
|
|
|
+ pageNum: currentPage.value,
|
|
|
|
|
+ pageSize: pageSize.value
|
|
|
|
|
+ }
|
|
|
|
|
+ let res = await getUserListApi(params)
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
|
|
+ userTableData.value = res.data.records
|
|
|
|
|
+ totalNum.value = res.data.total
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 2. 新增用户弹窗相关数据
|
|
* 2. 新增用户弹窗相关数据
|
|
|
*/
|
|
*/
|
|
@@ -190,7 +218,6 @@ const HandleUserFormDialogConfirm = async (params)=>{
|
|
|
historyFollowStatus:formData.historyFollowStatus ? 1 : 0,
|
|
historyFollowStatus:formData.historyFollowStatus ? 1 : 0,
|
|
|
}
|
|
}
|
|
|
let res = undefined
|
|
let res = undefined
|
|
|
-
|
|
|
|
|
try{
|
|
try{
|
|
|
if(formData.id){
|
|
if(formData.id){
|
|
|
// 修改
|
|
// 修改
|
|
@@ -200,7 +227,6 @@ const HandleUserFormDialogConfirm = async (params)=>{
|
|
|
res = await addUserApi(transferParams)
|
|
res = await addUserApi(transferParams)
|
|
|
}
|
|
}
|
|
|
}catch{}
|
|
}catch{}
|
|
|
-
|
|
|
|
|
if(res?.code == 200){
|
|
if(res?.code == 200){
|
|
|
ElMessage.success(res?.msg)
|
|
ElMessage.success(res?.msg)
|
|
|
CloseUserFormDialog()
|
|
CloseUserFormDialog()
|
|
@@ -224,11 +250,25 @@ const OpenresetPasswordFormDialog = (row?:any)=>{
|
|
|
// 关闭 重置密码弹窗
|
|
// 关闭 重置密码弹窗
|
|
|
const CloseResetPasswordFormDialog = ()=>{
|
|
const CloseResetPasswordFormDialog = ()=>{
|
|
|
resetPasswordFormDialogVisible.value = false
|
|
resetPasswordFormDialogVisible.value = false
|
|
|
|
|
+ resetPasswordFormDialogSubmiting.value = false
|
|
|
defaultResetPasswordFormData.value = {}
|
|
defaultResetPasswordFormData.value = {}
|
|
|
}
|
|
}
|
|
|
// 保存 重置密码弹窗
|
|
// 保存 重置密码弹窗
|
|
|
-const HandleresetPasswordFormDialogConfirm = ()=>{
|
|
|
|
|
- CloseResetPasswordFormDialog()
|
|
|
|
|
|
|
+const HandleresetPasswordFormDialogConfirm = async (params)=>{
|
|
|
|
|
+ resetPasswordFormDialogSubmiting.value = true
|
|
|
|
|
+ const { formData,formRef } = params
|
|
|
|
|
+ let transferParams = {
|
|
|
|
|
+ newPassword: formData.newPassword,
|
|
|
|
|
+ userId: formData.id
|
|
|
|
|
+ }
|
|
|
|
|
+ let res = await resetUserPasswordApi(transferParams)
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
|
|
+ ElMessage.success(res.msg)
|
|
|
|
|
+ CloseResetPasswordFormDialog()
|
|
|
|
|
+ GetUserList()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ resetPasswordFormDialogSubmiting.value = false
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -237,50 +277,63 @@ const HandleresetPasswordFormDialogConfirm = ()=>{
|
|
|
const forbiddenDialogVisible = ref(false)
|
|
const forbiddenDialogVisible = ref(false)
|
|
|
const forbiddenDialogLoading = ref(false)
|
|
const forbiddenDialogLoading = ref(false)
|
|
|
const currentEditRow = ref()
|
|
const currentEditRow = ref()
|
|
|
-const currentOperationType = ref('')
|
|
|
|
|
-const HandleForbiddenDialogClose = ()=>{
|
|
|
|
|
- currentEditRow.value = undefined
|
|
|
|
|
- forbiddenDialogVisible.value = false
|
|
|
|
|
-}
|
|
|
|
|
-const HandleForbiddenDialogConfirm = ()=>{
|
|
|
|
|
- // 区分 禁用和删除
|
|
|
|
|
- // currentOperationType.value
|
|
|
|
|
- HandleForbiddenDialogClose()
|
|
|
|
|
-}
|
|
|
|
|
|
|
+const currentOperationType = ref('') // 删除:delete | 禁用/启用 forbidden
|
|
|
|
|
+// 打开弹窗
|
|
|
// type: delete | forbidden
|
|
// type: delete | forbidden
|
|
|
const OpenForbiddenDialog = (row,type)=>{
|
|
const OpenForbiddenDialog = (row,type)=>{
|
|
|
currentOperationType.value = type
|
|
currentOperationType.value = type
|
|
|
currentEditRow.value = row
|
|
currentEditRow.value = row
|
|
|
forbiddenDialogVisible.value = true
|
|
forbiddenDialogVisible.value = true
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-const HandleUserTypeChange = (val)=>{
|
|
|
|
|
- searchParams.value.defaultUserType = val
|
|
|
|
|
- GetUserList()
|
|
|
|
|
|
|
+// 关闭弹窗
|
|
|
|
|
+const HandleForbiddenDialogClose = ()=>{
|
|
|
|
|
+ currentEditRow.value = undefined
|
|
|
|
|
+ forbiddenDialogVisible.value = false
|
|
|
|
|
+ forbiddenDialogLoading.value = false
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-const HandleBlurSearch = (params,key)=>{
|
|
|
|
|
- searchParams.value = {
|
|
|
|
|
- ...searchParams.value,
|
|
|
|
|
- ...params,
|
|
|
|
|
|
|
+// 弹窗确认
|
|
|
|
|
+const HandleForbiddenDialogConfirm = async ()=>{
|
|
|
|
|
+ forbiddenDialogLoading.value = true
|
|
|
|
|
+ let res = undefined
|
|
|
|
|
+ try{
|
|
|
|
|
+ if(currentOperationType.value == 'delete'){
|
|
|
|
|
+ // 删除接口调用
|
|
|
|
|
+ res = await deleteUserApi(currentEditRow.value.id)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ // 禁用接口调用
|
|
|
|
|
+ res = await openOrCloseUserAccountApi(currentEditRow.value.id)
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch{}
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
|
|
+ ElMessage.success(res?.msg)
|
|
|
|
|
+ HandleForbiddenDialogClose()
|
|
|
|
|
+ GetUserList()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ forbiddenDialogLoading.value = false
|
|
|
}
|
|
}
|
|
|
- GetUserList()
|
|
|
|
|
}
|
|
}
|
|
|
-// 获取 启用/禁用 用户
|
|
|
|
|
-const GetUserList = async()=>{
|
|
|
|
|
- let params = {
|
|
|
|
|
- queryStr: searchParams.value.queryStr,
|
|
|
|
|
- "status": searchParams.value.defaultUserType,
|
|
|
|
|
- pageNum: currentPage.value,
|
|
|
|
|
- pageSize: pageSize.value
|
|
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 5. 公海跟进 / 历史跟进 操作控制
|
|
|
|
|
+ */
|
|
|
|
|
+const HandleCardSwitchOnOff = async (params)=>{
|
|
|
|
|
+ const { id, onOffVal, type } = params
|
|
|
|
|
+ let res = undefined
|
|
|
|
|
+ if(type == 'public'){
|
|
|
|
|
+ res = await openOrCloseUserFollowStatusApi(id,'publicFollow')
|
|
|
|
|
+ }else if(type == 'history'){
|
|
|
|
|
+ res = await openOrCloseUserFollowStatusApi(id,'historyFollow')
|
|
|
}
|
|
}
|
|
|
- let res = await getUserListApi(params)
|
|
|
|
|
if(res?.code == 200){
|
|
if(res?.code == 200){
|
|
|
- userTableData.value = res.data.records
|
|
|
|
|
- totalNum.value = res.data.total
|
|
|
|
|
|
|
+ ElMessage.success(res?.msg)
|
|
|
|
|
+ GetUserList()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 获取用户信息
|
|
|
|
|
+ */
|
|
|
onMounted(()=>{
|
|
onMounted(()=>{
|
|
|
GetUserList()
|
|
GetUserList()
|
|
|
})
|
|
})
|