推广店铺,下拉框

master
wyj2080 6 years ago
parent 54a84b695b
commit f91e0742f2

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

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

Loading…
Cancel
Save