|
|
@@ -0,0 +1,630 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-button size="small" type="primary" @click="onshow">新 建</el-button>
|
|
|
+ <el-drawer
|
|
|
+ title="新建联系人"
|
|
|
+ :visible.sync="dialogFormVisible"
|
|
|
+ size="600px"
|
|
|
+ direction="rtl"
|
|
|
+ :show-close="false"
|
|
|
+ append-to-body
|
|
|
+ @close="onClose">
|
|
|
+ <div class="drawer__panel">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" size="mini" label-position="right" label-width="75px">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="姓名:" prop="name">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom-start"
|
|
|
+ width="900"
|
|
|
+ v-model="enterpriseContact.show"
|
|
|
+ trigger="click">
|
|
|
+ <el-tabs type="border-card" @tab-click="changeTab">
|
|
|
+ <el-tab-pane 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 >{{ 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]"
|
|
|
+ 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-tabs>
|
|
|
+ <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-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="邮箱:" :rules="[
|
|
|
+ { pattern:/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, message: '请输入有效的邮箱',trigger: 'blur' }
|
|
|
+ ]">
|
|
|
+ <el-input autosize v-model="form.email" placeholder="请输入邮箱"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="单位:" prop="enterprisename">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom-start"
|
|
|
+ width="900"
|
|
|
+ v-model="associatedCustomers.show"
|
|
|
+ trigger="click">
|
|
|
+ <el-tabs type="border-card" @tab-click="changeTabCustomers">
|
|
|
+ <el-tab-pane label="关联客户">
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ :data="associatedCustomers.listData"
|
|
|
+ @row-click="associatedCustomersSelect"
|
|
|
+ :header-cell-style="{background:'#EEEEEE',color:'#333'}"
|
|
|
+ size="mini">
|
|
|
+ <el-table-column width="80" label="单位编号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.sys_enterpriseid?scope.row.sys_enterpriseid:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="190" label="单位名称">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.enterprisename?scope.row.enterprisename:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="单位地址">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.address?scope.row.address:'--' }}</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="handleSizeAssociatedCustomers"
|
|
|
+ @current-change="handleCurrentAssociatedCustomers"
|
|
|
+ :current-page="associatedCustomers.currentPage"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="associatedCustomers.total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <slot name="footerLeft"></slot>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="我的客户" >
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ :data="myCustomers.listData"
|
|
|
+ @row-click="myCustomersSelect"
|
|
|
+ :header-cell-style="{background:'#EEEEEE',color:'#333'}"
|
|
|
+ size="mini">
|
|
|
+ <el-table-column width="80" label="单位编号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.sys_enterpriseid?scope.row.sys_enterpriseid:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="190" label="单位名称">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.enterprisename?scope.row.enterprisename:'--' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="单位地址">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.address?scope.row.address:'--' }}</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="handleSizeMyCustomers"
|
|
|
+ @current-change="handleCurrentMyCustomers"
|
|
|
+ :current-page="myCustomers.currentPage"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="myCustomers.total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <slot name="footerLeft"></slot>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-input slot="reference" :disabled="form.contactsid !== 0" autosize v-model="form.enterprisename" placeholder="请输入单位" @input="changeTabCustomers"></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="部门:" >
|
|
|
+ <el-input autosize v-model="form.depname" placeholder="请输入部门"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="职位:" >
|
|
|
+ <el-input autosize v-model="form.position" placeholder="请输入职位"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="性别:" >
|
|
|
+ <el-radio v-model="form.sex" label="男">男</el-radio>
|
|
|
+ <el-radio v-model="form.sex" label="女">女</el-radio>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="生日:" >
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.birthday"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="家庭住址:" >
|
|
|
+ <el-input type="textarea" rows="5" v-model="form.address" placeholder="请输入家庭住址"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="备注:" >
|
|
|
+ <el-input type="textarea" rows="5" v-model="form.remarks" placeholder="请输入备注"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
+ <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: "add",
|
|
|
+ props:["data"],
|
|
|
+ data(){
|
|
|
+ var validateMobilePhone = (rule, value, callback) => {
|
|
|
+ if (value === '') {
|
|
|
+ callback(new Error('手机号不可为空'));
|
|
|
+ } else {
|
|
|
+ if (value !== '') {
|
|
|
+ var reg=/^1[3456789]\d{9}$/;
|
|
|
+ if(!reg.test(value)){
|
|
|
+ callback(new Error('请输入有效的手机号码'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return {
|
|
|
+ dialogFormVisible:false,
|
|
|
+ visible:false,
|
|
|
+ form:{
|
|
|
+ contactsid: 0, //0表示新增,大于0表示选择的联系人
|
|
|
+ sa_projectid: 1, //项目id
|
|
|
+ sys_enterpriseid: 1, //关联的企业id
|
|
|
+ sa_project_contactsid:0,
|
|
|
+ enterprisename:'',
|
|
|
+ name: "",
|
|
|
+ sex: "",
|
|
|
+ depname: "",
|
|
|
+ position: "",
|
|
|
+ isleader: 1,
|
|
|
+ birthday : "",
|
|
|
+ phonenumber: "",
|
|
|
+ email: "",
|
|
|
+ province: "",
|
|
|
+ city: "",
|
|
|
+ county: "",
|
|
|
+ address: "",
|
|
|
+ remarks: "",
|
|
|
+ sys_phonebookid:'',
|
|
|
+ ownerid: this.$route.query.id,
|
|
|
+ ownertable: "sa_project"
|
|
|
+ },
|
|
|
+ rules:{
|
|
|
+ name: [
|
|
|
+ { required: true, message: '姓名不能为空', trigger: 'blur,change' },
|
|
|
+ ],
|
|
|
+ phonenumber: [
|
|
|
+ { required: true, validator: validateMobilePhone, trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ enterprisename: [
|
|
|
+ { required: true, message: '单位不能为空', trigger: 'blur,change' },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ enterpriseContact:{
|
|
|
+ param:{
|
|
|
+ "content": {
|
|
|
+ "sa_projectid": '',
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 10,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "id": 20221219201402,
|
|
|
+ },
|
|
|
+ listData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ show:false
|
|
|
+ },
|
|
|
+ myContacts:{
|
|
|
+ param:{
|
|
|
+ "id": 20221219161202,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ listData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ show:false
|
|
|
+ },
|
|
|
+ associatedCustomers:{
|
|
|
+ param:{
|
|
|
+ "id": 20220920083901,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "sa_projectid":'',
|
|
|
+ "type":4,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ listData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ show:false
|
|
|
+ },
|
|
|
+ myCustomers:{
|
|
|
+ param:{
|
|
|
+ "id": 20220920083901,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "sa_projectid":'',
|
|
|
+ "type":6,
|
|
|
+ "typemx":"",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ listData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ show:false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ onshow(){
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ this.associatedCustomersList()
|
|
|
+ this.myCustomersList()
|
|
|
+ this.enterpriseContactList()
|
|
|
+ this.myContactList()
|
|
|
+ this.form.sys_enterpriseid = this.data.sys_enterpriseid
|
|
|
+ this.form.enterprisename = this.data.enterprisename
|
|
|
+ },
|
|
|
+ onSubmit(){
|
|
|
+ console.log(this.form,"添加联系人")
|
|
|
+ this.form.sa_projectid = this.data.sa_projectid
|
|
|
+ this.$refs['form'].validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221219135502,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.$emit("insertSuccess")
|
|
|
+ this.$refs['form'].resetFields()
|
|
|
+ this.form = {
|
|
|
+ contactsid: 0, //0表示新增,大于0表示选择的联系人
|
|
|
+ sa_projectid: 1, //项目id
|
|
|
+ sys_enterpriseid: 1, //关联的企业id
|
|
|
+ sa_project_contactsid:0,
|
|
|
+ enterprisename:'',
|
|
|
+ name: "",
|
|
|
+ sex: "",
|
|
|
+ depname: "",
|
|
|
+ position: "",
|
|
|
+ isleader: 1,
|
|
|
+ birthday : "",
|
|
|
+ phonenumber: "",
|
|
|
+ email: "",
|
|
|
+ province: "",
|
|
|
+ city: "",
|
|
|
+ county: "",
|
|
|
+ address: "",
|
|
|
+ remarks: "",
|
|
|
+ sys_phonebookid:''
|
|
|
+ }
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ searchData(){
|
|
|
+ this.changeTab()
|
|
|
+ },
|
|
|
+ changeTab(){
|
|
|
+ this.enterpriseContactList()
|
|
|
+ this.myContactList()
|
|
|
+ },
|
|
|
+ changeTabCustomers(){
|
|
|
+ this.associatedCustomersList()
|
|
|
+ this.myCustomersList()
|
|
|
+ },
|
|
|
+ /*企业联系人*/
|
|
|
+ async enterpriseContactList(){
|
|
|
+ this.enterpriseContact.param.content.where.condition = this.form.name
|
|
|
+ this.enterpriseContact.param.content.sa_projectid = this.data.sa_projectid
|
|
|
+ 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 = Object.assign({},this.form,val)
|
|
|
+ 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.enterprisename = ''
|
|
|
+ this.form = Object.assign({},this.form,val)
|
|
|
+ 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()
|
|
|
+ },
|
|
|
+ /*关联客户*/
|
|
|
+ async associatedCustomersList(){
|
|
|
+ this.associatedCustomers.param.content.where.condition = this.form.enterprisename
|
|
|
+ this.associatedCustomers.param.content.where.sa_projectid = this.data.sa_projectid
|
|
|
+ const res = await this.$api.requested(this.associatedCustomers.param)
|
|
|
+ console.log(res,"关联客户")
|
|
|
+ this.associatedCustomers.listData = res.data
|
|
|
+ this.associatedCustomers.total = res.total
|
|
|
+ this.associatedCustomers.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ associatedCustomersSelect(val){
|
|
|
+ console.log(val,"选择关联客户")
|
|
|
+ this.form.sys_enterpriseid = val.sys_enterpriseid
|
|
|
+ this.form.enterprisename = val.enterprisename
|
|
|
+ this.associatedCustomers.show = false
|
|
|
+ },
|
|
|
+ handleSizeAssociatedCustomers(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.associatedCustomers.param.content.pageSize = val
|
|
|
+ this.associatedCustomersList()
|
|
|
+ },
|
|
|
+ handleCurrentAssociatedCustomers(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.associatedCustomers.param.content.pageNumber = val
|
|
|
+ this.associatedCustomersList()
|
|
|
+ },
|
|
|
+ /*我的客户*/
|
|
|
+ async myCustomersList(){
|
|
|
+ this.myCustomers.param.content.where.condition = this.form.enterprisename
|
|
|
+ const res = await this.$api.requested(this.myCustomers.param)
|
|
|
+ console.log(res,"我的客户")
|
|
|
+ this.myCustomers.listData = res.data
|
|
|
+ this.myCustomers.total = res.total
|
|
|
+ this.myCustomers.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ myCustomersSelect(val){
|
|
|
+ console.log(val,"选择我的客户")
|
|
|
+ this.form.sys_enterpriseid = val.sys_enterpriseid
|
|
|
+ this.form.enterprisename = val.enterprisename
|
|
|
+ this.associatedCustomers.show = false
|
|
|
+ },
|
|
|
+ handleSizeMyCustomers(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.myCustomers.param.content.pageSize = val
|
|
|
+ this.myCustomersList()
|
|
|
+ },
|
|
|
+ handleCurrentMyCustomers(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.myCustomers.param.content.pageNumber = val
|
|
|
+ this.myCustomersSelect()
|
|
|
+ },
|
|
|
+ onClose(){
|
|
|
+ this.$refs['form'].resetFields()
|
|
|
+ this.form = {
|
|
|
+ contactsid: 0, //0表示新增,大于0表示选择的联系人
|
|
|
+ sa_projectid: 1, //项目id
|
|
|
+ sys_enterpriseid: 1, //关联的企业id
|
|
|
+ sa_project_contactsid:0,
|
|
|
+ enterprisename:'',
|
|
|
+ name: "",
|
|
|
+ sex: "",
|
|
|
+ depname: "",
|
|
|
+ position: "",
|
|
|
+ isleader: 1,
|
|
|
+ birthday : "",
|
|
|
+ phonenumber: "",
|
|
|
+ email: "",
|
|
|
+ province: "",
|
|
|
+ city: "",
|
|
|
+ county: "",
|
|
|
+ address: "",
|
|
|
+ remarks: "",
|
|
|
+ sys_phonebookid:''
|
|
|
+ }
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|