|
@@ -3,6 +3,8 @@ import { apiCustomerUser } from '@/api/customer'
|
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import { computed } from 'vue'
|
|
|
+import MoveUser from './MoveUser.vue'
|
|
|
+import AddContact from './AddContact.vue'
|
|
|
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
@@ -15,16 +17,12 @@ const filterState = reactive({
|
|
|
const tableColOpt = computed( ()=>{
|
|
|
return [
|
|
|
{
|
|
|
- label: '投资者姓名',
|
|
|
+ label: '联系人姓名',
|
|
|
key: 'RealName'
|
|
|
},
|
|
|
{
|
|
|
label: '手机号',
|
|
|
- key: 'MobileHidden'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '营业部',
|
|
|
- key: 'SellerName'
|
|
|
+ key: 'Mobile'
|
|
|
},
|
|
|
{
|
|
|
label: '是否注册',
|
|
@@ -41,12 +39,6 @@ const tableColOpt = computed( ()=>{
|
|
|
label: '是否关注公众号',
|
|
|
key: 'IsSubscribed'
|
|
|
},
|
|
|
- {
|
|
|
- label: '创建时间',
|
|
|
- key: 'CreateTime',
|
|
|
- sort: true,
|
|
|
- headerTips: '系统中新增该用户的时间'
|
|
|
- },
|
|
|
{
|
|
|
label: '最近一次阅读时间',
|
|
|
key: 'ModifyTime',
|
|
@@ -120,33 +112,13 @@ function handleFilterList() {
|
|
|
getUserList()
|
|
|
}
|
|
|
|
|
|
-function handleEditUser(e) {
|
|
|
- const link=router.resolve({
|
|
|
- path: '/customer/userEdit',
|
|
|
- query: {
|
|
|
- id: e.UserId
|
|
|
- }
|
|
|
- }).href
|
|
|
- window.open(link,'__blank')
|
|
|
-}
|
|
|
-
|
|
|
-// 禁用用户
|
|
|
-async function handleDisabledUser(row) {
|
|
|
- const res = await apiCustomerUser.setUserStatus({
|
|
|
- UserId: row.UserId,
|
|
|
- IsEnabled: false
|
|
|
- })
|
|
|
- if (res.Ret !== 200) return
|
|
|
- ElMessage.success('禁用成功')
|
|
|
- getUserList()
|
|
|
-}
|
|
|
|
|
|
-// 启用用户
|
|
|
-const showEnableUserPop = ref(false)
|
|
|
-const enableUserId = ref(0)
|
|
|
-function handleEnableUser(row) {
|
|
|
- enableUserId.value = row.UserId
|
|
|
- showEnableUserPop.value = true
|
|
|
+// 移动用户
|
|
|
+const showMove=ref(false)
|
|
|
+const activeUserId=ref(0)
|
|
|
+function handleMove(e){
|
|
|
+ activeUserId.value=e.UserId
|
|
|
+ showMove.value=true
|
|
|
}
|
|
|
|
|
|
// 删除用户
|
|
@@ -167,42 +139,34 @@ function handleDelUser(row) {
|
|
|
}).catch(() => { })
|
|
|
}
|
|
|
|
|
|
-// 跳转详情
|
|
|
-function handleGoDetail(e){
|
|
|
- let link = ''
|
|
|
- if (radio.value === 2) {
|
|
|
- link = router.resolve({
|
|
|
- path:'/customer/userDetail',
|
|
|
- query:{
|
|
|
- id:e.UserId
|
|
|
- }
|
|
|
- }).href
|
|
|
+const userInfo = ref({})
|
|
|
+const contactTatle = ref('添加联系人')
|
|
|
+const showAddContact = ref(false)
|
|
|
+function handleAddContact(row, type = 'edit') {
|
|
|
+ if (type === 'add') {
|
|
|
+ contactTatle.value = '添加联系人'
|
|
|
} else {
|
|
|
- link = router.resolve({
|
|
|
- path:'/customer/companyDetail',
|
|
|
- query:{
|
|
|
- id:e.UserId
|
|
|
- }
|
|
|
- }).href
|
|
|
+ contactTatle.value = '编辑联系人'
|
|
|
}
|
|
|
-
|
|
|
- window.open(link,'__blank')
|
|
|
+ userInfo.value = { CompanyId: route.query.id, ...row }
|
|
|
+ showAddContact.value = true
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="customer-user-list-page">
|
|
|
+ <el-button type="primary" color="#0052D9" style="width: 120px; margin-top: 10px;" @click="handleAddContact({}, 'add')"
|
|
|
+ >添加联系人</el-button
|
|
|
+ >
|
|
|
<div class="userlist-wrap" style="margin-top: 30px">
|
|
|
<el-table
|
|
|
:data="userList"
|
|
|
border
|
|
|
-
|
|
|
highlight-current-row
|
|
|
element-loading-text="数据加载中..."
|
|
|
v-loading="tableLoading"
|
|
|
@sort-change="handleTableSort"
|
|
|
- @row-click="handleGoDetail"
|
|
|
>
|
|
|
<el-table-column
|
|
|
v-for="column in tableColOpt"
|
|
@@ -253,24 +217,15 @@ function handleGoDetail(e){
|
|
|
v-permission="permissionBtn.customerManageBtn.customer_edit"
|
|
|
type="primary"
|
|
|
link
|
|
|
- @click.stop="handleEditUser(row)"
|
|
|
+ @click.stop="handleAddContact(row, 'edit')"
|
|
|
>编辑</el-button
|
|
|
>
|
|
|
- <el-button
|
|
|
- v-permission="permissionBtn.customerManageBtn.customer_permissionSettings"
|
|
|
- type="danger"
|
|
|
- link
|
|
|
- v-if="row.Status === 2"
|
|
|
- @click.stop="handleDisabledUser(row)"
|
|
|
- >关闭权限</el-button
|
|
|
- >
|
|
|
<el-button
|
|
|
v-permission="permissionBtn.customerManageBtn.customer_permissionSettings"
|
|
|
type="primary"
|
|
|
link
|
|
|
- v-else
|
|
|
- @click.stop="handleEnableUser(row)"
|
|
|
- >开启权限</el-button
|
|
|
+ @click.stop="handleMove(row)"
|
|
|
+ >移动</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
v-permission="permissionBtn.customerManageBtn.customer_delete"
|
|
@@ -293,7 +248,17 @@ function handleGoDetail(e){
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <MoveUser
|
|
|
+ v-model:show="showMove"
|
|
|
+ :userId="activeUserId"
|
|
|
+ @success="getUserList"
|
|
|
+ />
|
|
|
+ <AddContact
|
|
|
+ v-model:show="showAddContact"
|
|
|
+ :data="userInfo"
|
|
|
+ @success="getUserList"
|
|
|
+ :contactTatle="contactTatle"
|
|
|
+ />
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|