门店号管理修改bug

master
LegnaYet 6 years ago
parent 386d8089f5
commit fc129b9dc3

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

Loading…
Cancel
Save