CRM:【联系人】统一字段

This commit is contained in:
YunaiV 2024-01-03 23:30:29 +08:00
parent d71097ac31
commit 5e265a9094
3 changed files with 92 additions and 99 deletions

View File

@ -8,7 +8,7 @@ export interface ContactVO {
email: string email: string
post: string post: string
customerId: number customerId: number
address: string detailAddress: string
remark: string remark: string
ownerUserId: string ownerUserId: string
lastTime: Date lastTime: Date

View File

@ -49,8 +49,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" <el-col :span="12">
><el-form-item label="性别" prop="sex"> <el-form-item label="性别" prop="sex">
<el-select v-model="formData.sex" placeholder="请选择"> <el-select v-model="formData.sex" placeholder="请选择">
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_USER_SEX)" v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_USER_SEX)"
@ -58,8 +58,9 @@
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-form-item </el-select>
></el-col> </el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -72,8 +73,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="座机" prop="telephone"> <el-form-item label="电话" prop="telephone">
<el-input v-model="formData.telephone" placeholder="请输入座机" style="width: 215px" /> <el-input v-model="formData.telephone" placeholder="请输入电话" style="width: 215px" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -104,10 +105,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="下次联系时间" prop="nextTime"> <el-form-item label="下次联系时间" prop="contactNextTime">
<el-date-picker <el-date-picker
v-model="formData.nextTime" v-model="formData.contactNextTime"
type="date" type="datetime"
value-format="x" value-format="x"
placeholder="选择下次联系时间" placeholder="选择下次联系时间"
/> />
@ -126,15 +127,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="地址" prop="address"> <el-form-item label="地址" prop="detailAddress">
<el-input <el-input
input-style="width:190px;" input-style="width:190px;"
v-model="formData.address" v-model="formData.detailAddress"
placeholder="请输入地址" placeholder="请输入地址"
/> />
</el-form-item> </el-form-item>
</el-col> </el-row </el-col>
><el-row> </el-row>
<!-- TODO @zyna解决下 ide 报错 -->
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="直属上级" prop="parentId"> <el-form-item label="直属上级" prop="parentId">
<el-select v-model="formData.parentId" placeholder="请选择"> <el-select v-model="formData.parentId" placeholder="请选择">
@ -152,10 +155,11 @@
<el-form-item label="职位" prop="post"> <el-form-item label="职位" prop="post">
<el-input input-style="width:190px;" v-model="formData.post" placeholder="请输入职位" /> <el-input input-style="width:190px;" v-model="formData.post" placeholder="请输入职位" />
</el-form-item> </el-form-item>
</el-col> </el-row </el-col>
><el-row> </el-row>
<el-col :span="12" <el-row>
><el-form-item label="是否关键决策人" prop="master" style="width: 400px"> <el-col :span="12">
<el-form-item label="关键决策人" prop="master" style="width: 400px">
<el-radio-group v-model="formData.master"> <el-radio-group v-model="formData.master">
<el-radio <el-radio
v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)" v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
@ -169,8 +173,8 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24" <el-col :span="24">
><el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注" /> <el-input v-model="formData.remark" placeholder="请输入备注" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -192,19 +196,20 @@ import { defaultProps } from '@/utils/tree'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const areaList = ref([]) // const areaList = ref([]) //
const formData = ref({ const formData = ref({
nextTime: undefined, contactNextTime: undefined,
mobile: undefined, mobile: undefined,
telephone: undefined, telephone: undefined,
email: undefined, email: undefined,
customerId: undefined, customerId: undefined,
customerName: undefined, customerName: undefined,
address: undefined, detailAddress: undefined,
remark: undefined, remark: undefined,
ownerUserId: undefined, ownerUserId: undefined,
lastTime: undefined, lastTime: undefined,
@ -279,13 +284,14 @@ const submitForm = async () => {
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
// TODO zynaide
formData.value = { formData.value = {
nextTime: undefined, contactNextTime: undefined,
mobile: undefined, mobile: undefined,
telephone: undefined, telephone: undefined,
email: undefined, email: undefined,
customerId: undefined, customerId: undefined,
address: undefined, detailAddress: undefined,
remark: undefined, remark: undefined,
ownerUserId: undefined, ownerUserId: undefined,
lastTime: undefined, lastTime: undefined,

View File

@ -11,6 +11,7 @@
<el-form-item label="客户" prop="customerId"> <el-form-item label="客户" prop="customerId">
<el-select <el-select
v-model="queryParams.customerId" v-model="queryParams.customerId"
class="!w-240px"
placeholder="请选择客户" placeholder="请选择客户"
value-key="id" value-key="id"
lable-key="name" lable-key="name"
@ -28,56 +29,55 @@
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
class="!w-240px"
placeholder="请输入姓名" placeholder="请输入姓名"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="手机号" prop="mobile"> <el-form-item label="手机号" prop="mobile">
<el-input <el-input
v-model="queryParams.mobile" v-model="queryParams.mobile"
class="!w-240px"
placeholder="请输入手机号" placeholder="请输入手机号"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="座机" prop="telephone"> <el-form-item label="电话" prop="telephone">
<el-input <el-input
v-model="queryParams.telephone" v-model="queryParams.telephone"
class="!w-240px"
placeholder="请输入电话" placeholder="请输入电话"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="QQ" prop="qq"> <el-form-item label="QQ" prop="qq">
<el-input <el-input
v-model="queryParams.qq" v-model="queryParams.qq"
class="!w-240px"
placeholder="请输入QQ" placeholder="请输入QQ"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="微信" prop="wechat"> <el-form-item label="微信" prop="wechat">
<el-input <el-input
v-model="queryParams.wechat" v-model="queryParams.wechat"
class="!w-240px"
placeholder="请输入微信" placeholder="请输入微信"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="电子邮箱" prop="email"> <el-form-item label="电子邮箱" prop="email">
<el-input <el-input
v-model="queryParams.email" v-model="queryParams.email"
class="!w-240px"
placeholder="请输入电子邮箱" placeholder="请输入电子邮箱"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -102,53 +102,57 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="姓名" fixed="left" align="center" prop="name"> <el-table-column label="姓名" fixed="left" align="center" prop="name" width="140">
<template #default="scope"> <template #default="scope">
<el-link type="primary" :underline="false" @click="openDetail(scope.row.id)"> <el-link type="primary" :underline="false" @click="openDetail(scope.row.id)">
{{ scope.row.name }} {{ scope.row.name }}
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户" fixed="left" align="center" prop="customerName" /> <el-table-column label="客户名称" fixed="left" align="center" prop="customerName" width="120">
<template #default="scope">
<el-link
type="primary"
:underline="false"
@click="openCustomerDetail(scope.row.customerId)"
>
{{ scope.row.customerName }}
</el-link>
</template>
</el-table-column>
<el-table-column label="手机" align="center" prop="mobile" width="120" />
<el-table-column label="电话" align="center" prop="telephone" width="120" />
<el-table-column label="邮箱" align="center" prop="email" width="120" />
<el-table-column label="职位" align="center" prop="post" width="120" />
<el-table-column label="地址" align="center" prop="detailAddress" width="120" />
<el-table-column
:formatter="dateFormatter"
align="center"
label="下次联系时间"
prop="contactNextTime"
width="180px"
/>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="关键决策人" align="center" prop="master" width="100">
<template #default="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.master" />
</template>
</el-table-column>
<el-table-column label="直属上级" align="center" prop="parentName" width="140" />
<el-table-column
label="最后跟进时间"
align="center"
prop="contactLastTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="性别" align="center" prop="sex"> <el-table-column label="性别" align="center" prop="sex">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.sex" /> <dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.sex" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="职位" align="center" prop="post" /> <el-table-column label="负责人" align="center" prop="ownerUserName" width="120" />
<el-table-column label="是否关键决策人" align="center" prop="master"> <el-table-column label="创建人" align="center" prop="creatorName" width="120" />
<template #default="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.master" />
</template>
</el-table-column>
<el-table-column label="直属上级" align="center" prop="parentName" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="座机" align="center" prop="telephone" />
<el-table-column label="QQ" align="center" prop="qq" />
<el-table-column label="微信" align="center" prop="wechat" />
<el-table-column label="邮箱" align="center" prop="email" />
<el-table-column label="地址" align="center" prop="address" />
<el-table-column
label="下次联系时间"
align="center"
prop="nextTime"
width="180px"
:formatter="dateFormatter"
/>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column
label="最后跟进时间"
align="center"
prop="lastTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="负责人" align="center" prop="ownerUserId">
<template #default="scope">
{{ scope.row.ownerUserName }}
</template>
</el-table-column>
<!-- <el-table-column label="所属部门" align="center" prop="ownerUserId" /> -->
<el-table-column <el-table-column
label="更新时间" label="更新时间"
align="center" align="center"
@ -163,21 +167,10 @@
:formatter="dateFormatter" :formatter="dateFormatter"
width="180px" width="180px"
/> />
<!-- <el-table-column
label="创建人"
align="center"
prop="creator"
:formatter="dateFormatter"
width="180px"
>
<template #default="scope">
{{ userList.find((user) => user.id === scope.row.creator)?.nickname }}
</template>
</el-table-column> -->
<el-table-column label="操作" align="center" fixed="right" width="200"> <el-table-column label="操作" align="center" fixed="right" width="200">
<template #default="scope"> <template #default="scope">
<el-button <el-button
plain link
type="primary" type="primary"
@click="openForm('update', scope.row.id)" @click="openForm('update', scope.row.id)"
v-hasPermi="['crm:contact:update']" v-hasPermi="['crm:contact:update']"
@ -185,7 +178,7 @@
编辑 编辑
</el-button> </el-button>
<el-button <el-button
plain link
type="danger" type="danger"
@click="handleDelete(scope.row.id)" @click="handleDelete(scope.row.id)"
v-hasPermi="['crm:contact:delete']" v-hasPermi="['crm:contact:delete']"
@ -228,23 +221,13 @@ const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
nextTime: [], mobile: undefined,
mobile: null, telephone: undefined,
telephone: null, email: undefined,
email: null, customerId: undefined,
customerId: null, name: undefined,
address: null, qq: undefined,
remark: null, wechat: undefined
ownerUserId: null,
createTime: [],
lastTime: [],
parentId: null,
name: null,
post: null,
qq: null,
wechat: null,
sex: null,
policyMakers: null
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
@ -307,11 +290,15 @@ const handleExport = async () => {
} }
} }
/** 打开客户详情 */ /** 打开联系人详情 */
const { push } = useRouter() const { push } = useRouter()
const openDetail = (id: number) => { const openDetail = (id: number) => {
push({ name: 'CrmContactDetail', params: { id } }) push({ name: 'CrmContactDetail', params: { id } })
} }
/** 打开客户详情 */
const openCustomerDetail = (id: number) => {
push({ name: 'CrmCustomerDetail', params: { id } })
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {