推广店铺,下拉框

master
wyj2080 6 years ago
parent 54a84b695b
commit f91e0742f2

@ -1,6 +1,6 @@
<template>
<div>
<Menu mode="horizontal" :active-name="selectedItemName" v-model="this.threeLevel[0].id">
<Menu ref="menu" mode="horizontal" :active-name="selectedItemName" v-model="this.threeLevel[0].id">
<MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel"
:key="cItem.id">
{{cItem.name}}
@ -17,10 +17,14 @@
name: "ShopIncrease",
data() {
return {
threeLevel: null,
selectedItemName: [],
threeLevel: [],
selectedItemName: null,
}
},
created() {
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit();
},
mounted() {
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit();
@ -28,9 +32,9 @@
methods:{
menuInit(){
let that = this;
that.selectedItemName = [that.threeLevel[0].id];
that.selectedItemName = that.threeLevel[0].id;
this.$nextTick(() => {
this.$refs.menu.updateActiveName();
that.$refs.menu.updateActiveName();
});
}
}

@ -10,8 +10,8 @@
<span class="region">大区</span>
</i-col>
<i-col span="3" style="padding-left: 10px;">
<Select v-model="selectedBigRegion" filterable style="width: 200px;" @on-change="downBigRegionChange" >
<Option v-for="item in bigRegionList" :value="item.id" :key="item.id">{{ item.name }}
<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>
</Select>
</i-col>
@ -19,8 +19,8 @@
<span class="region">零售公司</span>
</i-col>
<i-col span="3" style="padding-left: 10px;">
<Select v-model="selectedRegion" filterable style="width: 200px;" @on-change="downRegionChange" >
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}
<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>
</Select>
</i-col>
@ -46,10 +46,10 @@
</Row>
<Table :columns="columns1" :data="data1" style="margin-top: 20px;">
<template slot-scope="{ row, index }" slot="qrCodeAction">
<template slot-scope="row" slot="qrCodeAction">
<img :src="require('../../../static/img/qrCode-init.png')" @click="show(row)" @mouseover="show(row)" style="margin-left: 5px;margin-top: 5px;width:30px;height:30px;"/>
</template>
<router-link slot-scope="{ row, index }" slot="action" :to="{path:'/shop/increase/manager/staff',query:{storeId:row.id}}">
<router-link slot-scope="row" slot="action" :to="{path:'/shop/increase/manager/staff',query:{storeId:row.id}}">
<Button ghost style="border:0px;color: #2074E2;"> 门店导购管理</Button>
</router-link>
</Table>
@ -175,6 +175,7 @@
import data from '../../utils/PhoneRegionData';
import http from '../../services/store/IncreaseStoreManager';
import staff from "../../services/staff/staff";
import zeroExtend from "../../services/customer/zeroExtend";
export default {
name: "IncreaseStoreManager",
@ -197,8 +198,15 @@
qrCodeImage: '',
selectedRegion: 0,
selectedBigRegion: 0,
//list
organizationalList: [],
//list
regionList: [],
bigRegionList: [],
regionId: 0,
//list
companyList: [],
companyId: 0,
errorList: [],
selectedStore: 0,
shopList: [],
@ -313,15 +321,13 @@
},
mounted() {
this.setMenuName("门店推广","推广管理");
this.listOfStore();
this.downBigRegionData();
this.downRegionData();
this.downShopData();
// this.listOfStore();
this.getSelectList();
// this.downBigRegionData();
// this.downRegionData();
// this.downShopData();
},
methods: {
onChangeDateLister: function () {
},
searchCustomerDataBtnClick: function () {
this.listOfStore();
},
@ -369,48 +375,51 @@
}
})
},
//
downRegionData: function () {
let that = this;
let request =
{userId: that.userId, bigRegionId: that.selectedBigRegion};
http.downCompanyData(request, function (data) {
data = data.data.results;
if(data){
that.regionList = [{"id":0,"name":"全部"}];
for(let i=0;i<data.length;i++){
let entity = data[i];
if(entity){
that.regionList.push(entity);
}
//
insertAllOption: function(){
if(this.regionList.length === 0 || this.regionList[0].id !== 0){
this.regionList.splice(0,0, {"id":0, "name":"全部"});
}
if(this.companyList.length === 0 || this.companyList[0].id !== 0){
this.companyList.splice(0, 0, {"id":0, "name":"全部"});
}
})
},
//
downBigRegionData: function () {
/**基础数据区域list、零售公司list、客户list*/
getSelectList:function(){
let that = this;
let request =
{userId: that.userId};
http.downBigRegionData(request, function (data) {
let request = {
userId: this.userId,
};
zeroExtend.getSelectListRequest(request,function (data) {
if(data.data.code !== "0000"){
that.$Message.error("系统异常");
}
data = data.data.results;
if(data){
that.bigRegionList = [{"id":0,"name":"全部"}];
for(let i=0;i<data.length;i++){
let entity = data[i];
if(entity){
that.bigRegionList.push(entity);
}
that.organizationalList = data;
that.regionList = that.organizationalList.filter(item => item.level === 1);
that.companyList = that.organizationalList.filter(item => item.level === 2);
}
//
that.insertAllOption();
});
},
//
regionSelect: function(){
let regionId = this.regionId;
if(regionId === 0){
this.companyList = this.organizationalList.filter(item => item.level === 2);
}else{
this.companyList = this.organizationalList.filter(item => item.parentId === regionId && item.level === 2);
}
})
},
downRegionChange: function () {
this.downShopData();
this.insertAllOption();
this.companyId = 0;
//
},
downBigRegionChange: function () {
this.downRegionData();
// this.downShopData();
//
companySelect: function(){
//
},
downCompanyChange: function (formValidate) {
this.downShopData(formValidate.departIds);
@ -454,7 +463,7 @@
let fileName = index.name + "-门店码";
http.downloadImg({
url:index.qrCodeAction
},fileName,function (data) {
},fileName,function (/*data*/) {
})
},

Loading…
Cancel
Save