|
|
|
@ -11,8 +11,7 @@
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="3" style="padding-left: 10px;">
|
|
|
|
|
<Select v-model="regionId" filterable style="width: 200px;" @on-change="regionSelect" >
|
|
|
|
|
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}
|
|
|
|
|
</Option>
|
|
|
|
|
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="2" style="text-align: right;">
|
|
|
|
@ -20,8 +19,7 @@
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="3" style="padding-left: 10px;">
|
|
|
|
|
<Select v-model="companyId" filterable style="width: 200px;" @on-change="companySelect" >
|
|
|
|
|
<Option v-for="item in companyList" :value="item.id" :key="item.id">{{ item.name }}
|
|
|
|
|
</Option>
|
|
|
|
|
<Option v-for="item in companyList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="1" style="text-align: right;">
|
|
|
|
@ -29,8 +27,7 @@
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="3" style="padding-left: 10px;">
|
|
|
|
|
<Select v-model="selectedStore" filterable style="width: 200px;">
|
|
|
|
|
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.name }}
|
|
|
|
|
</Option>
|
|
|
|
|
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="1" style="padding-left: 20px;">
|
|
|
|
@ -205,6 +202,7 @@
|
|
|
|
|
regionId: 0,
|
|
|
|
|
//零售公司list
|
|
|
|
|
companyList: [],
|
|
|
|
|
customerList: [],
|
|
|
|
|
companyId: 0,
|
|
|
|
|
|
|
|
|
|
errorList: [],
|
|
|
|
@ -325,7 +323,7 @@
|
|
|
|
|
this.getSelectList();
|
|
|
|
|
// this.downBigRegionData();
|
|
|
|
|
// this.downRegionData();
|
|
|
|
|
// this.downShopData();
|
|
|
|
|
this.downShopData();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
searchCustomerDataBtnClick: function () {
|
|
|
|
@ -415,23 +413,41 @@
|
|
|
|
|
this.insertAllOption();
|
|
|
|
|
this.companyId = 0;
|
|
|
|
|
//加载店铺
|
|
|
|
|
|
|
|
|
|
this.downShopData();
|
|
|
|
|
},
|
|
|
|
|
//零售公司选择
|
|
|
|
|
companySelect: function(){
|
|
|
|
|
companySelect: function(value){
|
|
|
|
|
//加载店铺
|
|
|
|
|
this.selectedRegion = value;
|
|
|
|
|
this.downShopData(value);
|
|
|
|
|
},
|
|
|
|
|
downCompanyChange: function (formValidate) {
|
|
|
|
|
this.downShopData(formValidate.departIds);
|
|
|
|
|
},
|
|
|
|
|
downShopData: function (selected) {
|
|
|
|
|
let that = this;
|
|
|
|
|
let selectValue = selected;
|
|
|
|
|
let companyId = selected;
|
|
|
|
|
if (!selected){
|
|
|
|
|
selectValue = that.selectedRegion
|
|
|
|
|
companyId = that.companyId;
|
|
|
|
|
}
|
|
|
|
|
let regionId = that.regionId;
|
|
|
|
|
let customerIds = [];
|
|
|
|
|
if(regionId === 0){
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
this.companyList = this.organizationalList.filter(item => item.parentId === regionId && item.level === 2);
|
|
|
|
|
let companyIds = this.companyList.map(item => item.id);
|
|
|
|
|
this.customerList = this.organizationalList.filter(item => companyIds.indexOf(item.parentId) !== -1 && item.level === 3);
|
|
|
|
|
}
|
|
|
|
|
if(companyId === 0){
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
this.customerList = this.organizationalList.filter(item => item.parentId === companyId && item.level === 3);
|
|
|
|
|
}
|
|
|
|
|
customerIds = this.customerList.map(item => item.id);
|
|
|
|
|
|
|
|
|
|
let request =
|
|
|
|
|
{userId: that.userId,companyId: that.changeData(selectValue),bigRegionId: that.changeData(that.selectedBigRegion)};
|
|
|
|
|
{userId: that.userId,customerIds: customerIds};
|
|
|
|
|
staff.downShopData(request, function (data) {
|
|
|
|
|
data = data.data.results;
|
|
|
|
|
if(data){
|
|
|
|
|