|
|
|
@ -38,7 +38,7 @@
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="designation">
|
|
|
|
|
<span>▋</span>
|
|
|
|
|
{{ `title.label` }}
|
|
|
|
|
{{ titleLable }}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -101,92 +101,67 @@
|
|
|
|
|
<!-- 表格 -->
|
|
|
|
|
<el-table stripe :border="true" style="width: 1500px;height: 100%;;margin-top:20px;" v-loading="loading" :data="list" >
|
|
|
|
|
<el-table-column fixed="left" type="selection" />
|
|
|
|
|
<el-table-column fixed="left" sortable label="客户名称" width="200" key="id" prop="id" >
|
|
|
|
|
<template #default>
|
|
|
|
|
<div style="color:rgb(64,158,255)">
|
|
|
|
|
<p style="height:5px;">客户名称</p>
|
|
|
|
|
<span style="font-size:12px;">1111000000000</span>
|
|
|
|
|
<el-table-column fixed="left" label="客户名称" width="200" :show-overflow-tooltip="true" >
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<div style="color:rgb(64,158,255)">
|
|
|
|
|
<p style="height:5px;">{{scope.row.name}}</p>
|
|
|
|
|
<span style="font-size:12px;">{{scope.row.code}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="客户分类" prop="calssify" width="120px">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.CUSTOMER_CALSSIFY" :value="scope.row.calssify" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="客户分类"
|
|
|
|
|
sortable
|
|
|
|
|
prop="username"
|
|
|
|
|
width="110"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<p>一级</p>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table-column label="客户类型" prop="customType" width="120px">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.CUSTOM_TYPE" :value="scope.row.customType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="客户类型"
|
|
|
|
|
sortable
|
|
|
|
|
width="120"
|
|
|
|
|
prop="nickname"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
> <p>vip大客户</p>
|
|
|
|
|
<el-table-column label="资金款项" prop="fundsType" width="120px">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.FUNDS_TYPE" :value="scope.row.fundsType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="资金款项"
|
|
|
|
|
sortable
|
|
|
|
|
key="deptName"
|
|
|
|
|
prop="dept.name"
|
|
|
|
|
width="120"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="账号状态" sortable width="110" key="status">
|
|
|
|
|
<div>
|
|
|
|
|
<p style="height:5px;">联营</p>
|
|
|
|
|
<span style="font-size:12px; color:#999;">业绩返点</span>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table-column label="合作模式" prop="cooperateType" width="120px">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.COOPERATE_TYPE" :value="scope.row.cooperateType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="隶属机构/业务线" sortable width="160" key="status">
|
|
|
|
|
<div>
|
|
|
|
|
<p style="height:5px;">济钢城市矿产</p>
|
|
|
|
|
<span style="font-size:12px; color:#999;">废钢</span>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<div style="color:rgb(64,158,255)">
|
|
|
|
|
<p style="height:5px;">{{scope.row.companyName}}</p>
|
|
|
|
|
<span style="font-size:12px;">{{scope.row.businessName}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="状态" width="100" sortable key="status">
|
|
|
|
|
<el-table-column label="客户状态" prop="customerStatus" width="120px">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-switch
|
|
|
|
|
v-model="scope.row.status"
|
|
|
|
|
:active-value="0"
|
|
|
|
|
:inactive-value="1"
|
|
|
|
|
@change="handleStatusChange(scope.row)"
|
|
|
|
|
/>
|
|
|
|
|
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.customerStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="客户分级" width="120" sortable key="status">
|
|
|
|
|
<el-table-column label="客户星级" prop="customerStarrating" width="150px">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-switch
|
|
|
|
|
v-model="scope.row.status"
|
|
|
|
|
:active-value="0"
|
|
|
|
|
:inactive-value="1"
|
|
|
|
|
@change="handleStatusChange(scope.row)"
|
|
|
|
|
/>
|
|
|
|
|
<el-rate v-model="scope.row.customerStarrating" :disabled="true" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="归属人员" sortable prop="mobile" width="110" >
|
|
|
|
|
<p>狂徒张三</p>
|
|
|
|
|
<el-table-column label="归属人员" sortable prop="nickname" width="110" >
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column label="新增时间" sortable prop="mobile" width="150" >
|
|
|
|
|
<div>
|
|
|
|
|
<p style="height:5px;">康宁</p>
|
|
|
|
|
<span style="font-size:12px; color:#999;">2023-09-09 23:26:08</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="更新时间" sortable prop="mobile" width="150" >
|
|
|
|
|
<div>
|
|
|
|
|
<p style="height:5px;">康宁</p>
|
|
|
|
|
<span style="font-size:12px; color:#999;">2023-09-09 23:26:08</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="添加时间" sortable prop="mobile" width="150">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<p style="height:5px;">{{scope.row.creator}}</p>
|
|
|
|
|
<span style="font-size:12px;">{{scope.row.createTime}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="更新时间" sortable prop="mobile" width="150">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<p style="height:5px;">{{scope.row.updater}}</p>
|
|
|
|
|
<span style="font-size:12px;">{{scope.row.updateTime}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column fixed="right" label="操作" align="center" width="100">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button
|
|
|
|
@ -232,15 +207,19 @@ import {Filter } from '@element-plus/icons-vue'
|
|
|
|
|
import { ElTree } from 'element-plus'
|
|
|
|
|
import * as DeptApi from '@/api/system/dept'
|
|
|
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
|
|
|
import * as EnterpriseApi from '@/api/system/enterprise'
|
|
|
|
|
import * as SubjectBasicApi from '@/api/xxjj/subjectBasic'
|
|
|
|
|
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
|
|
|
|
|
// defineOptions({ name: 'SystemUserDeptTree' })
|
|
|
|
|
|
|
|
|
|
const deptName = ref('')
|
|
|
|
|
const deptList = ref<Tree[]>([]) // 树形结构
|
|
|
|
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
|
|
|
|
let titleLable = ref('')//标题
|
|
|
|
|
|
|
|
|
|
/** 获得部门树 */
|
|
|
|
|
const getTree = async () => {
|
|
|
|
|
const res = await DeptApi.getSimpleDeptList()
|
|
|
|
|
const res = await EnterpriseApi.getEnterpriseBusinessSimple()
|
|
|
|
|
deptList.value = []
|
|
|
|
|
deptList.value.push(...handleTree(res))
|
|
|
|
|
}
|
|
|
|
@ -303,6 +282,7 @@ const list = ref([]) // 列表的数
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
id: undefined,
|
|
|
|
|
username: undefined,
|
|
|
|
|
mobile: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
@ -316,7 +296,20 @@ const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const data = await UserApi.getUserPage(queryParams)
|
|
|
|
|
queryParams.businessType = '1'
|
|
|
|
|
const data = await SubjectBasicApi.getEnterperiseCustom(queryParams)
|
|
|
|
|
list.value = data.list
|
|
|
|
|
total.value = data.total
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getListByBusiness = async () => {
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
queryParams.businessType = '0'
|
|
|
|
|
const data = await SubjectBasicApi.getBusinessCustom(queryParams)
|
|
|
|
|
list.value = data.list
|
|
|
|
|
total.value = data.total
|
|
|
|
|
} finally {
|
|
|
|
@ -338,8 +331,16 @@ const resetQuery = () => {
|
|
|
|
|
|
|
|
|
|
/** 处理部门被点击 */
|
|
|
|
|
const handleDeptNodeClick = async (row) => {
|
|
|
|
|
queryParams.deptId = row.id
|
|
|
|
|
await getList()
|
|
|
|
|
titleLable = row.name
|
|
|
|
|
if(row.id.substring(0,1) == 'A'){
|
|
|
|
|
const id = row.id.slice(2)
|
|
|
|
|
queryParams.id = parseInt(id)
|
|
|
|
|
await getList()
|
|
|
|
|
}else if(row.id.substring(0,1) == 'B'){
|
|
|
|
|
const id = row.id.slice(2)
|
|
|
|
|
queryParams.id = parseInt(id)
|
|
|
|
|
await getListByBusiness()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */
|
|
|
|
@ -355,21 +356,21 @@ const handleImport = () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 修改用户状态 */
|
|
|
|
|
const handleStatusChange = async (row: UserApi.UserVO) => {
|
|
|
|
|
try {
|
|
|
|
|
// 修改状态的二次确认
|
|
|
|
|
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
|
|
|
|
await message.confirm('确认要"' + text + '""' + row.username + '"用户吗?')
|
|
|
|
|
// 发起修改状态
|
|
|
|
|
await UserApi.updateUserStatus(row.id, row.status)
|
|
|
|
|
// 刷新列表
|
|
|
|
|
await getList()
|
|
|
|
|
} catch {
|
|
|
|
|
// 取消后,进行恢复按钮
|
|
|
|
|
row.status =
|
|
|
|
|
row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// const handleStatusChange = async (row: UserApi.UserVO) => {
|
|
|
|
|
// try {
|
|
|
|
|
// // 修改状态的二次确认
|
|
|
|
|
// const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
|
|
|
|
// await message.confirm('确认要"' + text + '""' + row.username + '"用户吗?')
|
|
|
|
|
// // 发起修改状态
|
|
|
|
|
// await UserApi.updateUserStatus(row.id, row.status)
|
|
|
|
|
// // 刷新列表
|
|
|
|
|
// await getList()
|
|
|
|
|
// } catch {
|
|
|
|
|
// // 取消后,进行恢复按钮
|
|
|
|
|
// row.status =
|
|
|
|
|
// row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
const exportLoading = ref(false)
|
|
|
|
|