|
|
@@ -0,0 +1,581 @@
|
|
|
+<template>
|
|
|
+ <div class="inline-16">
|
|
|
+ <el-button size="small" type="text" @click="onshow" :disabled="!tool.checkAuth($route.name,'contactManage') || !disabled">编 辑</el-button>
|
|
|
+ <el-drawer
|
|
|
+ title="编辑联系人"
|
|
|
+ :visible.sync="dialogFormVisible"
|
|
|
+ size="600px"
|
|
|
+ direction="rtl"
|
|
|
+ :show-close="false"
|
|
|
+ append-to-body
|
|
|
+ @close="dialogFormVisible = false">
|
|
|
+ <div class="drawer__panel">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" size="mini" label-position="right" label-width="90px">
|
|
|
+ <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" v-model="activeName">
|
|
|
+ <el-tab-pane label="企业联系人" name="first">
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ :data="enterpriseContact.listData"
|
|
|
+ @row-click="enterpriseContactSelect"
|
|
|
+ height="500px"
|
|
|
+ :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="200" label="单位">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span >{{ scope.row.enterprisename?scope.row.enterprisename:'--' }}</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.name" placeholder="请输入姓名" @input="searchData"></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item>
|
|
|
+ <el-radio v-model="form.isTelephone" label="0">手机号</el-radio>
|
|
|
+ <el-radio v-model="form.isTelephone" label="1">座机电话</el-radio>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="form.isTelephone == '1'">
|
|
|
+ <el-form-item label="联系方式:" prop="telephone" >
|
|
|
+ <el-input v-model="form.areaCode" style="width: 25%" autocomplete="on" placeholder="请填写区号"></el-input>
|
|
|
+ <span style="color: #999999">——</span>
|
|
|
+ <el-input v-model="form.telephone" style="width: 68%" autocomplete="on" placeholder="请填写座机电话"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" >
|
|
|
+ <el-form-item v-if="form.isTelephone == '0'" label="联系方式:" prop="phonenumber" :rules="[
|
|
|
+ { required: true, message: '手机号码不能为空'},
|
|
|
+ { pattern:/^1[3-9][0-9]\d{8}$/, message: '请输入正确手机号码',trigger: 'blur' }
|
|
|
+ ]">
|
|
|
+ <el-input v-model="form.phonenumber" autocomplete="on" placeholder="请填写手机号码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="微信:" prop="wechatnum">
|
|
|
+ <el-input autosize v-model="form.wechatnum" placeholder="请输入微信" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="标签:" >
|
|
|
+ <el-select v-model="tags" style="width: 100%" placeholder="请选择标签" size="small" multiple class="inline-16" @remove-tag="onClear">
|
|
|
+ <el-option
|
|
|
+ v-for="item in tagList"
|
|
|
+ :key="item.index"
|
|
|
+ :label="item.tag"
|
|
|
+ :value="item.tag"
|
|
|
+ :disabled="hasDisabledTag(item)">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </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="传真:" >
|
|
|
+ <el-input autosize v-model="form.fax" placeholder="请输入传真" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="单位:" >
|
|
|
+ <el-input autosize v-model="enterprisename" placeholder="请输入单位" disabled></el-input>
|
|
|
+ </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 autosize v-model="groupname" placeholder="请输入群组" disabled></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="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
|
|
|
+ <el-button size="small" type="warning" :loading="loading" @click="onSubmit" class="normal-btn-width">保 存</el-button>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {mapGetters} from "vuex";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "edit",
|
|
|
+ props:["data","enterprisename","disabled"],
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var telephone = (rule,value,callback) =>{
|
|
|
+ if (this.form.areaCode === '' && this.form.telephone === ''){
|
|
|
+ callback(new Error('座机电话不能为空'))
|
|
|
+ } else{
|
|
|
+ var reg=/^0\d{2,3}-\d{7,8}$/
|
|
|
+ let telephone = this.form.areaCode + '-' + this.form.telephone
|
|
|
+ if (!reg.test(telephone)){
|
|
|
+ callback(new Error('请输入正确座机电话'))
|
|
|
+ }else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ dialogFormVisible:false,
|
|
|
+ visible:false,
|
|
|
+ tagList:[],
|
|
|
+ activeName:'first',
|
|
|
+ tags:[],
|
|
|
+ groupname:'客户联系人',
|
|
|
+ form:{
|
|
|
+ contactsid: 0,
|
|
|
+ sys_enterpriseid: "",
|
|
|
+ name: "",
|
|
|
+ sex: "",
|
|
|
+ depname: "",
|
|
|
+ position: "",
|
|
|
+ birthday: "",
|
|
|
+ phonenumber: "",
|
|
|
+ email: "",
|
|
|
+ address: "",
|
|
|
+ remarks: "",
|
|
|
+ enterprisename:'',
|
|
|
+ province: "",
|
|
|
+ city: "",
|
|
|
+ county: "",
|
|
|
+ workaddress: 0,
|
|
|
+ isdefault: 1,
|
|
|
+ isprimary: 1,
|
|
|
+ sys_phonebookid:'',
|
|
|
+ telephone:'',
|
|
|
+ fax:'',
|
|
|
+ ownerid: this.$route.query.id,
|
|
|
+ ownertable: "sa_customers",
|
|
|
+ isTelephone:'0',
|
|
|
+ areaCode:'',
|
|
|
+ },
|
|
|
+ rules:{
|
|
|
+ name: [
|
|
|
+ { required: true, message: '姓名不能为空', trigger: 'blur,change' },
|
|
|
+ ],
|
|
|
+ // phonenumber: [
|
|
|
+ // { required: true, validator: validateMobilePhone, trigger: 'blur' },
|
|
|
+ // ],
|
|
|
+ telephone:[
|
|
|
+ { required: true, validator: telephone, trigger: 'change' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ enterpriseContact:{
|
|
|
+ param:{
|
|
|
+ "content": {
|
|
|
+ "sys_enterpriseid": '',
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 9999,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "id": 20221219193002,
|
|
|
+ },
|
|
|
+ listData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ show:false
|
|
|
+ },
|
|
|
+ myContacts:{
|
|
|
+ param:{
|
|
|
+ "id": 20221219161202,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 9999,
|
|
|
+ "ownertable":'sa_customers',
|
|
|
+ "ownerid":'',
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ listData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ show:false
|
|
|
+ },
|
|
|
+ paramTag:{
|
|
|
+ "id":"20220929085401",
|
|
|
+ "content":{
|
|
|
+ "nocache":true,
|
|
|
+ "ownertable":"",
|
|
|
+ "ownerid":0,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ ...mapGetters({
|
|
|
+ loading:'loading'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ onshow(){
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ this.activeName = 'first'
|
|
|
+ this.enterpriseContact.param.content.pageNumber = 1
|
|
|
+ this.myContacts.param.content.pageNumber = 1
|
|
|
+ this.enterpriseContactList()
|
|
|
+ this.myContactList()
|
|
|
+ this.getTag()
|
|
|
+ this.form = Object.assign({},this.form,this.data)
|
|
|
+ this.tags = this.form.tag
|
|
|
+ if ((this.form.phonenumber.indexOf('-')) != '-1'){
|
|
|
+ this.form.isTelephone = '1'
|
|
|
+ this.form.areaCode = this.data.phonenumber.substring(0,this.form.phonenumber.indexOf('-'))
|
|
|
+ this.form.telephone = this.data.phonenumber.substring(this.form.areaCode.length+1)
|
|
|
+ this.form.phonenumber = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ onSubmit(){
|
|
|
+ this.$refs['form'].validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ this.$store.commit('setLoading',true)
|
|
|
+ if (this.form.isTelephone == '1'){
|
|
|
+ this.form.phonenumber = this.form.areaCode + "-" + this.form.telephone
|
|
|
+ }
|
|
|
+ this.form.tag = this.tags
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20221018141802",
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,async ()=>{
|
|
|
+ let res2 = await this.$api.requested({
|
|
|
+ "id": 20220929090901,
|
|
|
+ "content": {
|
|
|
+ "ownertable":"plm_unit",
|
|
|
+ "ownerid":res.data.contactsid,
|
|
|
+ "datatag": this.form.tag
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$emit("updateSuccess")
|
|
|
+ this.$refs['form'].resetFields()
|
|
|
+ this.$store.commit('setLoading',false)
|
|
|
+ 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
|
|
|
+ if (val.phonenumber.indexOf('-') != '-1'){
|
|
|
+ this.form.isTelephone = '1'
|
|
|
+ this.form.areaCode = val.phonenumber.substring(0,val.phonenumber.indexOf('-'))
|
|
|
+ this.form.telephone = val.phonenumber.substring(this.form.areaCode.length+1)
|
|
|
+ this.form.phonenumber = ''
|
|
|
+ }else {
|
|
|
+ this.form.isTelephone = '0'
|
|
|
+ this.form.phonenumber = val.phonenumber
|
|
|
+ this.form.areaCode = ''
|
|
|
+ this.form.telephone = ''
|
|
|
+ }
|
|
|
+ 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
|
|
|
+ this.myContacts.param.content.ownerid = this.data.sys_enterpriseid
|
|
|
+ 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.name = val.name
|
|
|
+ if (val.phonenumber.indexOf('-') != '-1'){
|
|
|
+ this.form.isTelephone = '1'
|
|
|
+ this.form.areaCode = val.phonenumber.substring(0,val.phonenumber.indexOf('-'))
|
|
|
+ this.form.telephone = val.phonenumber.substring(this.form.areaCode.length+1)
|
|
|
+ this.form.phonenumber = ''
|
|
|
+ }else {
|
|
|
+ this.form.isTelephone = '0'
|
|
|
+ this.form.phonenumber = val.phonenumber
|
|
|
+ this.form.areaCode = ''
|
|
|
+ this.form.telephone = ''
|
|
|
+ }
|
|
|
+ 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.myContacts.param.content.pageSize = val
|
|
|
+ this.myContactList()
|
|
|
+ },
|
|
|
+ handleCurrentChangeMy(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.myContacts.param.content.pageNumber = val
|
|
|
+ this.myContactList()
|
|
|
+ },
|
|
|
+ async getTag(){
|
|
|
+ this.paramTag.content.ownertable = 'plm_unit'
|
|
|
+ const res = await this.$api.requested(this.paramTag)
|
|
|
+ this.tagList = res.data.option
|
|
|
+
|
|
|
+ },
|
|
|
+ hasDisabledTag (item) {
|
|
|
+ let arr = []
|
|
|
+ let arr2 = []
|
|
|
+ arr = this.tagList.filter(item=>{
|
|
|
+ return this.tags.includes(item.tag)
|
|
|
+ })
|
|
|
+ arr.forEach(e=>{
|
|
|
+ arr2 = arr2.concat(e.mutextag)
|
|
|
+ })
|
|
|
+ arr2 = this.tags.length === 0?[]:arr2
|
|
|
+ let _isSame = arr2.some(tag=>item.tag === tag)
|
|
|
+ return _isSame
|
|
|
+ },
|
|
|
+ onClear(row){
|
|
|
+ for(var i=0;i<this.tags.length;i++){
|
|
|
+ if (this.tags[i] === row){
|
|
|
+ this.tags.splice(i,1)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|