|
|
@@ -80,7 +80,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="客户等级:" >
|
|
|
+ <el-form-item label="客户等级:" prop="grade">
|
|
|
<el-select v-model="form.grade" placeholder="请选择客户等级" style="width: 100%">
|
|
|
<el-option
|
|
|
v-for="item in options.customerGrade"
|
|
|
@@ -94,7 +94,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="客户分类:" >
|
|
|
+ <el-form-item label="客户分类:" prop="customergrade">
|
|
|
<el-select v-model="form.customergrade" placeholder="请选择客户分类" style="width: 100%">
|
|
|
<el-option
|
|
|
v-for="item in options.customerClassification"
|
|
|
@@ -121,7 +121,7 @@
|
|
|
</el-col>-->
|
|
|
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="客户行业:" >
|
|
|
+ <el-form-item label="客户行业:" prop="industry">
|
|
|
<el-select
|
|
|
ref="sle"
|
|
|
style="width:100%;"
|
|
|
@@ -142,6 +142,179 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="联系人:" prop="contactsinfo.name">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom-start"
|
|
|
+ width="900"
|
|
|
+ v-model="enterpriseContact.show"
|
|
|
+ trigger="click">
|
|
|
+ <el-tabs type="border-card" @tab-click="changeTab" v-model="activeName">
|
|
|
+ <el-tab-pane label="企业联系人" name="first" >
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ height="500px"
|
|
|
+ :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 >{{ 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="handleSizeChangeEnterprise"
|
|
|
+ @current-change="handleCurrentChangeEnterprise"
|
|
|
+ :current-page="enterpriseContact.currentPage"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ :page-size="20"
|
|
|
+ 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="我的联系人" name="second">
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ :data="myContacts.listData"
|
|
|
+ height="500px"
|
|
|
+ @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]"
|
|
|
+ :page-size="20"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="myContacts.total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <slot name="footerLeft"></slot>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-input slot="reference" autosize v-model="form.contactsinfo.name" placeholder="请输入联系人姓名" @input="searchData"></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="24" v-if="isPhone">
|
|
|
+ <el-form-item label="联系方式:" prop="contactsinfo.phonenumber">
|
|
|
+ <el-button-group>
|
|
|
+<!-- <el-button type="primary" size="mini" @click="phoneChang('手机')">手机号</el-button>
|
|
|
+ <el-button type="" size="mini" @click="phoneChang('座机')">座机电话</el-button>-->
|
|
|
+ <el-radio v-model="isPhone" :label="true" @change="phoneChang('手机')">手机号</el-radio>
|
|
|
+ <el-radio v-model="isPhone" :label="false" @change="phoneChang('座机')">座机电话</el-radio>
|
|
|
+ </el-button-group>
|
|
|
+ <el-input v-model="form.contactsinfo.phonenumber" placeholder="请输入手机号" style="width: 100%;margin-top: 10px" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="!isPhone">
|
|
|
+ <el-form-item label="联系方式:" prop="contactsinfo.telephone">
|
|
|
+ <el-button-group>
|
|
|
+<!-- <el-button type="" size="mini" @click="phoneChang('手机')">手机号</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="phoneChang('座机')">座机电话</el-button>-->
|
|
|
+ <el-radio v-model="isPhone" :label="true" @change="phoneChang('手机')">手机号</el-radio>
|
|
|
+ <el-radio v-model="isPhone" :label="false" @change="phoneChang('座机')">座机电话</el-radio>
|
|
|
+ </el-button-group>
|
|
|
+ <el-input v-model="form.contactsinfo.telephone" placeholder="请输入座机电话" style="width: 100%;margin-top: 10px" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="税号:" prop="taxno">
|
|
|
@@ -175,7 +348,7 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="上级企业:" >
|
|
|
+ <el-form-item label="上级企业:" prop="superiorenterprisename">
|
|
|
<el-popover
|
|
|
placement="bottom"
|
|
|
width="700"
|
|
|
@@ -232,12 +405,12 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="客户来源:" >
|
|
|
+ <el-form-item label="客户来源:" prop="source">
|
|
|
<el-input v-model="form.source" placeholder="请输入客户来源" style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="归属经销商:" >
|
|
|
+ <el-form-item label="归属经销商:" prop="sa_agentsid">
|
|
|
<el-select v-model="form.sa_agentsid" placeholder="请选择经销商" style="width: 100%">
|
|
|
<el-option
|
|
|
v-for="item in options.distributor"
|
|
|
@@ -279,6 +452,7 @@ export default {
|
|
|
components:{enterprise,duplicateCheck},
|
|
|
data(){
|
|
|
return {
|
|
|
+ activeName:'first',
|
|
|
dialogFormVisible:false,
|
|
|
visibleEnterprise:false,
|
|
|
customerShow:false,
|
|
|
@@ -293,6 +467,7 @@ export default {
|
|
|
"keyword":''
|
|
|
},
|
|
|
},
|
|
|
+
|
|
|
businessShow:false,
|
|
|
total:0,
|
|
|
currentPage:0,
|
|
|
@@ -317,7 +492,12 @@ export default {
|
|
|
ispublic:0,//1:公海客户,0:私域客户,自己新建的
|
|
|
telephone: "",
|
|
|
sa_agentsid: "",
|
|
|
- erpagentnum:""
|
|
|
+ erpagentnum:"",
|
|
|
+ contactsinfo: {
|
|
|
+ name: "",
|
|
|
+ telephone: "",
|
|
|
+ phonenumber: ""
|
|
|
+ },
|
|
|
},
|
|
|
value:'',
|
|
|
options:{
|
|
|
@@ -337,15 +517,26 @@ export default {
|
|
|
{ required: true, message: '还未选择客户类型', trigger: 'change' },
|
|
|
],
|
|
|
contact: [
|
|
|
- { required: true, message: '请输入法人', trigger: 'change' },
|
|
|
+ { required: false, message: '请输入法人', trigger: 'change' },
|
|
|
],
|
|
|
telephone: [
|
|
|
- { required: true, message: '请输入联系电话', trigger: 'change' },
|
|
|
+ { required: false, message: '请输入联系电话', trigger: 'change' },
|
|
|
{ pattern:/^1[3-9]\d{9}$/, message: '请输入正确手机号码',trigger: 'change' }
|
|
|
],
|
|
|
province: [
|
|
|
{ required: true, message: '请选择省市县', trigger: 'blur' },
|
|
|
],
|
|
|
+ 'contactsinfo.name':[
|
|
|
+ { required: true, message: '请输入联系人姓名', trigger: 'change,blur' }
|
|
|
+ ],
|
|
|
+ 'contactsinfo.phonenumber': [
|
|
|
+ { required: true, message: '请输入联系电话', trigger: 'change' },
|
|
|
+ { pattern:/^1[3-9]\d{9}$/, message: '请输入正确手机号码',trigger: 'change' }
|
|
|
+ ],
|
|
|
+ 'contactsinfo.telephone': [
|
|
|
+ { required: true, message: '请输入座机电话', trigger: 'change' },
|
|
|
+ { pattern:/^0\d{2,3}-\d{7,8}$/, message: '请输入正确座机电话',trigger: 'change' }
|
|
|
+ ],
|
|
|
},
|
|
|
customerParam:{
|
|
|
"id": 20220920083901,
|
|
|
@@ -364,6 +555,42 @@ export default {
|
|
|
total:0,
|
|
|
currentPage:0,
|
|
|
},
|
|
|
+ isPhone:true,
|
|
|
+ enterpriseContact:{
|
|
|
+ param:{
|
|
|
+ "content": {
|
|
|
+ "sys_enterpriseid": '',
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "id": 20221219193002,
|
|
|
+ },
|
|
|
+ listData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ show:false
|
|
|
+ },
|
|
|
+ myContacts:{
|
|
|
+ param:{
|
|
|
+ "id": 20221219161202,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "ownertable":'sa_customers',
|
|
|
+ "ownerid":'',
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ listData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ show:false
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
@@ -381,6 +608,7 @@ export default {
|
|
|
this.industryList()
|
|
|
this.queryCustomerGrade()
|
|
|
this.queryDistributor()
|
|
|
+ this.enterpriseContactList()
|
|
|
},
|
|
|
/*工商查询*/
|
|
|
async businessSearch(){
|
|
|
@@ -467,7 +695,7 @@ export default {
|
|
|
},
|
|
|
onClose () {
|
|
|
this.$refs['form'].resetFields();
|
|
|
- this.form = {
|
|
|
+ /* this.form = {
|
|
|
sa_customersid:0,
|
|
|
sys_enterpriseid:0,
|
|
|
enterprisename:'',
|
|
|
@@ -485,7 +713,7 @@ export default {
|
|
|
county:'',
|
|
|
address:'',
|
|
|
ispublic:0
|
|
|
- }
|
|
|
+ }*/
|
|
|
this.dialogFormVisible = false
|
|
|
this.checkResults = ''
|
|
|
this.value = ''
|
|
|
@@ -640,7 +868,94 @@ export default {
|
|
|
})
|
|
|
this.options.distributor = res.data
|
|
|
console.log(this.options.distributor,'经销商')
|
|
|
- }
|
|
|
+ },
|
|
|
+ phoneChang(val){
|
|
|
+ if (val === '座机'){
|
|
|
+ this.isPhone = false
|
|
|
+ }else {
|
|
|
+ this.isPhone = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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 = 0
|
|
|
+ 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.contactsinfo.name = val.name
|
|
|
+ if (val.phonenumber.indexOf('-') != '-1'){
|
|
|
+ this.isPhone = false
|
|
|
+ let areaCode = val.phonenumber.substring(0,val.phonenumber.indexOf('-'))
|
|
|
+ let telephone = val.phonenumber.substring(areaCode.length+1)
|
|
|
+ this.form.contactsinfo.telephone = areaCode + '-' + telephone
|
|
|
+ this.form.contactsinfo.phonenumber = ''
|
|
|
+ }else {
|
|
|
+ this.isPhone = true
|
|
|
+ this.form.contactsinfo.phonenumber = val.phonenumber
|
|
|
+ this.form.contactsinfo.telephone = ''
|
|
|
+ }
|
|
|
+ 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 = 0
|
|
|
+ this.myContacts.param.content.ownerid = 0
|
|
|
+ const res = await this.$api.requested(this.myContacts.param)
|
|
|
+
|
|
|
+ this.myContacts.listData = res.data
|
|
|
+ this.myContacts.total = res.total
|
|
|
+ this.myContacts.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ /*选择我的联系人*/
|
|
|
+ myContactSelect(val){
|
|
|
+
|
|
|
+ this.form.contactsinfo.name = val.name
|
|
|
+ if (val.phonenumber.indexOf('-') != '-1'){
|
|
|
+ this.isPhone = false
|
|
|
+ let areaCode = val.phonenumber.substring(0,val.phonenumber.indexOf('-'))
|
|
|
+ let telephone = val.phonenumber.substring(areaCode.length+1)
|
|
|
+ this.form.contactsinfo.telephone = areaCode + '-' + telephone
|
|
|
+ this.form.contactsinfo.phonenumber = ''
|
|
|
+ }else {
|
|
|
+ this.isPhone = true
|
|
|
+ this.form.contactsinfo.phonenumber = val.phonenumber
|
|
|
+ this.form.contactsinfo.telephone = ''
|
|
|
+ }
|
|
|
+ this.enterpriseContact.show = false
|
|
|
+ },
|
|
|
+ handleSizeChangeMy(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.myContacts.param.content.pageSize = val
|
|
|
+ this.myContactList()
|
|
|
+ },
|
|
|
+ handleCurrentChangeMy(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.myContacts.param.content.pageNumber = val
|
|
|
+ this.myContactList()
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|