Commit 238438a2 authored by 黄奎's avatar 黄奎

页面修改

parent 0d1d85af
<style> <style>
.page_MyCustomer ._mc_addbox{height: 52px;width: 100%; margin-top: 20px;} .page_MyCustomer ._mc_addbox {
.page_MyCustomer ._mc_addbox>li{float: left; width: 116px; font-size: 14px; height: 52px; color: #666; text-align: center; line-height: 52px; background: #E9E9E9; cursor: pointer;} height: 52px;
.page_MyCustomer ._mc_addbox>li.active{background: #fff; color: #333;} width: 100%;
.page_MyCustomer ._mc_addbox .divActive{margin: -3px auto; width: 26px; height: 3px; background: #E95252;} margin-top: 20px;
.page_MyCustomer ._mc_edit{overflow: auto;display: none;position:absolute; }
z-index: 50; bottom:0;left: 0;border-top:3px solid #38425d;background-color:#f9f9f9; padding: 10px;width: 100%;min-width: 1146px;}
.page_MyCustomer .edHeightOne{display: block!important;height: 450px;} .page_MyCustomer ._mc_addbox>li {
.page_MyCustomer ._mc_list{overflow-x: auto; background: #fff; padding-top: 20px; padding-left: 15px;} float: left;
.page_MyCustomer ._mc_list>ul>li{padding: 20px 20px 0 20px;width: 260px;box-sizing: border-box; height:410px; width: 116px;
float: left;border: 1px solid #F1F2F5;background: #fff; margin-right:10px;margin-bottom: 20px; border-radius: 10px; position: relative; cursor: pointer;} font-size: 14px;
.page_MyCustomer ._mc_list>ul>li:hover{box-shadow:0px 0px 10px rgba(191,191,191,1);transition: all linear 0.3s;} height: 52px;
.page_MyCustomer ._mc_list>ul>li .iconDelete{cursor: pointer; display: none; position: absolute; top: -4px; right: 0; color: #E95252; z-index: 5; } color: #666;
.page_MyCustomer ._mc_list>ul>li:hover .iconDelete{display: block;} text-align: center;
.page_MyCustomer ._mc_list>ul>li .iconDelete1{cursor: pointer; display: none; position: absolute; top: -4px; right:16px; color: #2CA4F0; z-index: 5; } line-height: 52px;
.page_MyCustomer ._mc_list>ul>li:hover .iconDelete1{display: block;} background: #E9E9E9;
.page_MyCustomer ._mc_list>ul>li .iconDelete2{cursor: pointer; display: none; position: absolute; top: -4px; right:32px; color: #34BFA3; z-index: 5; } cursor: pointer;
.page_MyCustomer ._mc_list>ul>li:hover .iconDelete2{display: block;} }
.page_MyCustomer ._mc_list>ul>li>img{position: absolute; z-index: 5;}
.page_MyCustomer ._head_info_box{text-align: center;font-size: 14px;color: #333333} .page_MyCustomer ._mc_addbox>li.active {
.page_MyCustomer ._head_info_box img{height: 48px;width: 48px;border-radius: 50%;margin-bottom: 5px} background: #fff;
.page_MyCustomer ._head_info_box p{margin-bottom: 8px;} color: #333;
.page_MyCustomer ._head_info_box .icon-img_dianhua{color: #09D49D} }
.page_MyCustomer ._addr{color: #666666}
.page_MyCustomer ._record{padding: 5px 10px 15px;border-bottom: 1px solid #F5F5F5;min-height: 120px} .page_MyCustomer ._mc_addbox .divActive {
.page_MyCustomer ._record p{margin-bottom: 10px;text-align: center;font-size: 14px;border-radius: 4px;padding: 2px;color: white;background-color: #257BF1;} margin: -3px auto;
.page_MyCustomer ._record p._other_n{color: #666666;background-color: #F5F5F5;} width: 26px;
.page_MyCustomer ._record p._fist_n{color: #09D49D;background-color: #E9F7F1;} height: 3px;
.page_MyCustomer ._record p._other{color: #257BF1;background-color: #E4EFFF;} background: #E95252;
.page_MyCustomer ._bt{font-size: 14px;margin-top: 15px;text-align: center; color: #666;} }
.page_MyCustomer ._bt span{color: #FF9000}
.page_MyCustomer ._edHeight{height:340px;} .page_MyCustomer ._mc_edit {
.page_MyCustomer ._scrollbar::-webkit-scrollbar{width: 4px;height: 8px;} overflow: auto;
.page_MyCustomer ._scrollbar::-webkit-scrollbar-thumb{border-radius: 4px;-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);background: #c9c9c9;} display: none;
.page_MyCustomer ._scrollbar::-webkit-scrollbar-track{-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);border-radius: 4px;background: #EDEDED;} position: absolute;
.page_MyCustomer ._mc_edit ._tit{padding-left: 10px;border-left: 3px solid #E95252; font-size: 16px; font-family: 'PingFangSc-Fine'; color: #000000} z-index: 50;
.page_MyCustomer ._mc_edit ._info_box ul._form li{float: left;} bottom: 0;
.page_MyCustomer ._check_list{padding-left: 120px;margin-bottom: 20px;} left: 0;
.page_MyCustomer ._check_box .el-form-item{margin-bottom: 0} border-top: 3px solid #38425d;
.page_MyCustomer ._info_box .el-form-item__label{font-size: 12px; color: #666;} background-color: #f9f9f9;
._remark textarea{resize: none;width: 646px;height: 100px} padding: 10px;
.page_MyCustomer .avatar-uploader .el-upload { width: 100%;
border: 1px dashed #d9d9d9; min-width: 1146px;
border-radius: 6px; }
cursor: pointer;
position: relative; .page_MyCustomer .edHeightOne {
overflow: hidden; display: block !important;
} height: 450px;
.page_MyCustomer .avatar-uploader .el-upload:hover { }
border-color: #409EFF;
} .page_MyCustomer ._mc_list {
.page_MyCustomer .avatar-uploader-icon { overflow-x: auto;
font-size: 28px; background: #fff;
color: #8c939d; padding-top: 20px;
width: 148px; padding-left: 15px;
height: 148px; }
line-height: 148px;
text-align: center; .page_MyCustomer ._mc_list>ul>li {
} padding: 20px 20px 0 20px;
.page_MyCustomer .avatar { width: 260px;
width: 148px; box-sizing: border-box;
height: 148px; height: 410px;
display: block; float: left;
} border: 1px solid #F1F2F5;
.page_MyCustomerSearch{width: 100%; min-height: auto; overflow: hidden; padding:0 0 20px 0;} background: #fff;
.page_MyCustomerSearch li{float: left; font-size: 12px; color: #666; margin:20px 0 0px 0;} margin-right: 10px;
.page_MyCustomerSearch li>span {display: inline-block; } margin-bottom: 20px;
.page_MyCustomerSearch li span>em{display: inline-block; min-width: 60px; text-align: right; font-style: normal; margin:0 12px 0 0;} border-radius: 10px;
.page_MyCustomerSearch li:last-child{float: right;} position: relative;
.page_MyCustomerSearch ._class_b{ cursor: pointer;
color: #257BF1 !important }
}
.xqBtn{ .page_MyCustomer ._mc_list>ul>li:hover {
background: #09D49D; box-shadow: 0px 0px 10px rgba(191, 191, 191, 1);
color:#fff!important; transition: all linear 0.3s;
width: 100%; }
display: inline-block;
border-radius: 4px; .page_MyCustomer ._mc_list>ul>li .iconDelete {
font-size: 14px; cursor: pointer;
height: 38px; display: none;
line-height: 38px; position: absolute;
text-align: center; top: -4px;
} right: 0;
.page_MyCustomer .upload-demo{ color: #E95252;
text-align: center; z-index: 5;
} }
.page_MyCustomer ._mc_list>ul>li:hover .iconDelete {
display: block;
}
.page_MyCustomer ._mc_list>ul>li .iconDelete1 {
cursor: pointer;
display: none;
position: absolute;
top: -4px;
right: 16px;
color: #2CA4F0;
z-index: 5;
}
.page_MyCustomer ._mc_list>ul>li:hover .iconDelete1 {
display: block;
}
.page_MyCustomer ._mc_list>ul>li .iconDelete2 {
cursor: pointer;
display: none;
position: absolute;
top: -4px;
right: 32px;
color: #34BFA3;
z-index: 5;
}
.page_MyCustomer ._mc_list>ul>li:hover .iconDelete2 {
display: block;
}
.page_MyCustomer ._mc_list>ul>li>img {
position: absolute;
z-index: 5;
}
.page_MyCustomer ._head_info_box {
text-align: center;
font-size: 14px;
color: #333333
}
.page_MyCustomer ._head_info_box img {
height: 48px;
width: 48px;
border-radius: 50%;
margin-bottom: 5px
}
.page_MyCustomer ._head_info_box p {
margin-bottom: 8px;
}
.page_MyCustomer ._head_info_box .icon-img_dianhua {
color: #09D49D
}
.page_MyCustomer ._addr {
color: #666666
}
.page_MyCustomer ._record {
padding: 5px 10px 15px;
border-bottom: 1px solid #F5F5F5;
min-height: 120px
}
.page_MyCustomer ._record p {
margin-bottom: 10px;
text-align: center;
font-size: 14px;
border-radius: 4px;
padding: 2px;
color: white;
background-color: #257BF1;
}
.page_MyCustomer ._record p._other_n {
color: #666666;
background-color: #F5F5F5;
}
.page_MyCustomer ._record p._fist_n {
color: #09D49D;
background-color: #E9F7F1;
}
.page_MyCustomer ._record p._other {
color: #257BF1;
background-color: #E4EFFF;
}
.page_MyCustomer ._bt {
font-size: 14px;
margin-top: 15px;
text-align: center;
color: #666;
}
.page_MyCustomer ._bt span {
color: #FF9000
}
.page_MyCustomer ._edHeight {
height: 340px;
}
.page_MyCustomer ._scrollbar::-webkit-scrollbar {
width: 4px;
height: 8px;
}
.page_MyCustomer ._scrollbar::-webkit-scrollbar-thumb {
border-radius: 4px;
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
background: #c9c9c9;
}
.page_MyCustomer ._scrollbar::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
border-radius: 4px;
background: #EDEDED;
}
.page_MyCustomer ._mc_edit ._tit {
padding-left: 10px;
border-left: 3px solid #E95252;
font-size: 16px;
font-family: 'PingFangSc-Fine';
color: #000000
}
.page_MyCustomer ._mc_edit ._info_box ul._form li {
float: left;
}
.page_MyCustomer ._check_list {
padding-left: 120px;
margin-bottom: 20px;
}
.page_MyCustomer ._check_box .el-form-item {
margin-bottom: 0
}
.page_MyCustomer ._info_box .el-form-item__label {
font-size: 12px;
color: #666;
}
._remark textarea {
resize: none;
width: 646px;
height: 100px
}
.page_MyCustomer .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.page_MyCustomer .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.page_MyCustomer .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 148px;
height: 148px;
line-height: 148px;
text-align: center;
}
.page_MyCustomer .avatar {
width: 148px;
height: 148px;
display: block;
}
.page_MyCustomerSearch {
width: 100%;
min-height: auto;
overflow: hidden;
padding: 0 0 20px 0;
}
.page_MyCustomerSearch li {
float: left;
font-size: 12px;
color: #666;
margin: 20px 0 0px 0;
}
.page_MyCustomerSearch li>span {
display: inline-block;
}
.page_MyCustomerSearch li span>em {
display: inline-block;
min-width: 60px;
text-align: right;
font-style: normal;
margin: 0 12px 0 0;
}
.page_MyCustomerSearch li:last-child {
float: right;
}
.page_MyCustomerSearch ._class_b {
color: #257BF1 !important
}
.xqBtn {
background: #09D49D;
color: #fff !important;
width: 100%;
display: inline-block;
border-radius: 4px;
font-size: 14px;
height: 38px;
line-height: 38px;
text-align: center;
}
.page_MyCustomer .upload-demo {
text-align: center;
}
</style> </style>
<template> <template>
<div class="page_MyCustomer"> <div class="page_MyCustomer">
<div class="page_MyCustomerSearch"> <div class="page_MyCustomerSearch">
<li> <li>
<span> <span>
<em>{{$t('salesModule.keyWords')}}</em><el-input class='w220' v-model='msg.CustomerName' @keyup.enter.native="getList()" :placeholder="$t('salesModule.enterPhone')" ></el-input> <em>{{$t('salesModule.keyWords')}}</em>
</span> <el-input class='w220' v-model='msg.CustomerName' @keyup.enter.native="getList()"
</li> :placeholder="$t('salesModule.enterPhone')"></el-input>
<li> </span>
<button class="hollowFixedBtn" @click="getList()">{{$t('pub.searchBtn')}}</button> </li>
<button class="normalBtn" @click="addShow=true;isOldPerson=false">{{$t('salesModule.addCustomer')}}</button> <li>
<button class="normalBtn" @click="outerVisible=true">导入</button> <button class="hollowFixedBtn" @click="getList()">{{$t('pub.searchBtn')}}</button>
<button class="normalBtn" @click="getDownList">模板下载</button> <button class="normalBtn" @click="addShow=true;isOldPerson=false">{{$t('salesModule.addCustomer')}}</button>
</li> <button class="normalBtn" @click="outerVisible=true">导入</button>
</div> <button class="normalBtn" @click="getDownList">模板下载</button>
<div class="_mc_addbox"> </li>
<li :class="{active:type==2}" @click="type=2;clickGetList(2)"> </div>
{{$t('salesModule.InformalClient')}} <div class="_mc_addbox">
<div class="divActive" v-show="type==2"></div> <li :class="{active:type==2}" @click="type=2;clickGetList(2)">
</li> {{$t('salesModule.InformalClient')}}
<li :class="{active:type==1}" @click="type=1;clickGetList(1)"> <div class="divActive" v-show="type==2"></div>
{{$t('salesModule.notInformalClient')}} </li>
<div class="divActive" v-show="type==1"></div> <li :class="{active:type==1}" @click="type=1;clickGetList(1)">
</li> {{$t('salesModule.notInformalClient')}}
<li :class="{active:type==3}" @click="type=3;clickGetList(3)"> <div class="divActive" v-show="type==1"></div>
{{$t('salesModule.UnapprovedClient')}} </li>
<div class="divActive" v-show="type==3"></div> <li :class="{active:type==3}" @click="type=3;clickGetList(3)">
</li> {{$t('salesModule.UnapprovedClient')}}
<li :class="{active:type==4}" @click="type=4;clickGetList(4)"> <div class="divActive" v-show="type==3"></div>
{{$t('salesModule.BlackListCustomers')}} </li>
<div class="divActive" v-show="type==4"></div> <li :class="{active:type==4}" @click="type=4;clickGetList(4)">
</li> {{$t('salesModule.BlackListCustomers')}}
</div> <div class="divActive" v-show="type==4"></div>
<div class="_mc_list _scrollbar" :class="addShow==true?'_edHeight':''"> </li>
<ul class="clearfix"> </div>
<li v-for="(item,index) in dataList" @click="goUrl(type,item.customerId)"> <div class="_mc_list _scrollbar" :class="addShow==true?'_edHeight':''">
<ul class="clearfix">
<i class="iconDelete1 iconfont icon-kehuguanxi_kehu" @click.stop="goUrlT('empBankAccount',item.customerId)"></i> <li v-for="(item,index) in dataList" @click="goUrl(type,item.customerId)">
<i class="iconDelete iconfont icon-kehuguanxi_delete1" @click.stop="deleteCustomer(item)"></i>
<img src="../../assets/img/vip.png" style="left: 134px; top: 50px;" v-show="item.isMember==1&&type==2"/>
<img src="../../assets/img/nopass.png" style="left: 152px; top:75px;" v-show="type==3"/>
<div class="_head_info_box">
<img v-if='!item.icon' src="../../assets/img/litheader.png"/>
<img v-if='item.icon' :onerror="defaultImg" :src='item.icon'/>
<p>{{item.contact}}</p>
<p><i class="iconfont icon-img_dianhua"></i>{{item.contactNumber}}</p>
<p class="_addr">{{item.customerName}} <i class="iconfont icon-shimingrenzheng" :class="{'_class_b': item.RealNameAuthentication===1}"></i>
<i class="iconfont icon-heimingdan" v-show="item.customerStatus===4" :title="$t('salesModule.OntheBlackList')"></i>
</p>
</div>
<div class="_record" v-if="item.customerAccountId!=0">
<p class="_fist_n" v-if="item.customerVisitList.length>0">{{$t('salesModule.Yuefang')}}{{item.customerVisitList[0].visitDateTime}}</p>
<p class="_fist_n" v-else>{{$t('salesModule.noYuefang')}}</p>
<p class="_other" v-if="item.customerVisitList[1]">{{$t('salesModule.Visit')}}{{item.customerVisitList[1].visitDateTime}}</p>
<p class="_other" v-else>{{$t('salesModule.noVisit')}}</p>
<p class="_other">{{$t('salesModule.TotalVisit')}}{{item.visiteCount}}</p>
<p class="_fist_n">{{$t('salesModule.HappinessPassbook')}} <span> {{item.cL_Balance}}</span></p>
</div>
<div class="_record" v-else>
<p class="_fist_n" v-if="item.customerVisitList.length>0">{{$t('salesModule.Yuefang')}}{{item.customerVisitList[0].visitDateTime}}</p>
<p class="_fist_n" v-else>{{$t('salesModule.noYuefang')}}</p>
<p class="_other_n" v-if="item.customerVisitList[1]">{{$t('salesModule.Visit')}}{{item.customerVisitList[1].visitDateTime}}</p>
<p class="_other_n" v-else>{{$t('salesModule.noVisit')}}</p>
<p class="_fist_n">{{$t('salesModule.HappinessPassbook')}} <span> {{item.cL_Balance}}</span></p>
</div>
<div class="_bt">
<el-row :gutter="24">
<el-col :span="18">
<p>{{$t('salesModule.CumulativeTurnover')}} <span> {{item.tradeTotal}}</span></p>
<p>{{$t('salesModule.InquiryAndDemand')}} <span> {{item.inquireCount}}</span></p>
<p>{{$t('salesModule.belongUnion')}} <span> {{item.allianceName}}</span></p>
</el-col>
<el-col :span="6" style="text-align:right;padding:0">
<span class="xqBtn" @click.stop="goUrC('CustomerAnalysis',item.customerId)">{{$t('fnc.xiangqing')}}</span>
</el-col>
</el-row>
</div>
</li>
<div class="clearfix"></div>
<p v-show="dataList.length==0" class="fz14 color333 alcenter">{{$t('system.content_noData')}}</p>
</ul>
<el-pagination
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
layout="total,prev, pager, next, jumper"
:page-size="this.msg.pageSize"
:total="total">
</el-pagination>
</div>
<div class="_mc_edit _scrollbar" :class="addShow==true?'edHeightOne':''">
<p class="_tit">{{$t('salesModule.addCustomer')}}
<span class="fr">
<button class="hollowFixedBtn" type="button" @click="cancelEdit()">{{$t('pub.cancelBtn')}}</button>
<button type="button" class="normalBtn" v-if='allowAdd' @click="saveVisa()">{{$t('pub.saveBtn')}}</button>
</span>
</p>
<el-form class="_info_box clearfix" :model="addMsg" :rules="rules" ref="addMsg" label-width="120px">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="$t('restaurant.res_ContactNumber')" prop="contactNumber" >
<el-input :disabled="isOldPerson" v-model="addMsg.contactNumber" @input='searchHistory(addMsg.contactNumber)' :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.storeName')" prop="customerName">
<el-input :disabled="isOldPerson" v-model="addMsg.customerName" :placeholder="$t('pub.pleaseImport')" maxlength="20"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('hotel.suplier_contact')" prop="contact">
<el-input :disabled="isOldPerson" v-model="addMsg.contact" :placeholder="$t('pub.pleaseImport')" maxlength="20"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="$t('pub.area')">
<el-select filterable v-model='addMsg.Province' @change='getCity'>
<el-option v-for='item in provinceList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='addMsg.City' @change='getRegion'>
<el-option v-for='item in cityList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='addMsg.District'>
<el-option v-for='item in regionList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('hotel.hotel_detailinfo')" prop="address">
<el-input v-model="addMsg.address" :placeholder="$t('salesModule.HouseNumber')" maxlength="50" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="$t('salesModule.Belongbrand')" prop="brandIds">
<el-select filterable class='multiple_input' multiple v-model='addMsg.brandIds' :placeholder="$t('pub.pleaseSel')">
<el-option v-for='item in CustomerBrandList'
:label='item.name'
:value='item.id'
:key='item.id'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('visaT.post')" prop="Duty">
<el-select filterable v-model='addMsg.Duty' :placeholder="$t('pub.pleaseSel')">
<el-option v-for='item in zw'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.premises')" prop="Premises">
<el-select filterable v-model='addMsg.Premises' :placeholder="$t('pub.pleaseSel')">
<el-option v-for='item in jycs'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.CustomerSource')" prop="CustomerSourceType">
<el-select filterable v-model='addMsg.CustomerSourceType' :placeholder="$t('pub.pleaseSel')">
<el-option v-for='item in khly'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="18">
<el-form-item :label="$t('hotel.hotel_remark')" prop="remark">
<el-input v-model="addMsg.remark" type="textarea" maxlength="500"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.CustomerInfo')" prop="remark" v-show='addMsg.CustomerSourceType==6'>
<el-input v-model="addMsg.CustomerSource" maxlength="20"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="$t('salesModule.BusinessPhoto')">
<el-upload class="avatar-uploader"
action=""
:http-request="uploadImg"
accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false"
>
<img v-if="BusinessCardPhotos" :src="BusinessCardPhotos" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.doorPhoto')">
<el-upload class="avatar-uploader"
action=""
:http-request="uploadImg1"
accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false"
>
<img v-if="HousePhotos" :src="HousePhotos" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.businessPhoto')">
<el-upload class="avatar-uploader"
action=""
:http-request="uploadImg2"
accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false"
>
<img v-if="Images" :src="Images" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="6">
</el-col>
</el-row>
</el-form>
</div>
<el-dialog custom-class="w700" title="模板导入" :visible.sync="outerVisible" center> <i class="iconDelete1 iconfont icon-kehuguanxi_kehu"
<el-upload ref="ticketUpload" drag class="upload-demo" :action="getImportFileUrl()" @click.stop="goUrlT('empBankAccount',item.customerId)"></i>
:on-success="handleAvatarSuccess"> <i class="iconDelete iconfont icon-kehuguanxi_delete1" @click.stop="deleteCustomer(item)"></i>
<i class="el-icon-upload"></i> <img src="../../assets/img/vip.png" style="left: 134px; top: 50px;" v-show="item.isMember==1&&type==2" />
<div class="el-upload__text"> <img src="../../assets/img/nopass.png" style="left: 152px; top:75px;" v-show="type==3" />
将文件拖到此处,或 <div class="_head_info_box">
<em>点击上传</em> <img v-if='!item.icon' src="../../assets/img/litheader.png" />
</div> <img v-if='item.icon' :onerror="defaultImg" :src='item.icon' />
<div slot="tip" class="el-upload__tip">只能上传Excel文件</div> <p>{{item.contact}}</p>
</el-upload> <p><i class="iconfont icon-img_dianhua"></i>{{item.contactNumber}}</p>
</el-dialog> <p class="_addr">{{item.customerName}} <i class="iconfont icon-shimingrenzheng"
:class="{'_class_b': item.RealNameAuthentication===1}"></i>
<i class="iconfont icon-heimingdan" v-show="item.customerStatus===4"
:title="$t('salesModule.OntheBlackList')"></i>
</p>
</div>
<div class="_record" v-if="item.customerAccountId!=0">
<p class="_fist_n" v-if="item.customerVisitList.length>0">
{{$t('salesModule.Yuefang')}}{{item.customerVisitList[0].visitDateTime}}</p>
<p class="_fist_n" v-else>{{$t('salesModule.noYuefang')}}</p>
<p class="_other" v-if="item.customerVisitList[1]">
{{$t('salesModule.Visit')}}{{item.customerVisitList[1].visitDateTime}}</p>
<p class="_other" v-else>{{$t('salesModule.noVisit')}}</p>
<p class="_other">{{$t('salesModule.TotalVisit')}}{{item.visiteCount}}</p>
<p class="_fist_n">{{$t('salesModule.HappinessPassbook')}} <span> {{item.cL_Balance}}</span></p>
</div>
<div class="_record" v-else>
<p class="_fist_n" v-if="item.customerVisitList.length>0">
{{$t('salesModule.Yuefang')}}{{item.customerVisitList[0].visitDateTime}}</p>
<p class="_fist_n" v-else>{{$t('salesModule.noYuefang')}}</p>
<p class="_other_n" v-if="item.customerVisitList[1]">
{{$t('salesModule.Visit')}}{{item.customerVisitList[1].visitDateTime}}</p>
<p class="_other_n" v-else>{{$t('salesModule.noVisit')}}</p>
<p class="_fist_n">{{$t('salesModule.HappinessPassbook')}} <span> {{item.cL_Balance}}</span></p>
</div>
<div class="_bt">
<el-row :gutter="24">
<el-col :span="18">
<p>{{$t('salesModule.CumulativeTurnover')}} <span> {{item.tradeTotal}}</span></p>
<p>{{$t('salesModule.InquiryAndDemand')}} <span> {{item.inquireCount}}</span></p>
<p>{{$t('salesModule.belongUnion')}} <span> {{item.allianceName}}</span></p>
</el-col>
<el-col :span="6" style="text-align:right;padding:0">
<span class="xqBtn"
@click.stop="goUrC('CustomerAnalysis',item.customerId)">{{$t('fnc.xiangqing')}}</span>
</el-col>
</el-row>
</div>
</li>
<div class="clearfix"></div>
<p v-show="dataList.length==0" class="fz14 color333 alcenter">{{$t('system.content_noData')}}</p>
</ul>
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" :page-size="this.msg.pageSize" :total="total">
</el-pagination>
</div> </div>
<div class="_mc_edit _scrollbar" :class="addShow==true?'edHeightOne':''">
<p class="_tit">{{$t('salesModule.addCustomer')}}
<span class="fr">
<button class="hollowFixedBtn" type="button" @click="cancelEdit()">{{$t('pub.cancelBtn')}}</button>
<button type="button" class="normalBtn" v-if='allowAdd' @click="saveVisa()">{{$t('pub.saveBtn')}}</button>
</span>
</p>
<el-form class="_info_box clearfix" :model="addMsg" :rules="rules" ref="addMsg" label-width="120px">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="$t('restaurant.res_ContactNumber')" prop="contactNumber">
<el-input :disabled="isOldPerson" v-model="addMsg.contactNumber"
@input='searchHistory(addMsg.contactNumber)' :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.storeName')" prop="customerName">
<el-input :disabled="isOldPerson" v-model="addMsg.customerName" :placeholder="$t('pub.pleaseImport')"
maxlength="20"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('hotel.suplier_contact')" prop="contact">
<el-input :disabled="isOldPerson" v-model="addMsg.contact" :placeholder="$t('pub.pleaseImport')"
maxlength="20"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="$t('pub.area')">
<el-select filterable v-model='addMsg.Province' @change='getCity'>
<el-option v-for='item in provinceList' :label='item.Name' :value='item.ID' :key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='addMsg.City' @change='getRegion'>
<el-option v-for='item in cityList' :label='item.Name' :value='item.ID' :key='item.ID'>
</el-option>
</el-select>
<el-select filterable v-model='addMsg.District'>
<el-option v-for='item in regionList' :label='item.Name' :value='item.ID' :key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('hotel.hotel_detailinfo')" prop="address">
<el-input v-model="addMsg.address" :placeholder="$t('salesModule.HouseNumber')" maxlength="50"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="$t('salesModule.Belongbrand')" prop="brandIds">
<el-select filterable class='multiple_input' multiple v-model='addMsg.brandIds'
:placeholder="$t('pub.pleaseSel')">
<el-option v-for='item in CustomerBrandList' :label='item.name' :value='item.id' :key='item.id'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('visaT.post')" prop="Duty">
<el-select filterable v-model='addMsg.Duty' :placeholder="$t('pub.pleaseSel')">
<el-option v-for='item in zw' :label='item.Name' :value='item.ID' :key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.premises')" prop="Premises">
<el-select filterable v-model='addMsg.Premises' :placeholder="$t('pub.pleaseSel')">
<el-option v-for='item in jycs' :label='item.Name' :value='item.ID' :key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.CustomerSource')" prop="CustomerSourceType">
<el-select filterable v-model='addMsg.CustomerSourceType' :placeholder="$t('pub.pleaseSel')">
<el-option v-for='item in khly' :label='item.Name' :value='item.ID' :key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="18">
<el-form-item :label="$t('hotel.hotel_remark')" prop="remark">
<el-input v-model="addMsg.remark" type="textarea" maxlength="500"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.CustomerInfo')" prop="remark" v-show='addMsg.CustomerSourceType==6'>
<el-input v-model="addMsg.CustomerSource" maxlength="20"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="$t('salesModule.BusinessPhoto')">
<el-upload class="avatar-uploader" action="" :http-request="uploadImg"
accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false">
<img v-if="BusinessCardPhotos" :src="BusinessCardPhotos" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.doorPhoto')">
<el-upload class="avatar-uploader" action="" :http-request="uploadImg1"
accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false">
<img v-if="HousePhotos" :src="HousePhotos" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('salesModule.businessPhoto')">
<el-upload class="avatar-uploader" action="" :http-request="uploadImg2"
accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false">
<img v-if="Images" :src="Images" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="6">
</el-col>
</el-row>
</el-form>
</div>
<el-dialog custom-class="w700" title="模板导入" :visible.sync="outerVisible" center>
<el-upload ref="ticketUpload" drag class="upload-demo" :action="getImportFileUrl()"
:on-success="handleAvatarSuccess">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
<div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
</el-upload>
</el-dialog>
</div>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return{ return {
allowAdd:true, allowAdd: true,
defaultImg: 'this.src="' + require("../../assets/img/litheader.png") + '"', defaultImg: 'this.src="' + require("../../assets/img/litheader.png") + '"',
BusinessCardPhotos:'', BusinessCardPhotos: '',
HousePhotos:'', HousePhotos: '',
Images:'', Images: '',
isOldPerson:false, isOldPerson: false,
type:2, type: 2,
msg:{ msg: {
pageIndex:1, pageIndex: 1,
pageSize:12, pageSize: 12,
CustomerStatus:2, CustomerStatus: 2,
CustomerName:'', CustomerName: '',
Address:'', Address: '',
Country:'-1', Country: '-1',
Province:'-1', Province: '-1',
City:'-1', City: '-1',
District:'-1', District: '-1',
}, },
addMsg:{ addMsg: {
CustomerId:0, CustomerId: 0,
customerName:'', customerName: '',
contact:'', contact: '',
contactNumber:'', contactNumber: '',
address:'', address: '',
brandIds:[], brandIds: [],
remark:'', remark: '',
Duty:'', Duty: '',
Premises:'', Premises: '',
CustomerId:'0', CustomerId: '0',
BusinessCardPhotos:[], BusinessCardPhotos: [],
HousePhotos:[], HousePhotos: [],
Images:[], Images: [],
CustomerSourceType:'', CustomerSourceType: '',
CustomerSource:'', CustomerSource: '',
Country:'2', Country: '2',
Province:'', Province: '',
City:'', City: '',
District:'', District: '',
}, },
addMsgS:{ addMsgS: {
isPreFilled:true, isPreFilled: true,
customerInfo:{}, customerInfo: {},
customerVisit:{ customerVisit: {
remark:'', remark: '',
expectVisitDateTime:'', expectVisitDateTime: '',
expectHour:0 expectHour: 0
} }
}, },
rules:{ rules: {
contact:[{required: true, message:this.$t('rule.EnterContratPerson'), trigger: "blur"}], contact: [{
customerName:[{required: true, message:this.$t('rule.EnterCustomer'), trigger: "blur"}], required: true,
contactNumber:[ message: this.$t('rule.EnterContratPerson'),
{required: true, message:this.$t('rule.EnterPNum'), trigger: "blur"}, trigger: "blur"
{ pattern: /^1[123457890]\d{9}$/, message:this.$t('rule.EnterRightNum') } }],
], customerName: [{
brandIds:[{required: true, message:this.$t('rule.ChoiceBrand'), trigger: "change"}], required: true,
Duty:[{required: true, message:this.$t('rule.ChoiceJob'), trigger: "change"}], message: this.$t('rule.EnterCustomer'),
remark:[{required: false, message: this.$t('rule.ChoiceJob'), trigger: "change"}], trigger: "blur"
Premises:[{required: true, message:this.$t('rule.ChoiceJYCS'), trigger: "change"}], }],
CustomerSourceType:[{required: true, message:this.$t('rule.ChoiceCusFrom'), trigger: "change"}], contactNumber: [{
customerName:[{required: true, message:this.$t('rule.EnterCusName'), trigger: "blur"}], required: true,
address:[{required: true, message:this.$t('visaT.qsradder'), trigger: "blur"}], message: this.$t('rule.EnterPNum'),
trigger: "blur"
}, },
dataList:[], {
CustomerBrandList:[], pattern: /^1[123457890]\d{9}$/,
checkedCities:[], message: this.$t('rule.EnterRightNum')
checkAll:false, }
addShow:false, ],
noData:false, brandIds: [{
loading:true, required: true,
isIndeterminate:true, message: this.$t('rule.ChoiceBrand'),
total: 0, trigger: "change"
currentPage: 1, }],
provinceList:[], Duty: [{
cityList:[], required: true,
regionList:[], message: this.$t('rule.ChoiceJob'),
jycs:[], //经营场所 trigger: "change"
zw:[], //职务 }],
khly:[], //客户来源 remark: [{
outerVisible:false, required: false,
message: this.$t('rule.ChoiceJob'),
trigger: "change"
}],
Premises: [{
required: true,
message: this.$t('rule.ChoiceJYCS'),
trigger: "change"
}],
CustomerSourceType: [{
required: true,
message: this.$t('rule.ChoiceCusFrom'),
trigger: "change"
}],
customerName: [{
required: true,
message: this.$t('rule.EnterCusName'),
trigger: "blur"
}],
address: [{
required: true,
message: this.$t('visaT.qsradder'),
trigger: "blur"
}],
},
dataList: [],
CustomerBrandList: [],
checkedCities: [],
checkAll: false,
addShow: false,
noData: false,
loading: true,
isIndeterminate: true,
total: 0,
currentPage: 1,
provinceList: [],
cityList: [],
regionList: [],
jycs: [], //经营场所
zw: [], //职务
khly: [], //客户来源
outerVisible: false,
}
},
methods: {
//导入
getImportFileUrl() {
let url =
this.domainManager().UploadFileUrl +
"?cmd=dmc_post_LocalFileUpload&fileType=1&fileLimit=1&Type=9&EmployeeId=" +
this.getLocalStorage().EmployeeId +
"&importType=" +
this.importType;
return url;
},
//上传文件后清空文件队列
handleAvatarSuccess(res, file) {
this.$refs.ticketUpload.clearFiles();
if (res.resultCode == 1) {
this.Success(res.message);
this.outerVisible = false;
} }
},methods:{ },
//导入 //下载模板文件
getImportFileUrl() { getDownList() {
let url = this.apipost(
this.domainManager().UploadFileUrl + "app_customer_GetCustomerTemplate", {},
"?cmd=dmc_post_LocalFileUpload&fileType=1&fileLimit=1&Type=2&uid=" + res => {
this.getLocalStorage().EmployeeId + if (res.data.resultCode == 1) {
"&importType=" + this.downList =
this.importType; this.domainManager().LocalTemplateFileDownLoadUrl +
return url; res.data.data.FileUrl;
}, window.open(this.downList);
//上传文件后清空文件队列 } else {
handleAvatarSuccess(res, file) { this.Error(res.data.message);
this.$refs.ticketUpload.clearFiles(); }
if (res.resultCode == 1) { },
this.Success(res.message); err => {}
this.outerVisible = false; );
} },
}, deleteCustomer(obj) {
//下载模板文件 this.$confirm(this.$t('tips.shifoushanchu'), this.$t('tips.tips'), {
getDownList() { confirmButtonText: this.$t('pub.sureBtn'),
this.apipost( cancelButtonText: this.$t('pub.cancelBtn'),
"AirTicket_post_DownAirticket", {}, type: 'warning'
res => { }).then(() => {
if (res.data.resultCode == 1) { this.apipost('app_customer_Remove', {
this.downList = ID: obj.customerId
this.domainManager().LocalTemplateFileDownLoadUrl + }, res => {
res.data.data.FileUrl; if (res.data.resultCode == 1) {
} else { this.Success(res.data.message);
this.Error(res.data.message); this.getList()
} }
}, }, err => {})
err => {} }).catch(() => {
); this.Error('已取消删除!');
}, });
},
deleteCustomer(obj){ uploadImg(file) {
this.$confirm(this.$t('tips.shifoushanchu'), this.$t('tips.tips'), { //上传
confirmButtonText: this.$t('pub.sureBtn'), let newArr = [];
cancelButtonText: this.$t('pub.cancelBtn'), newArr.push(file.file);
type: 'warning' let path = "/Upload/Temporary/";
}).then(() => { this.UploadSelfFileT(path, newArr, x => {
this.apipost('app_customer_Remove',{ID:obj.customerId},res=>{ this.BusinessCardPhotos = this.domainManager().ViittoFileUrl + x.data.FilePath
if(res.data.resultCode==1){ });
this.Success(res.data.message); },
this.getList() uploadImg1(file) {
} //上传
},err=>{}) let newArr = [];
}).catch(() => { newArr.push(file.file);
this.Error('已取消删除!'); let path = "/Upload/Temporary/";
}); this.UploadSelfFileT(path, newArr, x => {
}, this.HousePhotos = this.domainManager().ViittoFileUrl + x.data.FilePath
uploadImg(file) { });
//上传 },
let newArr = []; uploadImg2(file) {
newArr.push(file.file); //上传
let path = "/Upload/Temporary/"; let newArr = [];
this.UploadSelfFileT(path, newArr, x => { newArr.push(file.file);
this.BusinessCardPhotos= this.domainManager().ViittoFileUrl + x.data.FilePath let path = "/Upload/Temporary/";
}); this.UploadSelfFileT(path, newArr, x => {
}, this.Images = this.domainManager().ViittoFileUrl + x.data.FilePath
uploadImg1(file) { });
//上传 },
let newArr = []; searchHistory(val) {
newArr.push(file.file); if (val.length == 11) {
let path = "/Upload/Temporary/"; this.apipost('app_customer_GetCustomerByContactNumber', {
this.UploadSelfFileT(path, newArr, x => { ContactNumber: val
this.HousePhotos= this.domainManager().ViittoFileUrl + x.data.FilePath }, res => {
}); if (res.data.resultCode == 1) {
}, if (res.data.data.customerInfo.customerId > 0) {
uploadImg2(file) {
//上传 this.isOldPerson = true
let newArr = []; let x = res.data.data.customerInfo
newArr.push(file.file); this.addMsg = x
let path = "/Upload/Temporary/"; this.addMsg.Province = x.province
this.UploadSelfFileT(path, newArr, x => { this.addMsg.customerId = x.customerId
this.Images=this.domainManager().ViittoFileUrl + x.data.FilePath this.getCity1()
}); this.addMsg.City = x.city
}, this.getRegion1()
searchHistory(val){ this.addMsg.District = x.district
if(val.length==11){ this.addMsg.Duty = x.duty
this.apipost('app_customer_GetCustomerByContactNumber',{ContactNumber:val},res=>{ this.addMsg.Premises = x.premises
if(res.data.resultCode==1){ this.addMsg.CustomerSourceType = x.customerSourceType
if(res.data.data.customerInfo.customerId>0) let dictid = []
{ res.data.data.brandList.forEach(x => {
dictid.push(x.dictId)
this.isOldPerson=true })
let x=res.data.data.customerInfo this.addMsg.brandIds = dictid
this.addMsg=x
this.addMsg.Province=x.province if (x.businessCardPhotos && x.businessCardPhotos.length > 0) {
this.addMsg.customerId=x.customerId this.BusinessCardPhotos = x.businessCardPhotos[0]
this.getCity1()
this.addMsg.City=x.city
this.getRegion1()
this.addMsg.District=x.district
this.addMsg.Duty=x.duty
this.addMsg.Premises=x.premises
this.addMsg.CustomerSourceType=x.customerSourceType
let dictid=[]
res.data.data.brandList.forEach(x=>{
dictid.push(x.dictId)
})
this.addMsg.brandIds=dictid
if(x.businessCardPhotos&&x.businessCardPhotos.length>0)
{
this.BusinessCardPhotos=x.businessCardPhotos[0]
}
if(x.images&&x.images.length>0)
{
this.Images=x.images[0]
}
if(x.housePhotos&&x.housePhotos.length>0)
{
this.HousePhotos=x.housePhotos[0]
}
}
this.allowAdd=true
}else{
if(res.data.message.indexOf('已注册客户信息')!=-1)
{
this.allowAdd=false
}
this.$message.error(res.data.message)
}
},err=>{})
}else{}
},
getJycs(){
this.apipost('app_today_visit_GetCustomerPremisesEnum',{},res=>{
if(res.data.resultCode==1){
this.jycs=res.data.data
}
},err=>{})
},
getZw(){
this.apipost('app_today_visit_GetCustomerDutyEnum',{},res=>{
if(res.data.resultCode==1){
this.zw=res.data.data
}
},err=>{})
},
getKhly(){
this.apipost('app_customer_GetCustomerSourceEnum',{},res=>{
if(res.data.resultCode==1){
this.khly=res.data.data
}
},err=>{})
},
getProvince(){
this.apipost('app_customer_GetChildList',{Id:2,"level":1},res=>{
if(res.data.resultCode==1){
this.provinceList=res.data.data
}
},err=>{})
},
getCity(){
this.apipost('app_customer_GetChildList',{Id:this.addMsg.Province,"level":2},res=>{
if(res.data.resultCode==1){
this.cityList=res.data.data
this.regionList=[]
this.addMsg.City=''
this.addMsg.District=''
}
},err=>{})
},
getRegion(){
this.apipost('app_customer_GetChildList',{Id:this.addMsg.City,"level":3},res=>{
if(res.data.resultCode==1){
this.regionList=res.data.data
this.addMsg.District=''
}
},err=>{})
},
getCity1(){
this.apipost('app_customer_GetChildList',{Id:this.addMsg.Province,"level":2},res=>{
if(res.data.resultCode==1){
this.cityList=res.data.data
}
},err=>{})
},
getRegion1(){
this.apipost('app_customer_GetChildList',{Id:this.addMsg.City,"level":3},res=>{
if(res.data.resultCode==1){
this.regionList=res.data.data
}
},err=>{})
},
goUrl(type,id){
this.$router.push({ name: 'MyCustomerDetail',query:{"id":id} })
},
goUrC(path,customerId){
this.$router.push({ name:path,query:{"customerId":customerId,blank: 'y'} })
},
goUrlT(path,id){
this.$router.push({ name:path,query:{"id":id,"type":8} })
},
clickGetList(type){
this.msg.pageIndex=1
this.currentPage = 1
this.msg.CustomerStatus=type
this.getList()
},
getList(){ // 获取列表数据
this.apipost('app_get_my_customer_list',this.msg,res=>{
if(res.data.resultCode==0){
this.loading = false;
this.dataList=[]
}else{
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
this.loading = false;
} }
},err=>{}) if (x.images && x.images.length > 0) {
}, this.Images = x.images[0]
getCustomerBrandList(){ // 获取品牌
this.apipost('app_get_customer_brand',{},res=>{
if(res.data.resultCode==1){
this.CustomerBrandList = res.data.data;
}else{
this.$message.error(res.data.message)
} }
},err=>{}) if (x.housePhotos && x.housePhotos.length > 0) {
}, this.HousePhotos = x.housePhotos[0]
saveVisa(){ // 保存
if(this.addMsg.District=='')
{
this.addMsg.District=0
}
this.addMsgS.customerInfo = this.addMsg
if(this.BusinessCardPhotos)
{ this.addMsg.BusinessCardPhotos=[]
this.addMsg.BusinessCardPhotos.push(this.BusinessCardPhotos)
}
if(this.HousePhotos)
{ this.addMsg.HousePhotos=[]
this.addMsg.HousePhotos.push(this.HousePhotos)
}
if(this.Images)
{ this.addMsg.Images=[]
this.addMsg.Images.push(this.Images)
}
let sheng=''
let shi=''
let qu=''
if(this.addMsg.District=='')
{
this.addMsg.District=0
}
if(this.addMsg.City=='')
{
this.addMsg.City=0
}
this.provinceList.forEach(item=>{
if(this.addMsg.Province==item.ID)
{
sheng=item.Name
}
})
this.cityList.forEach(item=>{
if(this.addMsg.City==item.ID)
{
shi=item.Name
}
})
this.regionList.forEach(item=>{
if(this.addMsg.District==item.ID)
{
qu=item.Name
}
})
let AreaName=sheng+shi+qu
this.addMsg.address=AreaName+','+this.addMsg.address
this.apipost('app_add_new_visit_customer',this.addMsgS,res=>{
if(res.data.resultCode==1){
this.addMsg={
customerName:'',
contact:'',
contactNumber:'',
address:'',
brandIds:[],
remark:'',
Duty:'',
Premises:'',
CustomerId:'0',
BusinessCardPhotos:[],
HousePhotos:[],
Images:[],
CustomerSourceType:'',
CustomerSource:'',
Country:'2',
Province:'',
City:'',
District:'',
}
this.addMsgS.customerVisit.expectVisitDateTime =''
this.$message.success(res.data.message)
this.addShow=false
this.getList()
}else{
this.$message.error(res.data.message)
} }
},err=>{}) }
}, this.allowAdd = true
cancelEdit(){ // 取消新增 } else {
this.addShow=false if (res.data.message.indexOf('已注册客户信息') != -1) {
this.addMsg={ this.allowAdd = false
customerName:'', }
contact:'', this.$message.error(res.data.message)
contactNumber:'',
address:'',
remark:'',
brandIds:[],
} }
this.BusinessCardPhotos='', }, err => {})
this.HousePhotos='', } else {}
this.Images='', },
this.addMsgS.customerVisit.expectVisitDateTime ='' getJycs() {
this.resetForm('addMsg') this.apipost('app_today_visit_GetCustomerPremisesEnum', {}, res => {
}, if (res.data.resultCode == 1) {
resetForm(formName) { // 重置表单 this.jycs = res.data.data
this.$refs[formName].resetFields(); }
}, }, err => {})
handleCurrentChange(val) { },
this.msg.pageIndex = val; getZw() {
this.getList(); this.apipost('app_today_visit_GetCustomerDutyEnum', {}, res => {
}, if (res.data.resultCode == 1) {
},mounted(){ this.zw = res.data.data
}
}, err => {})
},
getKhly() {
this.apipost('app_customer_GetCustomerSourceEnum', {}, res => {
if (res.data.resultCode == 1) {
this.khly = res.data.data
}
}, err => {})
},
getProvince() {
this.apipost('app_customer_GetChildList', {
Id: 2,
"level": 1
}, res => {
if (res.data.resultCode == 1) {
this.provinceList = res.data.data
}
}, err => {})
},
getCity() {
this.apipost('app_customer_GetChildList', {
Id: this.addMsg.Province,
"level": 2
}, res => {
if (res.data.resultCode == 1) {
this.cityList = res.data.data
this.regionList = []
this.addMsg.City = ''
this.addMsg.District = ''
}
}, err => {})
},
getRegion() {
this.apipost('app_customer_GetChildList', {
Id: this.addMsg.City,
"level": 3
}, res => {
if (res.data.resultCode == 1) {
this.regionList = res.data.data
this.addMsg.District = ''
}
}, err => {})
},
getCity1() {
this.apipost('app_customer_GetChildList', {
Id: this.addMsg.Province,
"level": 2
}, res => {
if (res.data.resultCode == 1) {
this.cityList = res.data.data
}
}, err => {})
},
getRegion1() {
this.apipost('app_customer_GetChildList', {
Id: this.addMsg.City,
"level": 3
}, res => {
if (res.data.resultCode == 1) {
this.regionList = res.data.data
}
}, err => {})
},
goUrl(type, id) {
this.$router.push({
name: 'MyCustomerDetail',
query: {
"id": id
}
})
},
goUrC(path, customerId) {
this.$router.push({
name: path,
query: {
"customerId": customerId,
blank: 'y'
}
})
},
goUrlT(path, id) {
this.$router.push({
name: path,
query: {
"id": id,
"type": 8
}
})
},
clickGetList(type) {
this.msg.pageIndex = 1
this.currentPage = 1
this.msg.CustomerStatus = type
this.getList() this.getList()
this.getCustomerBrandList() },
this.getProvince() getList() { // 获取列表数据
this.getJycs() this.apipost('app_get_my_customer_list', this.msg, res => {
this.getZw() if (res.data.resultCode == 0) {
this.getKhly() this.loading = false;
this.dataList = []
} else {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
this.loading = false;
}
}, err => {})
},
getCustomerBrandList() { // 获取品牌
this.apipost('app_get_customer_brand', {}, res => {
if (res.data.resultCode == 1) {
this.CustomerBrandList = res.data.data;
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
saveVisa() { // 保存
if (this.addMsg.District == '') {
this.addMsg.District = 0
}
this.addMsgS.customerInfo = this.addMsg
if (this.BusinessCardPhotos) {
this.addMsg.BusinessCardPhotos = []
this.addMsg.BusinessCardPhotos.push(this.BusinessCardPhotos)
}
if (this.HousePhotos) {
this.addMsg.HousePhotos = []
this.addMsg.HousePhotos.push(this.HousePhotos)
}
if (this.Images) {
this.addMsg.Images = []
this.addMsg.Images.push(this.Images)
}
let sheng = ''
let shi = ''
let qu = ''
if (this.addMsg.District == '') {
this.addMsg.District = 0
}
if (this.addMsg.City == '') {
this.addMsg.City = 0
}
this.provinceList.forEach(item => {
if (this.addMsg.Province == item.ID) {
sheng = item.Name
}
})
this.cityList.forEach(item => {
if (this.addMsg.City == item.ID) {
shi = item.Name
}
})
this.regionList.forEach(item => {
if (this.addMsg.District == item.ID) {
qu = item.Name
}
})
let AreaName = sheng + shi + qu
this.addMsg.address = AreaName + ',' + this.addMsg.address
this.apipost('app_add_new_visit_customer', this.addMsgS, res => {
if (res.data.resultCode == 1) {
this.addMsg = {
customerName: '',
contact: '',
contactNumber: '',
address: '',
brandIds: [],
remark: '',
Duty: '',
Premises: '',
CustomerId: '0',
BusinessCardPhotos: [],
HousePhotos: [],
Images: [],
CustomerSourceType: '',
CustomerSource: '',
Country: '2',
Province: '',
City: '',
District: '',
}
this.addMsgS.customerVisit.expectVisitDateTime = ''
this.$message.success(res.data.message)
this.addShow = false
this.getList()
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
cancelEdit() { // 取消新增
this.addShow = false
this.addMsg = {
customerName: '',
contact: '',
contactNumber: '',
address: '',
remark: '',
brandIds: [],
}
this.BusinessCardPhotos = '',
this.HousePhotos = '',
this.Images = '',
this.addMsgS.customerVisit.expectVisitDateTime = ''
this.resetForm('addMsg')
},
resetForm(formName) { // 重置表单
this.$refs[formName].resetFields();
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
},
mounted() {
this.getList()
this.getCustomerBrandList()
this.getProvince()
this.getJycs()
this.getZw()
this.getKhly()
} }
} }
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment