|
|
@@ -2,7 +2,7 @@
|
|
|
<div>
|
|
|
<el-button size="small" type="primary" @click="onshow">新 建</el-button>
|
|
|
<el-drawer
|
|
|
- title=" 新建联系人"
|
|
|
+ title="新建联系人"
|
|
|
:visible.sync="dialogFormVisible"
|
|
|
size="600px"
|
|
|
direction="rtl"
|
|
|
@@ -16,37 +16,151 @@
|
|
|
<el-form-item label="姓名:" prop="name">
|
|
|
<el-popover
|
|
|
placement="bottom-start"
|
|
|
- width="700"
|
|
|
+ width="900"
|
|
|
+ v-model="enterpriseContact.show"
|
|
|
trigger="click">
|
|
|
- <el-tabs type="border-card">
|
|
|
+ <el-tabs type="border-card" @tab-click="changeTab">
|
|
|
<el-tab-pane label="企业联系人">
|
|
|
- <el-table :data="businessData" @row-click="businessSelect" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
|
|
|
- <el-table-column width="260" label="客户名称">
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ :data="enterpriseContact.listData"
|
|
|
+ @row-click="enterpriseContactSelect"
|
|
|
+ :header-cell-style="{background:'#EEEEEE',color:'#333'}"
|
|
|
+ size="mini">
|
|
|
+ <el-table-column width="80" label="姓名">
|
|
|
<template slot-scope="scope">
|
|
|
- <span style="margin-left: 10px">{{ scope.row.companyName?scope.row.companyName:'--' }}</span>
|
|
|
+ <span >{{ scope.row.name?scope.row.name:'--' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="客户地址">
|
|
|
+ <el-table-column width="120" label="手机号">
|
|
|
<template slot-scope="scope">
|
|
|
- <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
|
|
|
+ <span >{{ scope.row.phonenumber?scope.row.phonenumber:'--' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="200" label="客户税号">
|
|
|
+ <el-table-column width="200" label="邮箱">
|
|
|
<template slot-scope="scope">
|
|
|
- <span style="margin-left: 10px">{{ scope.row.taxNum?scope.row.taxNum:'--' }}</span>
|
|
|
+ <span >{{ scope.row.email?scope.row.email:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="120" label="部门">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.position?scope.row.position:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="120" label="职位">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.depname?scope.row.depname:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="80" label="性别">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.sex?scope.row.sex:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="120" label="生日">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.birthday?scope.row.birthday:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="300" label="家庭住址">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.address?scope.row.address:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="200" label="备注">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.remarks?scope.row.remarks:'--' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <div style="display:flex;align-items:center;flex-direction:row-reverse;justify-content:space-between">
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @size-change="handleSizeChangeEnterprise"
|
|
|
+ @current-change="handleCurrentChangeEnterprise"
|
|
|
+ :current-page="enterpriseContact.currentPage"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="enterpriseContact.total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <slot name="footerLeft"></slot>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="我的联系人" >
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ :data="myContacts.listData"
|
|
|
+ @row-click="myContactSelect"
|
|
|
+ :header-cell-style="{background:'#EEEEEE',color:'#333'}"
|
|
|
+ size="mini">
|
|
|
+ <el-table-column width="80" label="姓名">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.name?scope.row.name:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="120" label="手机号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.phonenumber?scope.row.phonenumber:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="200" label="邮箱">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.email?scope.row.email:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="120" label="部门">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.position?scope.row.position:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column><el-table-column width="120" label="职位">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.depname?scope.row.depname:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column><el-table-column width="80" label="性别">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.sex?scope.row.sex:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column><el-table-column width="120" label="生日">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.birthday?scope.row.birthday:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="300" label="家庭住址">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.address?scope.row.address:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="200" label="备注">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.remarks?scope.row.remarks:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div style="display:flex;align-items:center;flex-direction:row-reverse;justify-content:space-between">
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @size-change="handleSizeChangeMy"
|
|
|
+ @current-change="handleCurrentChangeMy"
|
|
|
+ :current-page="myContacts.currentPage"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="myContacts.total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <slot name="footerLeft"></slot>
|
|
|
+ </div>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="我的联系人">我的联系人</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
- <el-input slot="reference" autosize v-model="form.name" placeholder="请输入姓名"></el-input>
|
|
|
+ <el-input slot="reference" autosize v-model="form.name" placeholder="请输入姓名" @input="searchData"></el-input>
|
|
|
</el-popover>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="手机号:" prop="phonenumber">
|
|
|
- <el-input autosize v-model="form.phonenumber" placeholder="请输入手机号码"></el-input>
|
|
|
+ <el-input autosize v-model="form.phonenumber" placeholder="请输入手机号码"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -149,11 +263,12 @@ export default {
|
|
|
county: "",
|
|
|
workaddress: 0,
|
|
|
isdefault: 1,
|
|
|
- isprimary: 1
|
|
|
+ isprimary: 1,
|
|
|
+ sys_phonebookid:''
|
|
|
},
|
|
|
rules:{
|
|
|
name: [
|
|
|
- { required: true, message: '姓名不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: '姓名不能为空', trigger: 'blur,change' },
|
|
|
],
|
|
|
phonenumber: [
|
|
|
{ required: true, validator: validateMobilePhone, trigger: 'blur' },
|
|
|
@@ -161,18 +276,44 @@ export default {
|
|
|
},
|
|
|
enterpriseContact:{
|
|
|
param:{
|
|
|
-
|
|
|
+ "content": {
|
|
|
+ "sys_enterpriseid": '',
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 10,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "id": 20221219193002,
|
|
|
+ },
|
|
|
+ listData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ show:false
|
|
|
+ },
|
|
|
+ myContacts:{
|
|
|
+ param:{
|
|
|
+ "id": 20221219161202,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
- list:[],
|
|
|
+ listData:[],
|
|
|
total:0,
|
|
|
currentPage:0,
|
|
|
+ show:false
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
onshow(){
|
|
|
this.dialogFormVisible = true
|
|
|
-
|
|
|
+ this.enterpriseContactList()
|
|
|
+ this.myContactList()
|
|
|
this.form.sys_enterpriseid = this.data.sys_enterpriseid
|
|
|
this.form.enterprisename = this.data.enterprisename
|
|
|
},
|
|
|
@@ -187,54 +328,90 @@ export default {
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
this.$emit("insertSuccess")
|
|
|
this.$refs['form'].resetFields()
|
|
|
- this.form = {
|
|
|
- contactsid: 0,
|
|
|
- sys_enterpriseid: "",
|
|
|
- name: "",
|
|
|
- sex: "",
|
|
|
- depname: "",
|
|
|
- position: "",
|
|
|
- birthday: "",
|
|
|
- phonenumber: "",
|
|
|
- email: "",
|
|
|
- address: "",
|
|
|
- remarks: "",
|
|
|
- enterprisename:'',
|
|
|
- province: "",
|
|
|
- city: "",
|
|
|
- county: "",
|
|
|
- workaddress: 0,
|
|
|
- isdefault: 1,
|
|
|
- isprimary: 1
|
|
|
- }
|
|
|
+ this.form = {}
|
|
|
this.dialogFormVisible = false
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ searchData(){
|
|
|
+ this.changeTab()
|
|
|
+ },
|
|
|
+ changeTab(){
|
|
|
+ this.enterpriseContactList()
|
|
|
+ this.myContactList()
|
|
|
+ },
|
|
|
+ /*企业联系人*/
|
|
|
+ async enterpriseContactList(){
|
|
|
+ this.enterpriseContact.param.content.where.condition = this.form.name
|
|
|
+ this.enterpriseContact.param.content.sys_enterpriseid = this.data.sys_enterpriseid
|
|
|
+ const res = await this.$api.requested(this.enterpriseContact.param)
|
|
|
+ this.enterpriseContact.listData = res.data
|
|
|
+ this.enterpriseContact.total = res.total
|
|
|
+ this.enterpriseContact.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ /*选择企业联系人*/
|
|
|
+ enterpriseContactSelect(val){
|
|
|
+ this.form.name = val.name
|
|
|
+ this.form.phonenumber = val.phonenumber
|
|
|
+ this.form.email = val.email
|
|
|
+ this.form.position = val.position
|
|
|
+ this.form.depname = val.depname
|
|
|
+ this.form.sex = val.sex
|
|
|
+ this.form.birthday = val.birthday
|
|
|
+ this.form.address = val.address
|
|
|
+ this.form.remarks = val.remarks
|
|
|
+ this.enterpriseContact.show = false
|
|
|
+ },
|
|
|
+ handleSizeChangeEnterprise(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.enterpriseContact.param.content.pageSize = val
|
|
|
+ this.enterpriseContactList()
|
|
|
+ },
|
|
|
+ handleCurrentChangeEnterprise(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.enterpriseContact.param.content.pageNumber = val
|
|
|
+ this.enterpriseContactList()
|
|
|
+ },
|
|
|
+ /*我的联系人*/
|
|
|
+ async myContactList(){
|
|
|
+ this.myContacts.param.content.where.condition = this.form.name
|
|
|
+ this.myContacts.param.content.sys_enterpriseid = this.data.sys_enterpriseid
|
|
|
+ const res = await this.$api.requested(this.myContacts.param)
|
|
|
+ console.log(res,"我的联系人")
|
|
|
+ this.myContacts.listData = res.data
|
|
|
+ this.myContacts.total = res.total
|
|
|
+ this.myContacts.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ /*选择我的联系人*/
|
|
|
+ myContactSelect(val){
|
|
|
+ console.log(val,"选择的联系人")
|
|
|
+ this.form.name = val.name
|
|
|
+ this.form.phonenumber = val.phonenumber
|
|
|
+ this.form.email = val.email
|
|
|
+ this.form.position = val.position
|
|
|
+ this.form.depname = val.depname
|
|
|
+ this.form.sex = val.sex
|
|
|
+ this.form.birthday = val.birthday
|
|
|
+ this.form.address = val.address
|
|
|
+ this.form.remarks = val.remarks
|
|
|
+ this.form.sys_phonebookid = val.sys_phonebookid
|
|
|
+ this.enterpriseContact.show = false
|
|
|
+ },
|
|
|
+ handleSizeChangeMy(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.enterpriseContact.param.content.pageSize = val
|
|
|
+ this.enterpriseContactList()
|
|
|
+ },
|
|
|
+ handleCurrentChangeMy(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.enterpriseContact.param.content.pageNumber = val
|
|
|
+ this.enterpriseContactList()
|
|
|
+ },
|
|
|
onClose(){
|
|
|
this.$refs['form'].resetFields()
|
|
|
- this.form = {
|
|
|
- contactsid: 0,
|
|
|
- sys_enterpriseid: "",
|
|
|
- name: "",
|
|
|
- sex: "",
|
|
|
- depname: "",
|
|
|
- position: "",
|
|
|
- birthday: "",
|
|
|
- phonenumber: "",
|
|
|
- email: "",
|
|
|
- address: "",
|
|
|
- remarks: "",
|
|
|
- enterprisename:'',
|
|
|
- province: "",
|
|
|
- city: "",
|
|
|
- county: "",
|
|
|
- workaddress: 0,
|
|
|
- isdefault: 1,
|
|
|
- isprimary: 1
|
|
|
- }
|
|
|
+ this.form = {}
|
|
|
this.dialogFormVisible = false
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|