Commit e01e7fcf authored by 罗超's avatar 罗超

1、修改下载行程酒店连接问题

2、修改提成管理界面
3、提成新增目的地关联
parent 68b8d462
...@@ -102,7 +102,6 @@ ...@@ -102,7 +102,6 @@
<el-col :span="5" :gutter="20"> <el-col :span="5" :gutter="20">
<el-form-item label="适用公司:" prop="UsingBranchArray"> <el-form-item label="适用公司:" prop="UsingBranchArray">
<el-select <el-select
filterable
multiple multiple
collapse-tags collapse-tags
@change="changeData(1)" @change="changeData(1)"
...@@ -122,7 +121,6 @@ ...@@ -122,7 +121,6 @@
<el-col :span="5" :gutter="20"> <el-col :span="5" :gutter="20">
<el-form-item label="适用线路:" prop="UsingLineArray"> <el-form-item label="适用线路:" prop="UsingLineArray">
<el-select <el-select
filterable
multiple multiple
collapse-tags collapse-tags
@change="changeData(2)" @change="changeData(2)"
...@@ -140,6 +138,27 @@ ...@@ -140,6 +138,27 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5" :gutter="20"> <el-col :span="5" :gutter="20">
<el-form-item label="适用目的地:">
<el-select
multiple
collapse-tags
@change="changeData(3)"
v-model="addMsg.UsingDestinationArray"
>
<el-option label="所有目的地" value="-1"></el-option>
<el-option
v-for="(item, index) in desctions"
:label="item.PlaceName"
:value="item.PlaceID.toString()"
:key="index"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :gutter="20">
<el-form-item label="启用时间:"> <el-form-item label="启用时间:">
<el-date-picker v-model="addMsg.EffectDate" type="date" placeholder="选择启用时间"></el-date-picker> <el-date-picker v-model="addMsg.EffectDate" type="date" placeholder="选择启用时间"></el-date-picker>
</el-form-item> </el-form-item>
...@@ -289,7 +308,9 @@ export default { ...@@ -289,7 +308,9 @@ export default {
formLoading: false, formLoading: false,
searchMsg: { searchMsg: {
RB_Group_Id: 0 RB_Group_Id: 0
} },
desctionsResources:[],
desctions:[]
}; };
}, },
methods: { methods: {
...@@ -333,8 +354,10 @@ export default { ...@@ -333,8 +354,10 @@ export default {
CommissionVariable: 0, CommissionVariable: 0,
UsingLineArray: ["-1"], UsingLineArray: ["-1"],
UsingBranchArray: ["-1"], UsingBranchArray: ["-1"],
UsingDestinationArray:["-1"],
UsingLine: "", UsingLine: "",
UsingBranch: "", UsingBranch: "",
UsingDestination: "",
EffectDate: null, EffectDate: null,
RB_Group_Id: this.searchMsg.RB_Group_Id, RB_Group_Id: this.searchMsg.RB_Group_Id,
BalanceCyc: 1, BalanceCyc: 1,
...@@ -353,7 +376,17 @@ export default { ...@@ -353,7 +376,17 @@ export default {
} else { } else {
data.UsingLineArray = data.UsingLine.split(","); data.UsingLineArray = data.UsingLine.split(",");
data.UsingBranchArray = data.UsingBranch.split(","); data.UsingBranchArray = data.UsingBranch.split(",");
this.desctions=[]
if(data.UsingLine!='-1'){
this.desctionsResources.forEach(x=>{
if(data.UsingLineArray.indexOf(x.LineID.toString())!=-1){
this.desctions.push(x);
}
})
}
this.addMsg = data; this.addMsg = data;
this.addMsg.UsingDestinationArray = data.UsingDestination.split(",");
console.log(this.addMsg)
} }
this.changeShow(1); this.changeShow(1);
}, },
...@@ -364,6 +397,7 @@ export default { ...@@ -364,6 +397,7 @@ export default {
this.formLoading = true; this.formLoading = true;
this.addMsg.UsingLine = this.addMsg.UsingLineArray.join(","); this.addMsg.UsingLine = this.addMsg.UsingLineArray.join(",");
this.addMsg.UsingBranch = this.addMsg.UsingBranchArray.join(","); this.addMsg.UsingBranch = this.addMsg.UsingBranchArray.join(",");
this.addMsg.UsingDestination = this.addMsg.UsingDestinationArray.join(",");
this.apipost("sellcommission_rule_set", this.addMsg, x => { this.apipost("sellcommission_rule_set", this.addMsg, x => {
if (x.data.resultCode == 1) { if (x.data.resultCode == 1) {
this.changeShow(0); this.changeShow(0);
...@@ -540,11 +574,14 @@ export default { ...@@ -540,11 +574,14 @@ export default {
this.isReady = true; this.isReady = true;
}, },
changeData(type) { changeData(type) {
console.log('111111111111111')
let temp = []; let temp = [];
if (type == 1) { if (type == 1) {
temp = this.addMsg.UsingBranchArray; temp = this.addMsg.UsingBranchArray;
} else if (type == 2) { } else if (type == 2) {
temp = this.addMsg.UsingLineArray; temp = this.addMsg.UsingLineArray;
} else if (type == 3) {
temp = this.addMsg.UsingDestinationArray;
} }
let len = temp.length; let len = temp.length;
if (len > 1) { if (len > 1) {
...@@ -554,6 +591,17 @@ export default { ...@@ -554,6 +591,17 @@ export default {
temp.splice(temp.indexOf("-1"), 1); temp.splice(temp.indexOf("-1"), 1);
} }
} }
if(type==2 || type==3){
this.desctions=[]
if(type==2)
this.addMsg.UsingDestinationArray=['-1']
this.desctionsResources.forEach(x=>{
if(this.addMsg.UsingLineArray.indexOf(x.LineID.toString())!=-1){
this.desctions.push(x);
}
})
}
}, },
handleCurrentChanges(val) { handleCurrentChanges(val) {
this.pageIndex = val; this.pageIndex = val;
...@@ -569,16 +617,10 @@ export default { ...@@ -569,16 +617,10 @@ export default {
}, },
filterMethod(filters) { filterMethod(filters) {
console.log("filter", filters); console.log("filter", filters);
this.msg.Alias = filters.Alias; this.searchMsg.RuleName = filters.RuleName;
this.msg.RB_Branch_Id = filters.allName; this.searchMsg.UsingBranchArray = filters.BranchName;
this.msg.SettlementType = this.searchMsg.UsingLineArray = filters.LineName;
filters.Commission.length == 1 ? filters.Commission[0] : 0; this.getData();
this.msg.HaveContract =
filters.HaveContract.length == 1 ? filters.HaveContract[0] : -1;
this.msg.SigningLine = filters.SigningLine;
this.msg.Accountholder = filters.Accountholder;
this.msg.pageIndex = 1;
this.getList();
}, },
getCompanyList() { getCompanyList() {
//获取公司列表 //获取公司列表
...@@ -619,11 +661,34 @@ export default { ...@@ -619,11 +661,34 @@ export default {
this.tableData = x.data.data; this.tableData = x.data.data;
this.loading = false; this.loading = false;
}); });
},
getDesction(){
this.apipost(
"place_post_GetPageList",
{
LineID:0,
PlaceName:'',
pageIndex:1,
pageSize:5000
},
res => {
if (res.data.resultCode == 1) {
res.data.data.pageData.forEach(x=>{
if(x.IsShow==1)
this.desctionsResources.push(x)
})
//this.desctions=this.desctionsResources
//console.log(this.departmentList)
}
},
err => {}
);
} }
}, },
mounted() { mounted() {
this.searchMsg.RB_Group_Id = this.addMsg.RB_Group_Id = this.getLocalStorage().RB_Group_id; this.searchMsg.RB_Group_Id = this.addMsg.RB_Group_Id = this.getLocalStorage().RB_Group_id;
this.getCompanyList(); this.getCompanyList();
this.getDesction();
Vue.component("table-operation", { Vue.component("table-operation", {
template: `<div style='width:80px;height:40px;background:#fff;text-align:center;position: relative;left:-5px;padding-top: 6px;padding-top:6px;'><el-button type="primary" size='mini' icon="el-icon-edit" circle @click="update(rowData,index)"></el-button><el-button type="danger" size='mini' icon="el-icon-delete" circle @click="deleteRow(rowData,index)"></el-button></div>`, template: `<div style='width:80px;height:40px;background:#fff;text-align:center;position: relative;left:-5px;padding-top: 6px;padding-top:6px;'><el-button type="primary" size='mini' icon="el-icon-edit" circle @click="update(rowData,index)"></el-button><el-button type="danger" size='mini' icon="el-icon-delete" circle @click="deleteRow(rowData,index)"></el-button></div>`,
props: { props: {
......
<template> <template>
<div class="customerTransfer flexOne "> <div class="customerTransfer flexOne">
<div class="query-box" style="border: none;"> <div class="query-box" style="border: none;">
<ul style="overflow: initial!important"> <ul style="overflow: initial!important">
<li><span class="fl mt10"><em>部门</em></span> <li>
<treeselect class='w200 fl' <span class="fl mt10">
:options="departmentList" <em>部门</em>
@select='getEmployeeList' </span>
v-model="DepartmentId" <treeselect
placeholder="不限" class="w200 fl"
:normalizer="normalizer" :options="departmentList"
/> @select="getEmployeeList"
</li> v-model="DepartmentId"
<li><span><em>销售</em></span> placeholder="不限"
<el-select filterable v-model='msg.CreateBy'> :normalizer="normalizer"
<el-option label='不限' value='-1'></el-option> />
<el-option v-for='item in employeeList' </li>
:label='item.name' <li>
:value='item.empId' <span>
:key='item.empId'> <em>销售</em>
</el-option> </span>
</el-select> <el-select filterable v-model="msg.CreateBy">
</li> <el-option label="不限" value="-1"></el-option>
<li><span><em>关键字</em></span> <el-option
<el-input v-model='msg.CustomerName' placeholder="请输入门店名称或电话"></el-input> v-for="item in employeeList"
</li> :label="item.name"
<li><input type="button" class="hollowFixedBtn" value="查询" @click="resetPageIndex(),getList()" /> :value="item.empId"
<el-popover width='280' v-model='layerShow' popper-class='pd20' trigger="click"> :key="item.empId"
<div> ></el-option>
<p class="fz12 fbold mt10 color333">转交</p> </el-select>
<p class="fz12 mt30 color666"> </li>
<span>接收人</span>&nbsp; <li>
<el-select filterable class='w180' v-model='RecipientMsg.NewEmployeeId' placeholder="请选择"> <span>
<el-option v-for='item in employeeList1' <em>关键字</em>
:label='item.name' </span>
:value='item.empId' <el-input v-model="msg.CustomerName" placeholder="请输入门店名称或电话"></el-input>
:key='item.empId'> </li>
</el-option> <li>
</el-select> <input
</p> type="button"
<p class="fz12 mt30 color666"> class="hollowFixedBtn"
<span class="fl">备注</span>&nbsp;&nbsp;&nbsp;&nbsp; value="查询"
<el-input type='textarea' v-model='RecipientMsg.Remarks' class='w180'></el-input> @click="resetPageIndex(),getList()"
</p> >
<p> <el-popover width="280" v-model="layerShow" popper-class="pd20" trigger="click">
<input type="button" @click="save()" class="normalBtn mt30" value="批量转交"/> <div>
</p> <p class="fz12 fbold mt10 color333">转交</p>
</div> <p class="fz12 mt30 color666">
<input slot="reference" type="button" class="normalBtn" value="批量转交" @click="RecipientMsg.NewEmployeeId='',RecipientMsg.Remarks=''"/> <span>接收人</span>&nbsp;
</el-popover> <el-select
</li> filterable
</ul> class="w180"
</div> v-model="RecipientMsg.NewEmployeeId"
<div class="clearfix"></div> placeholder="请选择"
<div class="_customerTransferTable" :class="addShow==true?'_edHeight':''">
<table class="customerTransferTable mt20" border="0" cellspacing="0" cellpadding="0" v-loading='loading'>
<tr>
<th width="15%">
门店名称
<!--<label><input type="checkbox" v-model="isCkedAll" @click='checkedAll()' style="vertical-align: middle;"/>门店名称</label>-->
</th>
<th width="10%">
联系人
</th>
<th width="15%">联系电话</th>
<th width="20%">地址</th>
<th width="8%">所属销售</th>
<th width="8%">客户状态</th>
<th width="10%">备注</th>
<th width="10%">操作</th>
</tr>
<tr>
<td colspan="8" align="center" v-show='list.length==0'>
暂无数据
</td>
</tr>
<tr v-for='(item,index) in list'>
<td>
<label>
<input :disabled="item.disabled"
type="checkbox"
:value="item.CustomerId"
v-model="customerList"
@change="ckeckedOne" style="vertical-align: middle;"/>{{item.CustomerName}}</label>
</td>
<td>
{{item.Contact}}
</td>
<td><i class="iconfont icon-img_dianhua fz14" style="color:#09D49D;margin-right: 5px;"></i>{{item.ContactNumber}}</td>
<td>{{item.Address}}</td>
<td>{{item.EmName}}</td>
<td>{{valueToWord(item.CustomerStatus)}}</td>
<td>{{item.Remark}}</td>
<td>
<el-tooltip effect="dark" content="转交" placement="top-start">
<el-popover width='280' popper-class='pd20' trigger="click">
<div>
<p class="fz12 fbold mt10 color333">转交</p>
<p class="fz12 mt30 color666">
<span>接收人</span>&nbsp;
<el-select filterable class='w180' v-model='RecipientMsg.NewEmployeeId' placeholder="请选择">
<el-option v-for='item in employeeList1'
:label='item.name'
:value='item.empId'
:key='item.empId'>
</el-option>
</el-select>
</p>
<p class="fz12 mt30 color666">
<span class="fl">备注</span>&nbsp;&nbsp;&nbsp;&nbsp;
<el-input type='textarea' v-model='RecipientMsg.Remarks' class='w180'></el-input>
</p>
<p>
<input type="button" class="normalBtn mt30" @click="save" value="转交"/>
</p>
</div>
<i slot="reference" @click="singeleCked(item)" style="color: #019CED; font-size: 27px; cursor: pointer;" class="iconfont icon-zhuanjiao"></i>
</el-popover>
</el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('system.table_edit')" placement="top-start">
<el-button v-if="bossID===1 || bossID===5" type="primary" class="" icon="el-icon-edit" circle @click="updateData(item)"></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('system.table_delete')" placement="top-start">
<el-button v-if="bossID===1 || bossID===5" type="danger" class="" icon="el-icon-delete" circle @click="deletelist(item)"></el-button>
</el-tooltip>
</td>
</tr>
</table>
<el-pagination
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
layout="total,prev, pager, next, jumper"
:page-size=msg.pageSize
:total=total>
</el-pagination>
</div>
<div class="_mc_edit _scrollbar" :class="addShow==true?'edHeightOne':''">
<p class="_tit">新增客户
<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="联系电话:" prop="ContactNumber" >
<el-input :disabled="isOldPerson" v-model="addMsg.ContactNumber" @input='searchHistory(addMsg.ContactNumber)' placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="门店名称:" prop="CustomerName">
<el-input :disabled="isOldPerson" v-model="addMsg.CustomerName" placeholder="请输入" maxlength="20"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="联系人:" prop="Contact">
<el-input :disabled="isOldPerson" v-model="addMsg.Contact" placeholder="请输入" 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="地区:">
<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="详细地址:" prop="Address">
<el-input v-model="addMsg.Address" placeholder="请输入,精准到门牌号码" maxlength="50" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<!--<el-col :span="6">-->
<!--<el-form-item label="所属品牌:" 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="职务:" 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="经营场所:" 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="客户来源:" 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="备注:" 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="客户来源信息:" 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="名片照片:">
<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="门牌照片:">
<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"> <el-option
<i v-else class="el-icon-plus avatar-uploader-icon"></i> v-for="item in employeeList1"
</el-upload> :label="item.name"
</el-form-item> :value="item.empId"
</el-col> :key="item.empId"
<el-col :span="6"> ></el-option>
<el-form-item label="营业照片:"> </el-select>
<el-upload class="avatar-uploader" </p>
action="" <p class="fz12 mt30 color666">
:http-request="uploadImg2" <span class="fl">备注</span>&nbsp;&nbsp;&nbsp;&nbsp;
accept="image/jpeg,image/gif,image/png,image/bmp" <el-input type="textarea" v-model="RecipientMsg.Remarks" class="w180"></el-input>
:show-file-list="false" </p>
> <p>
<img v-if="Images" :src="Images" class="avatar"> <input type="button" @click="save()" class="normalBtn mt30" value="批量转交">
<i v-else class="el-icon-plus avatar-uploader-icon"></i> </p>
</el-upload> </div>
</el-form-item> <input
</el-col> slot="reference"
<el-col :span="6"> type="button"
</el-col> class="normalBtn"
</el-row> value="批量转交"
</el-form> @click="RecipientMsg.NewEmployeeId='',RecipientMsg.Remarks=''"
</div> >
</div> </el-popover>
</li>
</ul>
</div>
<div class="clearfix"></div>
<div class="_customerTransferTable" :class="addShow==true?'_edHeight':''">
<table
class="customerTransferTable mt20"
border="0"
cellspacing="0"
cellpadding="0"
v-loading="loading"
>
<tr>
<th width="15%">门店名称
<!--<label><input type="checkbox" v-model="isCkedAll" @click='checkedAll()' style="vertical-align: middle;"/>门店名称</label>-->
</th>
<th width="10%">联系人</th>
<th width="15%">联系电话</th>
<th width="20%">地址</th>
<th width="8%">所属销售</th>
<th width="8%">客户状态</th>
<th width="10%">备注</th>
<th width="10%">操作</th>
</tr>
<tr>
<td colspan="8" align="center" v-show="list.length==0">暂无数据</td>
</tr>
<tr v-for="(item,index) in list">
<td>
<label>
<input
:disabled="item.disabled"
type="checkbox"
:value="item.CustomerId"
v-model="customerList"
@change="ckeckedOne"
style="vertical-align: middle;"
>
{{item.CustomerName}}
</label>
</td>
<td>{{item.Contact}}</td>
<td>
<i class="iconfont icon-img_dianhua fz14" style="color:#09D49D;margin-right: 5px;"></i>
{{item.ContactNumber}}
</td>
<td>{{item.Address}}</td>
<td>{{item.EmName}}</td>
<td>{{valueToWord(item.CustomerStatus)}}</td>
<td>{{item.Remark}}</td>
<td>
<el-tooltip effect="dark" content="转交" placement="top-start">
<el-popover width="280" popper-class="pd20" trigger="click">
<div>
<p class="fz12 fbold mt10 color333">转交</p>
<p class="fz12 mt30 color666">
<span>接收人</span>&nbsp;
<el-select
filterable
class="w180"
v-model="RecipientMsg.NewEmployeeId"
placeholder="请选择"
>
<el-option
v-for="item in employeeList1"
:label="item.name"
:value="item.empId"
:key="item.empId"
></el-option>
</el-select>
</p>
<p class="fz12 mt30 color666">
<span class="fl">备注</span>&nbsp;&nbsp;&nbsp;&nbsp;
<el-input type="textarea" v-model="RecipientMsg.Remarks" class="w180"></el-input>
</p>
<p>
<input type="button" class="normalBtn mt30" @click="save" value="转交">
</p>
</div>
<i
slot="reference"
@click="singeleCked(item)"
style="color: #019CED; font-size: 27px; cursor: pointer;"
class="iconfont icon-zhuanjiao"
></i>
</el-popover>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
:content="$t('system.table_edit')"
placement="top-start"
>
<el-button
v-if="bossID===1 || bossID===5"
type="primary"
class
icon="el-icon-edit"
circle
@click="updateData(item)"
></el-button>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
:content="$t('system.table_delete')"
placement="top-start"
>
<el-button
v-if="bossID===1 || bossID===5"
type="danger"
class
icon="el-icon-delete"
circle
@click="deletelist(item)"
></el-button>
</el-tooltip>
</td>
</tr>
</table>
<el-pagination
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
layout="total,prev, pager, next, jumper"
:page-size="msg.pageSize"
:total="total"
></el-pagination>
</div>
<div class="_mc_edit _scrollbar" :class="addShow==true?'edHeightOne':''">
<p class="_tit">
新增客户
<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="联系电话:" prop="ContactNumber">
<el-input
:disabled="isOldPerson"
v-model="addMsg.ContactNumber"
@input="searchHistory(addMsg.ContactNumber)"
placeholder="请输入"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="门店名称:" prop="CustomerName">
<el-input
:disabled="isOldPerson"
v-model="addMsg.CustomerName"
placeholder="请输入"
maxlength="20"
></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="联系人:" prop="Contact">
<el-input
:disabled="isOldPerson"
v-model="addMsg.Contact"
placeholder="请输入"
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="地区:">
<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="详细地址:" prop="Address">
<el-input v-model="addMsg.Address" placeholder="请输入,精准到门牌号码" maxlength="50"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<!--<el-col :span="6">-->
<!--<el-form-item label="所属品牌:" 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="职务:" 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="经营场所:" 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="客户来源:" 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="备注:" 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="客户来源信息:" 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="名片照片:">
<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="门牌照片:">
<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="营业照片:">
<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>
</div>
</template> </template>
<script> <script>
import Treeselect from '@riophae/vue-treeselect' import Treeselect from "@riophae/vue-treeselect";
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
components: { Treeselect }, components: { Treeselect },
data(){ data() {
return{ return {
normalizer(node) { normalizer(node) {
return { return {
id: node.DepartmentId, id: node.DepartmentId,
label: node.DepartmentName, label: node.DepartmentName,
children: node.ChildList, children: node.ChildList
} };
}, },
DepartmentId:null, DepartmentId: null,
isSelLayer:false, isSelLayer: false,
layerShow:false, layerShow: false,
msg:{ msg: {
pageIndex:1, pageIndex: 1,
pageSize:15, pageSize: 15,
CustomerName:'', CustomerName: "",
CreateBy:'-1', CreateBy: "-1",
DepartmentId:'-1', DepartmentId: "-1"
}, },
RecipientMsg:{ RecipientMsg: {
CustomerIdArr:[], CustomerIdArr: [],
NewEmployeeId:'', NewEmployeeId: "",
Remarks:'', Remarks: ""
}, },
departmentMsg: { departmentMsg: {
RB_Group_Id: '0', RB_Group_Id: "0",
RB_Branch_Id:'0', RB_Branch_Id: "0",
Status:'0', Status: "0",
ParentId:'-1', ParentId: "-1",
Tier:'0', Tier: "0"
}, },
employeeMsg: { employeeMsg: {
RB_Group_id:'0', RB_Group_id: "0",
RB_Branch_id:'-1', RB_Branch_id: "-1",
departmentId:'0', departmentId: "0",
IsLeave:'0', IsLeave: "0"
}, },
isCkedAll:false, isCkedAll: false,
addShow: false, addShow: false,
customerListAll:[], customerListAll: [],
customerList:[], customerList: [],
allLength:0, allLength: 0,
loading:false, loading: false,
currentPage:1, currentPage: 1,
total:0, total: 0,
list:[], list: [],
CreateByInfoList:[], CreateByInfoList: [],
RecipientInfoList:[], RecipientInfoList: [],
departmentList: [], departmentList: [],
allowAdd:true, allowAdd: true,
employeeList:[], employeeList: [],
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: ""
}, },
defaultImg: 'this.src="' + require("../../assets/img/litheader.png") + '"', defaultImg:
BusinessCardPhotos:'', 'this.src="' + require("../../assets/img/litheader.png") + '"',
HousePhotos:'', BusinessCardPhotos: "",
Images:'', HousePhotos: "",
isOldPerson:false, Images: "",
CustomerBrandList:[], isOldPerson: false,
provinceList:[], CustomerBrandList: [],
cityList:[], provinceList: [],
regionList:[], cityList: [],
jycs:[], //经营场所 regionList: [],
zw:[], //职务 jycs: [], //经营场所
khly:[], zw: [], //职务
addMsgS:{ khly: [],
isPreFilled:true, addMsgS: {
customerInfo:{}, isPreFilled: true,
customerVisit:{ customerInfo: {},
remark:'', customerVisit: {
expectVisitDateTime:'', remark: "",
expectHour:0 expectVisitDateTime: "",
expectHour: 0
}
},
bossID: "",
rules: {
Contact: [{ required: true, message: "请输入联系人", trigger: "blur" }],
CustomerName: [
{ required: true, message: "请输入客户名", trigger: "blur" }
],
ContactNumber: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
{
pattern: this.$commonUtils.Regex.el_ISphone,
message: "请输入正确的电话"
}
],
brandIds: [
{ required: true, message: "请选择所属品牌", trigger: "change" }
],
Duty: [{ required: true, message: "请选择职务", trigger: "change" }],
remark: [{ required: false, message: "请选择职务", trigger: "change" }],
Premises: [
{ required: true, message: "请选择经营场所", trigger: "change" }
],
CustomerSourceType: [
{ required: true, message: "请选择经客户来源", trigger: "change" }
],
CustomerName: [
{ required: true, message: "请输入客户名", trigger: "blur" }
],
Address: [{ required: true, message: "请输入地址", trigger: "blur" }]
},
employeeList1: []
};
},
methods: {
updateData: function(obj) {
this.apipost(
"app_customer_GetLeaderCustomerInfo",
{ customerId: obj.CustomerIdS },
res => {
if (res.data.resultCode == 1) {
let data = res.data.data;
console.log(data);
let Address = data.Address.split(",");
this.addMsg = data;
this.addMsg.Address = Address[1];
this.$message.success(res.data.message);
this.addShow = true;
this.getCity1();
this.getRegion1();
} else {
this.$message.success(res.data.message);
}
},
null
);
},
deletelist: function(obj) {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.apipost(
"app_customer_LeaderRemove",
{ ID: obj.CustomerIdS, saleID: obj.EmployeeId },
res => {
if (res.data.resultCode == 1) {
this.$message.success("删除成功!");
this.getList();
} }
}, },
bossID:'', err => {}
rules:{ );
Contact:[{required: true, message: "请输入联系人", trigger: "blur"}], })
CustomerName:[{required: true, message: "请输入客户名", trigger: "blur"}], .catch(() => {
ContactNumber:[ this.$message.info("已取消删除!");
{required: true, message: "请输入联系电话", trigger: "blur"}, });
{ pattern: this.$commonUtils.Regex.el_ISphone, message: "请输入正确的电话" } },
], saveVisa() {
brandIds:[{required: true, message: "请选择所属品牌", trigger: "change"}], // 保存
Duty:[{required: true, message: "请选择职务", trigger: "change"}], if (this.addMsg.District == "") {
remark:[{required: false, message: "请选择职务", trigger: "change"}], this.addMsg.District = 0;
Premises:[{required: true, message: "请选择经营场所", trigger: "change"}], }
CustomerSourceType:[{required: true, message: "请选择经客户来源", trigger: "change"}], this.addMsgS.customerInfo = this.addMsg;
CustomerName:[{required: true, message: "请输入客户名", trigger: "blur"}], if (this.BusinessCardPhotos) {
Address:[{required: true, message: "请输入地址", trigger: "blur"}], this.addMsg.BusinessCardPhotos = [];
}, this.addMsg.BusinessCardPhotos.push(this.BusinessCardPhotos);
employeeList1:[] }
} if (this.HousePhotos) {
}, this.addMsg.HousePhotos = [];
methods:{ this.addMsg.HousePhotos.push(this.HousePhotos);
updateData: function (obj) { }
this.apipost('app_customer_GetLeaderCustomerInfo', {customerId:obj.CustomerIdS}, res=>{ if (this.Images) {
if (res.data.resultCode==1) { this.addMsg.Images = [];
let data = res.data.data; this.addMsg.Images.push(this.Images);
console.log(data) }
let Address = data.Address.split(',') let sheng = "";
this.addMsg = data; let shi = "";
this.addMsg.Address = Address[1] let qu = "";
this.$message.success(res.data.message); if (this.addMsg.District == "") {
this.addShow = true; 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_customer_LeaderUpdateCustomer",
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 => {}
);
},
uploadImg(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.uploadFile(path, newArr, x => {
this.BusinessCardPhotos = x.res.requestUrls[0].split("?")[0];
});
},
uploadImg1(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.uploadFile(path, newArr, x => {
this.HousePhotos = x.res.requestUrls[0].split("?")[0];
});
},
uploadImg2(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.uploadFile(path, newArr, x => {
this.Images = x.res.requestUrls[0].split("?")[0];
});
},
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_GetAreaChildList",
{ Id: 2, level: 1 },
res => {
if (res.data.resultCode == 1) {
this.provinceList = res.data.data;
}
},
err => {}
);
},
getCity() {
this.apipost(
"app_customer_GetAreaChildList",
{ 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_GetAreaChildList",
{ 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_GetAreaChildList",
{ Id: this.addMsg.Province, level: 2 },
res => {
if (res.data.resultCode == 1) {
this.cityList = res.data.data;
}
},
err => {}
);
},
getRegion1() {
this.apipost(
"app_customer_GetAreaChildList",
{ Id: this.addMsg.City, level: 3 },
res => {
if (res.data.resultCode == 1) {
this.regionList = res.data.data;
}
},
err => {}
);
},
searchHistory(val) {
if (val.length == 11) {
this.apipost(
"app_customer_GetCustomerByContactNumber",
{ ContactNumber: val },
res => {
if (res.data.resultCode == 1) {
if (res.data.data.customerInfo.customerId > 0) {
this.isOldPerson = true;
let x = res.data.data.customerInfo;
console.log(res.data.data);
this.addMsg = x;
this.addMsg.Province = x.province;
this.addMsg.customerId = x.customerId;
this.getCity1(); this.getCity1();
this.addMsg.City = x.city;
this.getRegion1(); this.getRegion1();
} else { this.addMsg.District = x.district;
this.$message.success(res.data.message); this.addMsg.Duty = x.duty;
} this.addMsg.Premises = x.premises;
}, null) this.addMsg.CustomerSourceType = x.customerSourceType;
}, let dictid = [];
deletelist: function (obj) { res.data.data.brandList.forEach(x => {
this.$confirm('是否删除?', '提示', { dictid.push(x.dictId);
confirmButtonText: '确定', });
cancelButtonText: '取消', this.addMsg.brandIds = dictid;
type: 'warning'
}).then(() => { if (x.businessCardPhotos && x.businessCardPhotos.length > 0) {
this.apipost('app_customer_LeaderRemove',{ID:obj.CustomerIdS,saleID:obj.EmployeeId},res=>{ this.BusinessCardPhotos = x.businessCardPhotos[0];
if(res.data.resultCode==1){
this.$message.success('删除成功!');
this.getList()
} }
},err=>{}) if (x.images && x.images.length > 0) {
}).catch(() => { this.Images = x.images[0];
this.$message.info('已取消删除!'); }
}); 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_customer_LeaderUpdateCustomer',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=>{})
},
uploadImg(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.uploadFile(path, newArr, x => {
this.BusinessCardPhotos=x.res.requestUrls[0].split("?")[0]
});
},
uploadImg1(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.uploadFile(path, newArr, x => {
this.HousePhotos=x.res.requestUrls[0].split("?")[0]
});
},
uploadImg2(file) {
//上传
let newArr = [];
newArr.push(file.file);
let path = "/Upload/Temporary/";
this.uploadFile(path, newArr, x => {
this.Images=x.res.requestUrls[0].split("?")[0]
});
},
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_GetAreaChildList',{Id:2,"level":1},res=>{
if(res.data.resultCode==1){
this.provinceList=res.data.data
}
},err=>{})
},
getCity(){
this.apipost('app_customer_GetAreaChildList',{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_GetAreaChildList',{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_GetAreaChildList',{Id:this.addMsg.Province,"level":2},res=>{
if(res.data.resultCode==1){
this.cityList=res.data.data
} }
},err=>{}) this.allowAdd = true;
}, } else {
getRegion1(){ if (res.data.message.indexOf("已注册客户信息") != -1) {
this.apipost('app_customer_GetAreaChildList',{Id:this.addMsg.City,"level":3},res=>{ this.allowAdd = false;
if(res.data.resultCode==1){
this.regionList=res.data.data
} }
},err=>{}) this.$message.error(res.data.message);
},
searchHistory(val){
if(val.length==11){
this.apipost('app_customer_GetCustomerByContactNumber',{ContactNumber:val},res=>{
if(res.data.resultCode==1){
if(res.data.data.customerInfo.customerId>0)
{
this.isOldPerson=true
let x=res.data.data.customerInfo
console.log(res.data.data)
this.addMsg=x
this.addMsg.Province=x.province
this.addMsg.customerId=x.customerId
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{}
},
valueToWord(val){
if(val==0)
return '未拜访'
if(val==1)
return '已沟通'
if(val==2)
return '审核通过'
if(val==3)
return '审核拒绝'
},
checkedAll() { //全选
if(this.isCkedAll == true) {
this.customerList = []
} else {
this.customerListAll.forEach(item => {
this.customerList.push(item)
})
}
},
ckeckedOne() { //单选
if(this.customerList.length>0)
{
let dpId=this.customerList[0].split('|')[2]
this.employeeMsg.departmentId=dpId
this.isSelLayer=true
this.getEmployee()
this.list.forEach(item=>{
if(item.RB_Department_Id!=dpId){
item.disabled=true
}
})
}else{
this.isSelLayer=false
this.employeeList1=[]
this.list.forEach(item=>{
item.disabled=false
})
}
},
singeleCked(obj){
console.log(obj)
this.isSelLayer=true
this.customerList = []
this.customerList.push(obj.CustomerId)
this.employeeMsg.departmentId=obj.RB_Department_Id
this.getEmployee()
this.ckeckedOne()
this.RecipientMsg.NewEmployeeId=''
this.RecipientMsg.Remarks=''
},
save(){
this.RecipientMsg.CustomerIdArr=[]
this.customerList.forEach(item=>{
this.RecipientMsg.CustomerIdArr.push(item)
})
if(this.RecipientMsg.NewEmployeeId=='')
{
this.$message.error('请选择转交人')
return
}
this.apipost('app_customer_SetCustomerCareOfBatch',this.RecipientMsg,res=>{
if(res.data.resultCode==1){
this.$message.success(res.data.message)
this.getList()
this.RecipientMsg.NewEmployeeId=''
this.RecipientMsg.Remarks=''
this.layerShow=false
this.customerList = []
}else{
this.$message.error(res.data.message)
}
},err=>{})
},
getList(){
this.loading=true
this.apipost('app_customer_GetCustomerListForCareOf',this.msg,res=>{
if(res.data.resultCode==1){
this.loading=false
this.allLength=res.data.data.pageData.length
this.customerListAll=[]
res.data.data.pageData.forEach(item=>{
this.customerListAll.push(item.CustomerId)
item.CustomerIdS = item.CustomerId
item.CustomerId=item.CustomerId+'|'+item.EmployeeId+'|'+item.RB_Department_Id
item['disabled']=false
item.Address=item.Address.split(',').join('')
})
this.list=res.data.data.pageData
this.total=res.data.data.count
}else{
this.$message.error(res.data.message)
this.loading=false
}
},err=>{})
},
getDepartment(){
this.apipost('Advertising_get_GetNowDepartmentAndSubordinate',{},res=>{
if(res.data.resultCode==1){
this.departmentList=res.data.data
//console.log(this.departmentList)
}else{
this.$message.error(res.data.message)
}
},err=>{})
},
getEmployeeList(node,id){
this.isSelLayer=false
this.msg.CreateBy='-1'
this.msg.DepartmentId=this.employeeMsg.departmentId=node.DepartmentId
this.getEmployee()
},
getEmployee() {
this.employeeMsg.departmentId=0
this.employeeMsg.RB_Group_id=this.getLocalStorage().RB_Group_id
this.employeeMsg.RB_Branch_id=-1
this.apipost('app_get_company_employee', this.employeeMsg, res => {
if(res.data.resultCode == 1) {
if(!this.isSelLayer)
{
this.employeeList = res.data.data;
}else{
this.employeeList1 = res.data.data;
}
}
}, err => {})
},
getCreateByInfoList(){
this.apipost('app_customer_GetDepartmentEmployee',this.msg,res=>{
if(res.data.resultCode==1){
this.CreateByInfoList=res.data.data.leaveList
this.RecipientInfoList=res.data.data.noLeaveList
}else{
this.$message.error(res.data.message)
}
},err=>{})
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList()
},
resetPageIndex() {
this.msg.pageIndex = 1;
this.currentPage = 1
},
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) { // 重置表单 err => {}
this.$refs[formName].resetFields(); );
}, } else {
}, }
},
valueToWord(val) {
if (val == 0) return "未拜访";
if (val == 1) return "已沟通";
if (val == 2) return "审核通过";
if (val == 3) return "审核拒绝";
},
checkedAll() {
//全选
if (this.isCkedAll == true) {
this.customerList = [];
} else {
this.customerListAll.forEach(item => {
this.customerList.push(item);
});
}
},
ckeckedOne() {
//单选
if (this.customerList.length > 0) {
let dpId = this.customerList[0].split("|")[2];
this.employeeMsg.departmentId = dpId;
this.isSelLayer = true;
this.getEmployee();
this.list.forEach(item => {
if (item.RB_Department_Id != dpId) {
item.disabled = true;
}
});
} else {
this.isSelLayer = false;
this.employeeList1 = [];
this.list.forEach(item => {
item.disabled = false;
});
}
},
singeleCked(obj) {
console.log(obj);
this.isSelLayer = true;
this.customerList = [];
this.customerList.push(obj.CustomerId);
this.employeeMsg.departmentId = obj.RB_Department_Id;
this.getEmployee();
this.ckeckedOne();
this.RecipientMsg.NewEmployeeId = "";
this.RecipientMsg.Remarks = "";
},
save() {
this.RecipientMsg.CustomerIdArr = [];
this.customerList.forEach(item => {
this.RecipientMsg.CustomerIdArr.push(item);
});
if (this.RecipientMsg.NewEmployeeId == "") {
this.$message.error("请选择转交人");
return;
}
this.apipost(
"app_customer_SetCustomerCareOfBatch",
this.RecipientMsg,
res => {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.getList();
this.RecipientMsg.NewEmployeeId = "";
this.RecipientMsg.Remarks = "";
this.layerShow = false;
this.customerList = [];
} else {
this.$message.error(res.data.message);
}
},
err => {}
);
},
getList() {
this.loading = true;
this.apipost(
"app_customer_GetCustomerListForCareOf",
this.msg,
res => {
if (res.data.resultCode == 1) {
this.loading = false;
this.allLength = res.data.data.pageData.length;
this.customerListAll = [];
res.data.data.pageData.forEach(item => {
this.customerListAll.push(item.CustomerId);
item.CustomerIdS = item.CustomerId;
item.CustomerId =
item.CustomerId +
"|" +
item.EmployeeId +
"|" +
item.RB_Department_Id;
item["disabled"] = false;
item.Address = item.Address.split(",").join("");
});
this.list = res.data.data.pageData;
this.total = res.data.data.count;
} else {
this.$message.error(res.data.message);
this.loading = false;
}
},
err => {}
);
},
getDepartment() {
this.apipost(
"Advertising_get_GetNowDepartmentAndSubordinate",
{},
res => {
if (res.data.resultCode == 1) {
this.departmentList = res.data.data;
//console.log(this.departmentList)
} else {
this.$message.error(res.data.message);
}
},
err => {}
);
},
getEmployeeList(node, id) {
this.isSelLayer = false;
this.msg.CreateBy = "-1";
this.msg.DepartmentId = this.employeeMsg.departmentId = node.DepartmentId;
this.getEmployee();
},
getEmployee() {
this.employeeMsg.departmentId = 0;
this.employeeMsg.RB_Group_id = this.getLocalStorage().RB_Group_id;
this.employeeMsg.RB_Branch_id = -1;
this.apipost(
"app_get_company_employee",
this.employeeMsg,
res => {
if (res.data.resultCode == 1) {
if (!this.isSelLayer) {
this.employeeList = res.data.data;
} else {
this.employeeList1 = res.data.data;
}
}
},
err => {}
);
},
getCreateByInfoList() {
this.apipost(
"app_customer_GetDepartmentEmployee",
this.msg,
res => {
if (res.data.resultCode == 1) {
this.CreateByInfoList = res.data.data.leaveList;
this.RecipientInfoList = res.data.data.noLeaveList;
} else {
this.$message.error(res.data.message);
}
},
err => {}
);
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
resetPageIndex() {
this.msg.pageIndex = 1;
this.currentPage = 1;
},
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();
}
},
mounted(){ mounted() {
let userInfo = this.getLocalStorage(); let userInfo = this.getLocalStorage();
this.bossID = userInfo.EmployeeId; this.bossID = userInfo.EmployeeId;
this.departmentMsg.RB_Group_Id = userInfo.RB_Group_id; //集团 this.departmentMsg.RB_Group_Id = userInfo.RB_Group_id; //集团
this.getDepartment() this.getDepartment();
this.getEmployee() this.getEmployee();
this.getList() this.getList();
this.getCreateByInfoList() this.getCreateByInfoList();
this.getProvince() this.getProvince();
this.getJycs() this.getJycs();
this.getZw() this.getZw();
this.getKhly() this.getKhly();
}, }
} };
</script> </script>
<style> <style>
.customerTransferTable{width: 100%; font-size:14px; color: #333;border: 1px solid #DCDCDC; box-sizing: border-box; border-bottom: none; border-right: none;} .customerTransferTable {
.customerTransferTable tr th{background: #DCDCDC;height:30px; font-size: 12px; text-align: left; text-indent: 25px;} width: 100%;
.customerTransferTable tr{text-align: left;} font-size: 14px;
.customerTransferTable tr:nth-child(2n){background:#F2F2F2;} color: #333;
.customerTransferTable tr:nth-child(2n+1){background:#FFFFFF;} border: 1px solid #dcdcdc;
.customerTransferTable tr:hover{background:#D0D2D9;} box-sizing: border-box;
.customerTransferTable tr td{height: 40px; padding-left:25px; border-bottom:1px solid #DCDCDC; font-size: 14px; color: #333; border-right: 1px solid #DCDCDC;} border-bottom: none;
.pd20{padding: 12px 20px !important; } border-right: none;
.el-popper[x-placement^=bottom]{margin-top: 0px !important;} }
.el-popper[x-placement^=top]{margin-bottom: 0px !important;} .customerTransferTable tr th {
.customerTransferTable .el-button { background: #dcdcdc;
position: relative; height: 30px;
top: -5px; font-size: 12px;
} text-align: left;
.customerTransferTable .el-button+.el-button{ text-indent: 25px;
margin: 0; }
} .customerTransferTable tr {
.customerTransfer ._mc_edit{overflow: auto;display: none;position:absolute; text-align: left;
z-index: 50; bottom:0;left: 0;border-top:3px solid #38425d;background-color:#f9f9f9; padding: 10px;width: 100%;min-width: 1146px;} }
.customerTransfer ._mc_edit ._tit{padding-left: 10px;border-left: 3px solid #E95252; font-size: 16px; font-family: 'PingFangSc-Fine'; color: #000000} .customerTransferTable tr:nth-child(2n) {
.customerTransfer ._mc_edit ._info_box ul._form li{float: left;} background: #f2f2f2;
.customerTransfer .edHeightOne{display: block!important;height: 450px;} }
.customerTransfer ._edHeight{height:340px;} .customerTransferTable tr:nth-child(2n + 1) {
.customerTransfer ._remark textarea{resize: none;width: 646px;height: 100px} background: #ffffff;
.customerTransfer .avatar-uploader .el-upload { }
border: 1px dashed #d9d9d9; .customerTransferTable tr:hover {
border-radius: 6px; background: #d0d2d9;
cursor: pointer; }
position: relative; .customerTransferTable tr td {
overflow: hidden; height: 40px;
} padding-left: 25px;
.customerTransfer .avatar-uploader .el-upload:hover { border-bottom: 1px solid #dcdcdc;
border-color: #409EFF; font-size: 14px;
} color: #333;
.customerTransfer .avatar-uploader-icon { border-right: 1px solid #dcdcdc;
font-size: 28px; }
color: #8c939d; .pd20 {
width: 148px; padding: 12px 20px !important;
height: 148px; }
line-height: 148px; .el-popper[x-placement^="bottom"] {
text-align: center; margin-top: 0px !important;
} }
.customerTransfer .avatar { .el-popper[x-placement^="top"] {
width: 148px; margin-bottom: 0px !important;
height: 148px; }
display: block; .customerTransferTable .el-button {
} position: relative;
top: -5px;
}
.customerTransferTable .el-button + .el-button {
margin: 0;
}
.customerTransfer ._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;
}
.customerTransfer ._mc_edit ._tit {
padding-left: 10px;
border-left: 3px solid #e95252;
font-size: 16px;
font-family: "PingFangSc-Fine";
color: #000000;
}
.customerTransfer ._mc_edit ._info_box ul._form li {
float: left;
}
.customerTransfer .edHeightOne {
display: block !important;
height: 450px;
}
.customerTransfer ._edHeight {
height: 340px;
}
.customerTransfer ._remark textarea {
resize: none;
width: 646px;
height: 100px;
}
.customerTransfer .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.customerTransfer .avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.customerTransfer .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 148px;
height: 148px;
line-height: 148px;
text-align: center;
}
.customerTransfer .avatar {
width: 148px;
height: 148px;
display: block;
}
</style> </style>
...@@ -104,8 +104,8 @@ ...@@ -104,8 +104,8 @@
"sellcommission_SetGenerateCommission",msg, "sellcommission_SetGenerateCommission",msg,
res => { res => {
if(res.data.resultCode==1){ if(res.data.resultCode==1){
this.dataList = res.data.data.pageData; this.getList();
this.total = res.data.data.count; this.Success('报表生成成功')
}else{ }else{
this.Error(res.data.message); this.Error(res.data.message);
} }
......
...@@ -144,6 +144,9 @@ export default { ...@@ -144,6 +144,9 @@ export default {
}, },
goUrl(url) { goUrl(url) {
if(url!=null&&url.length>0){ if(url!=null&&url.length>0){
if(url.indexOf('http://')==-1 || url.indexOf('https://')==-1){
url='http://'+url;
}
window.open(url, "_blank"); window.open(url, "_blank");
} }
} }
......
...@@ -146,6 +146,9 @@ export default { ...@@ -146,6 +146,9 @@ export default {
}, },
goUrl(url) { goUrl(url) {
if(url!=null&&url.length>0){ if(url!=null&&url.length>0){
if(url.indexOf('http://')==-1 || url.indexOf('https://')==-1){
url='http://'+url;
}
window.open(url, "_blank"); window.open(url, "_blank");
} }
} }
......
...@@ -116,6 +116,9 @@ export default { ...@@ -116,6 +116,9 @@ export default {
}, },
goUrl(url) { goUrl(url) {
if(url!=null&&url.length>0){ if(url!=null&&url.length>0){
if(url.indexOf('http://')==-1 || url.indexOf('https://')==-1){
url='http://'+url;
}
window.open(url, "_blank"); window.open(url, "_blank");
} }
} }
......
...@@ -184,6 +184,9 @@ export default { ...@@ -184,6 +184,9 @@ export default {
}, },
goUrl(url) { goUrl(url) {
if(url!=null&&url.length>0){ if(url!=null&&url.length>0){
if(url.indexOf('http://')==-1 || url.indexOf('https://')==-1){
url='http://'+url;
}
window.open(url, "_blank"); window.open(url, "_blank");
} }
} }
......
...@@ -113,6 +113,9 @@ export default { ...@@ -113,6 +113,9 @@ export default {
}, },
goUrl(url) { goUrl(url) {
if(url!=null&&url.length>0){ if(url!=null&&url.length>0){
if(url.indexOf('http://')==-1 || url.indexOf('https://')==-1){
url='http://'+url;
}
window.open(url, "_blank"); window.open(url, "_blank");
} }
} }
......
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