门店号管理修改bug

master
LegnaYet 6 years ago
parent 386d8089f5
commit fc129b9dc3

@ -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){

Loading…
Cancel
Save