权限控制

master
Caps 6 years ago
parent 18d0acca1a
commit c41c620512

@ -47,11 +47,13 @@
columns1: [ columns1: [
{ {
title: '序号', title: '序号',
key: 'index' key: 'index',
width: '80px'
}, },
{ {
title: '零售公司名称', title: '零售公司名称',
key: 'retailCompany' key: 'retailCompany',
width: '250px'
}, },
{ {
title: '总好友数', title: '总好友数',

@ -67,7 +67,8 @@
columns1: [ columns1: [
{ {
title: '序号', title: '序号',
key: 'index' key: 'index',
width: '80px'
}, },
{ {
title: '导购名称', title: '导购名称',
@ -79,7 +80,8 @@
}, },
{ {
title: '所属店铺', title: '所属店铺',
key: 'shopName' key: 'shopName',
width: '250px'
}, },
{ {
title: '店铺编码', title: '店铺编码',
@ -87,7 +89,8 @@
}, },
{ {
title: '所属零售公司', title: '所属零售公司',
key: 'companyName' key: 'companyName',
width: '250px'
}, },
{ {
title: '总好友数', title: '总好友数',

@ -7,7 +7,8 @@
<p class="region">选择日期</p> <p class="region">选择日期</p>
</i-col> </i-col>
<i-col span="4" style="padding-left: 10px;"> <i-col span="4" style="padding-left: 10px;">
<DatePicker @on-change="onChangeDateLister" :value="selectDate" type="daterange" split-panels placeholder="请选择日期" style="width: 200px"></DatePicker> <DatePicker @on-change="onChangeDateLister" :value="selectDate" type="daterange" split-panels
placeholder="请选择日期" style="width: 200px"></DatePicker>
</i-col> </i-col>
<i-col span="2" style="text-align: right;"> <i-col span="2" style="text-align: right;">
<span class="region">零售公司</span> <span class="region">零售公司</span>
@ -44,11 +45,12 @@
<script> <script>
import IncreaseData from "../../services/generalize/IncreaseData"; import IncreaseData from "../../services/generalize/IncreaseData";
export default { export default {
name: "IncreaseDataStore", name: "IncreaseDataStore",
data () { data() {
return { return {
selectDate:[], selectDate: [],
selectedCompany: null, selectedCompany: null,
companyList: [], companyList: [],
selectedStore: null, selectedStore: null,
@ -57,10 +59,12 @@
{ {
title: '序号', title: '序号',
key: 'index', key: 'index',
width: '80px'
}, },
{ {
title: '店铺', title: '店铺',
key: 'shopName' key: 'shopName',
width: '250px'
}, },
{ {
title: '店铺编号', title: '店铺编号',
@ -68,7 +72,8 @@
}, },
{ {
title: '所属零售公司', title: '所属零售公司',
key: 'companyName' key: 'companyName',
width: '250px'
}, },
{ {
title: '总好友数', title: '总好友数',
@ -111,7 +116,7 @@
} }
}, },
mounted: function () { mounted: function () {
let startDate = this.$moment(new Date()).add(-29,"day").format("YYYY-MM-DD"); let startDate = this.$moment(new Date()).add(-29, "day").format("YYYY-MM-DD");
let endDate = this.$moment(new Date()).format("YYYY-MM-DD"); let endDate = this.$moment(new Date()).format("YYYY-MM-DD");
this.selectDate.push(startDate); this.selectDate.push(startDate);
this.selectDate.push(endDate); this.selectDate.push(endDate);
@ -120,20 +125,20 @@
this.generalizeOfStore(); this.generalizeOfStore();
}, },
methods: { methods: {
allCompany(){ allCompany() {
let that = this; let that = this;
let request = { let request = {
userId:JSON.parse(sessionStorage.getItem("loginInfo")).userId userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
}; };
this.companyList = []; this.companyList = [];
IncreaseData.listOfRetailCompany(request,function (data) { IncreaseData.listOfRetailCompany(request, function (data) {
data = data.data; data = data.data;
if (data.code === '0001') { if (data.code === '0001') {
that.$Message.error("查询零售公司出错!"); that.$Message.error("查询零售公司出错!");
return; return;
} }
if (data.code === '0000') { if (data.code === '0000') {
that.companyList.push({id:'-1',name:"全部"}); that.companyList.push({id: '-1', name: "全部"});
that.selectedCompany = "-1"; that.selectedCompany = "-1";
data.results.forEach(da => { data.results.forEach(da => {
that.companyList.push(da); that.companyList.push(da);
@ -141,13 +146,13 @@
} }
}) })
}, },
storeInit(){ storeInit() {
let that = this; let that = this;
let request = { let request = {
userId:JSON.parse(sessionStorage.getItem("loginInfo")).userId userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
}; };
this.storeList = []; this.storeList = [];
IncreaseData.storeInit(request,function (data) { IncreaseData.storeInit(request, function (data) {
data = data.data; data = data.data;
if (data.code === '0001') { if (data.code === '0001') {
that.$Message.error("查询零售公司的店铺出错!"); that.$Message.error("查询零售公司的店铺出错!");
@ -155,8 +160,8 @@
} }
if (data.code === '0000') { if (data.code === '0000') {
that.storeList.push({ that.storeList.push({
id:'-1', id: '-1',
name:"全部" name: "全部"
}); });
that.selectedStore = '-1'; that.selectedStore = '-1';
data.results.forEach(da => { data.results.forEach(da => {
@ -165,18 +170,18 @@
} }
}) })
}, },
storeOfCompany(){ storeOfCompany() {
this.selectedStore = null; this.selectedStore = null;
let that = this; let that = this;
let orgId = this.selectedCompany; let orgId = this.selectedCompany;
if(this.selectedCompany === "-1"){ if (this.selectedCompany === "-1") {
orgId = null; orgId = null;
} }
let request = { let request = {
orgId:orgId orgId: orgId
}; };
this.storeList = []; this.storeList = [];
IncreaseData.listOfStoreByCompany(request,function (data) { IncreaseData.listOfStoreByCompany(request, function (data) {
data = data.data; data = data.data;
if (data.code === '0001') { if (data.code === '0001') {
that.$Message.error("查询零售公司的店铺出错!"); that.$Message.error("查询零售公司的店铺出错!");
@ -184,8 +189,8 @@
} }
if (data.code === '0000') { if (data.code === '0000') {
that.storeList.push({ that.storeList.push({
id:'-1', id: '-1',
name:"全部" name: "全部"
}); });
that.selectedStore = '-1'; that.selectedStore = '-1';
data.results.forEach(da => { data.results.forEach(da => {
@ -194,47 +199,47 @@
} }
}) })
}, },
generalizeOfStore(){ generalizeOfStore() {
if(this.selectDate[0] === ""){ if (this.selectDate[0] === "") {
this.$Message.info("请选择日期"); this.$Message.info("请选择日期");
return return
} }
let orgId = this.selectedCompany; let orgId = this.selectedCompany;
if(this.selectedCompany === "-1"){ if (this.selectedCompany === "-1") {
orgId = null; orgId = null;
} }
let shopId = this.selectedStore; let shopId = this.selectedStore;
if(this.selectedStore === "-1"){ if (this.selectedStore === "-1") {
shopId = null; shopId = null;
} }
let request = { let request = {
startTime:this.selectDate[0], startTime: this.selectDate[0],
endTime:this.selectDate[1], endTime: this.selectDate[1],
orgId:orgId, orgId: orgId,
shopId:shopId, shopId: shopId,
pageNum:this.pageNum, pageNum: this.pageNum,
pageSize:this.pageSize, pageSize: this.pageSize,
}; };
let that = this; let that = this;
that.data1 = []; that.data1 = [];
IncreaseData.generalizeOfStore(request,function (data) { IncreaseData.generalizeOfStore(request, function (data) {
data = data.data; data = data.data;
if(data.code === '0001'){ if (data.code === '0001') {
that.$Message.info("查询门店推广数据失败!"); that.$Message.info("查询门店推广数据失败!");
return; return;
} }
if(data.code === '0000'){ if (data.code === '0000') {
debugger debugger
that.data1 = data.results.dataVOS; that.data1 = data.results.dataVOS;
for(let i = 0; i < that.data1.length;i++){ for (let i = 0; i < that.data1.length; i++) {
that.data1[i].index = i+1; that.data1[i].index = i + 1;
} }
that.totalSize = data.results.sizeNum; that.totalSize = data.results.sizeNum;
} }
}) })
}, },
// //
handlePage:function (value) { handlePage: function (value) {
this.pageNum = value; this.pageNum = value;
this.generalizeOfStore(); this.generalizeOfStore();
}, },
@ -242,54 +247,54 @@
this.selectDate = date; this.selectDate = date;
}, },
//广 //广
exportZeroExtend: function(){ exportZeroExtend: function () {
if(this.selectDate[0] === ""){ if (this.selectDate[0] === "") {
this.$Message.info("请选择日期"); this.$Message.info("请选择日期");
return return
} }
let orgId = this.selectedCompany; let orgId = this.selectedCompany;
if(this.selectedCompany === "-1"){ if (this.selectedCompany === "-1") {
orgId = null; orgId = null;
} }
let shopId = this.selectedStore; let shopId = this.selectedStore;
if(this.selectedStore === "-1"){ if (this.selectedStore === "-1") {
shopId = null; shopId = null;
} }
let request = { let request = {
startTime:this.selectDate[0], startTime: this.selectDate[0],
endTime:this.selectDate[1], endTime: this.selectDate[1],
orgId:orgId, orgId: orgId,
shopId:shopId, shopId: shopId,
pageNum:this.pageNum, pageNum: this.pageNum,
pageSize:this.totalSize, pageSize: this.totalSize,
}; };
let that = this; let that = this;
let originAllData = []; let originAllData = [];
IncreaseData.generalizeOfStore(request,function (data) { IncreaseData.generalizeOfStore(request, function (data) {
if(data.data.code !== "0000"){ if (data.data.code !== "0000") {
that.$Message.error("系统异常"); that.$Message.error("系统异常");
} }
data = data.data.results.dataVOS; data = data.data.results.dataVOS;
if(data && data.length > 0){ if (data && data.length > 0) {
that.totalSize = data[0].totalSize; that.totalSize = data[0].totalSize;
for(let i=0;i<data.length;i++){ for (let i = 0; i < data.length; i++) {
let entity = data[i]; let entity = data[i];
entity.index = i+1; entity.index = i + 1;
originAllData.push(entity); originAllData.push(entity);
} }
let title = "店铺推广数据"; let title = "店铺推广数据";
require.ensure([], () => { require.ensure([], () => {
const { export_json_to_excel } = require('../../excel/Export2Excel'); const {export_json_to_excel} = require('../../excel/Export2Excel');
const tHeader = ['序号', '店铺', '所属零售公司', '所属区域', '总好友数', '总好友数(去重)','新增好友数','新增好友数(去重)','日增好友平均(去重)','删除/拉黑成员客户数(累计)','拉黑率(累计)']; const tHeader = ['序号', '店铺', '所属零售公司', '所属区域', '总好友数', '总好友数(去重)', '新增好友数', '新增好友数(去重)', '日增好友平均(去重)', '删除/拉黑成员客户数(累计)', '拉黑率(累计)'];
// //
const filterVal = ['index', 'shopName', 'companyName', 'allCustomer', 'effectiveCustomer','newCustomer','newEffectiveCustomer','avgNewCustomer','avgNewEffectiveCustomer', 'delCustomer','delRate']; const filterVal = ['index', 'shopName', 'companyName', 'allCustomer', 'effectiveCustomer', 'newCustomer', 'newEffectiveCustomer', 'avgNewCustomer', 'avgNewEffectiveCustomer', 'delCustomer', 'delRate'];
// //
//datatableDatalist //datatableDatalist
const data = that.formatJson(filterVal, originAllData); const data = that.formatJson(filterVal, originAllData);
export_json_to_excel(tHeader, data, title); export_json_to_excel(tHeader, data, title);
}); });
} }
if(!data || data.length === 0){ if (!data || data.length === 0) {
that.$Message.info("暂无数据"); that.$Message.info("暂无数据");
} }
}); });
@ -306,6 +311,7 @@
font-size: 14px; font-size: 14px;
line-height: 32px; line-height: 32px;
} }
.row-style { .row-style {
padding-top: 20px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;

Loading…
Cancel
Save