|
@@ -42,7 +42,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"
|
|
@@ -56,7 +56,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"
|
|
@@ -70,7 +70,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="客户行业:" >
|
|
|
+ <el-form-item label="客户行业:" prop="industry">
|
|
|
<el-select
|
|
|
ref="sle"
|
|
|
style="width:100%;"
|
|
@@ -91,6 +91,180 @@
|
|
|
</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">
|
|
|
<el-input v-model="form.taxno" placeholder="请输入企业税号" style="width: 100%"></el-input>
|
|
@@ -122,7 +296,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="上级企业:" >
|
|
|
+ <el-form-item label="上级企业:" prop="superiorenterprisename">
|
|
|
<el-popover
|
|
|
placement="bottom"
|
|
|
width="700"
|
|
@@ -179,7 +353,7 @@
|
|
|
</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>
|
|
@@ -204,6 +378,7 @@ export default {
|
|
|
components:{businessMessage,duplicateCheck},
|
|
|
data(){
|
|
|
return {
|
|
|
+ activeName:'first',
|
|
|
drawer:false,
|
|
|
customerShow:false,
|
|
|
checkResults:'',
|
|
@@ -222,15 +397,26 @@ export default {
|
|
|
{ required: true, message: '请选择客户类型', trigger: 'change' }
|
|
|
],
|
|
|
contact: [
|
|
|
- { required: true, message: '请输入法人', trigger: 'change,blur' },
|
|
|
+ { required: false, message: '请输入法人', trigger: 'change,blur' },
|
|
|
],
|
|
|
telephone: [
|
|
|
- { required: true, message: '请输入联系电话', trigger: 'change,blur' },
|
|
|
+ { required: false, message: '请输入联系电话', trigger: 'change,blur' },
|
|
|
{ pattern:/^1[3-9]\d{9}$/, message: '请输入正确手机号码',trigger: 'change' }
|
|
|
],
|
|
|
province: [
|
|
|
{ required: true, message: '请选择省市县', trigger: 'change,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' }
|
|
|
+ ],
|
|
|
},
|
|
|
form:{
|
|
|
"sat_orderclueid": '',
|
|
@@ -252,6 +438,11 @@ export default {
|
|
|
"contact": "", //非必填,可选
|
|
|
"phonenumber": "", //非必填,可选
|
|
|
"customergrade": "", //客户等级
|
|
|
+ "contactsinfo": {
|
|
|
+ "name": "",
|
|
|
+ "telephone": "",
|
|
|
+ "phonenumber": ""
|
|
|
+ },
|
|
|
},
|
|
|
customerParam:{
|
|
|
"id": 20220920083901,
|
|
@@ -280,6 +471,42 @@ export default {
|
|
|
customerClassification:[],
|
|
|
distributor:[]
|
|
|
},
|
|
|
+ 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
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -294,6 +521,7 @@ export default {
|
|
|
this.industryList()
|
|
|
this.typeList()
|
|
|
this.queryCustomerGrade()
|
|
|
+ this.enterpriseContactList()
|
|
|
},
|
|
|
/*查重检查*/
|
|
|
onCheck(){
|
|
@@ -396,7 +624,8 @@ export default {
|
|
|
},
|
|
|
onClose(){
|
|
|
this.$refs['form'].resetFields();
|
|
|
- this.form = {
|
|
|
+ this.isPhone = true
|
|
|
+ /* this.form = {
|
|
|
"sat_orderclueid": '',
|
|
|
"enterprisename_customer":'',
|
|
|
"sa_customersid": 0, //新增是传0
|
|
@@ -416,7 +645,7 @@ export default {
|
|
|
"contact": "", //非必填,可选
|
|
|
"phonenumber": "", //非必填,可选
|
|
|
"customergrade": "", //客户等级
|
|
|
- }
|
|
|
+ }*/
|
|
|
this.drawer = false
|
|
|
this.checkResults = ''
|
|
|
this.value = ''
|
|
@@ -543,6 +772,95 @@ export default {
|
|
|
checkSuccess(val){
|
|
|
this.checkResults = val
|
|
|
},
|
|
|
+ phoneChang(val){
|
|
|
+ if (val === '座机'){
|
|
|
+ this.isPhone = false
|
|
|
+ }else {
|
|
|
+ this.isPhone = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ searchData(){
|
|
|
+ this.changeTab()
|
|
|
+ },
|
|
|
+ changeTab(){
|
|
|
+ this.enterpriseContactList()
|
|
|
+ this.myContactList()
|
|
|
+ },
|
|
|
+ /*企业联系人*/
|
|
|
+ async enterpriseContactList(){
|
|
|
+ console.log(this.enterpriseContact.param,'企业联系人')
|
|
|
+ this.enterpriseContact.param.content.where.condition = this.form.contactsinfo.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(){
|
|
|
+ console.log(this.myContacts.param,'我的联系人')
|
|
|
+ this.myContacts.param.content.where.condition = this.form.contactsinfo.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()
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
|