From c6698fc87f8c10f2a81f4614e281a3bbea65369b Mon Sep 17 00:00:00 2001
From: Caps <452713115@qq.com>
Date: Wed, 15 Apr 2020 19:25:44 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/shop/IncreaseData.vue | 5 +-
src/pages/shop/IncreaseDataCompany.vue | 147 +++++++++++++++++
src/pages/shop/IncreaseDataRegion.vue | 123 --------------
src/pages/shop/IncreaseDataStaff.vue | 183 ++++++++++++++++-----
src/pages/shop/IncreaseDataStore.vue | 155 ++++++++++++-----
src/pages/user/AccountManagementModify.vue | 8 -
src/pages/user/AccountManager.vue | 16 --
src/pages/user/AccountManagerAdd.vue | 12 --
src/pages/user/RoleManager.vue | 12 --
src/router/index.js | 6 +-
src/services/CommonHttp.js | 22 +--
src/services/generalize/IncreaseData.js | 97 +++++++++++
12 files changed, 521 insertions(+), 265 deletions(-)
create mode 100644 src/pages/shop/IncreaseDataCompany.vue
delete mode 100644 src/pages/shop/IncreaseDataRegion.vue
create mode 100644 src/services/generalize/IncreaseData.js
diff --git a/src/pages/shop/IncreaseData.vue b/src/pages/shop/IncreaseData.vue
index da35e7d..37fd5e5 100644
--- a/src/pages/shop/IncreaseData.vue
+++ b/src/pages/shop/IncreaseData.vue
@@ -3,7 +3,7 @@
diff --git a/src/pages/shop/IncreaseDataCompany.vue b/src/pages/shop/IncreaseDataCompany.vue
new file mode 100644
index 0000000..2626518
--- /dev/null
+++ b/src/pages/shop/IncreaseDataCompany.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+ 选择日期
+
+
+
+
+
+ 零售公司选择
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/shop/IncreaseDataRegion.vue b/src/pages/shop/IncreaseDataRegion.vue
deleted file mode 100644
index 1da9ee6..0000000
--- a/src/pages/shop/IncreaseDataRegion.vue
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
-
- 区域选择
-
-
-
-
-
- 时间
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/pages/shop/IncreaseDataStaff.vue b/src/pages/shop/IncreaseDataStaff.vue
index 7d16b6b..39dda94 100644
--- a/src/pages/shop/IncreaseDataStaff.vue
+++ b/src/pages/shop/IncreaseDataStaff.vue
@@ -4,11 +4,18 @@
- 区域选择
+ 选择日期
+
+
+
+
+
+ 零售公司选择
-
@@ -16,7 +23,7 @@
-
+
@@ -25,108 +32,208 @@
-
+
-
- 时间
-
-
-
-
-
-
-
+
diff --git a/src/pages/shop/IncreaseDataStore.vue b/src/pages/shop/IncreaseDataStore.vue
index 7acbc45..a8faa12 100644
--- a/src/pages/shop/IncreaseDataStore.vue
+++ b/src/pages/shop/IncreaseDataStore.vue
@@ -4,118 +4,191 @@
- 区域选择
+ 选择日期
-
-
-
+
-
- 店铺选择
+
+ 零售公司选择
-
-
+
+
- 时间
+ 店铺选择
-
+
+
+
+
-
-
-
-
+
diff --git a/src/pages/user/AccountManagementModify.vue b/src/pages/user/AccountManagementModify.vue
index 250a874..0a2eae9 100644
--- a/src/pages/user/AccountManagementModify.vue
+++ b/src/pages/user/AccountManagementModify.vue
@@ -126,10 +126,6 @@
that.roleList = [];
accountManagement.listRoleInfoApi({}, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if(data.code === '0001') {
that.$Message.error("查询失败");
return;
@@ -218,10 +214,6 @@
that.shopList = [];
accountManagementModify.listShopApi({}, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if(data.code === '0001') {
that.$Message.error("查询店铺失败");
return;
diff --git a/src/pages/user/AccountManager.vue b/src/pages/user/AccountManager.vue
index 3b35ed2..fcea56d 100644
--- a/src/pages/user/AccountManager.vue
+++ b/src/pages/user/AccountManager.vue
@@ -215,10 +215,6 @@
that.roleList = [];
accountManagement.listRoleInfoApi({}, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if (data.code === '0001') {
that.$Message.error("查询角色失败!");
return;
@@ -241,10 +237,6 @@
};
accountManagement.listAllShopApi(request, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if (data.code === '0001') {
that.$Message.error("查询店铺失败!");
return;
@@ -271,10 +263,6 @@
};
accountManagement.listAccountInfoApi(request, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if (data.code === '0001') {
that.$Message.error("系统繁忙!");
return
@@ -318,10 +306,6 @@
userId: that.updateUserId
};
accountManagement.removeAccountApi(request, function (data) {
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if (data.data.code === '0001') {
that.$Message.info("删除失败");
return
diff --git a/src/pages/user/AccountManagerAdd.vue b/src/pages/user/AccountManagerAdd.vue
index 2307a48..28b2e45 100644
--- a/src/pages/user/AccountManagerAdd.vue
+++ b/src/pages/user/AccountManagerAdd.vue
@@ -145,10 +145,6 @@
that.roleList = [];
accountManagement.listRoleInfoApi({}, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if (data.code === '0001') {
that.$Message.error("查询角色失败!");
return;
@@ -200,10 +196,6 @@
};
accountManagementAdd.saveAccountInputApi(request, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if(data.code === '0001') {
that.$Message.error("保存账号失败");
return;
@@ -244,10 +236,6 @@
};
accountManagement.listAllShopApi(request, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if (data.code === '0001') {
that.$Message.error("查询店铺失败!");
return;
diff --git a/src/pages/user/RoleManager.vue b/src/pages/user/RoleManager.vue
index 9b0cac2..498a270 100644
--- a/src/pages/user/RoleManager.vue
+++ b/src/pages/user/RoleManager.vue
@@ -476,10 +476,6 @@
let that = this;
RoleManager.saveRolePermission(request, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if (data.code === '0001') {
that.$Message.error("保存角色失败!");
return;
@@ -495,10 +491,6 @@
that.roleList = [];
RoleManager.listRoleInfoApi({}, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if (data.code === '0001') {
that.$Message.error("查询角色失败!");
return;
@@ -530,10 +522,6 @@
let that = this;
RoleManager.rolePermissionList(request, function (data) {
data = data.data;
- if (data.code === '9999') {
- that.$router.push('/login');
- that.$Message.error("会话超时请重新登陆!");
- }
if (data.code === '0001') {
that.$Message.error("查询角色权限失败!");
return;
diff --git a/src/router/index.js b/src/router/index.js
index 7a60ceb..c8aa838 100755
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -12,7 +12,7 @@ import IncreaseManager from '@/pages/shop/IncreaseManager';
import CustomerView from "@/pages/CustomerView";
import CustomerDetail from "@/pages/CustomerDetail";
import IncreaseData from '@/pages/shop/IncreaseData';
-import IncreaseDataRegion from '@/pages/shop/IncreaseDataRegion';
+import IncreaseDataCompany from '@/pages/shop/IncreaseDataCompany';
import IncreaseDataStaff from '@/pages/shop/IncreaseDataStaff';
import IncreaseDataStore from '@/pages/shop/IncreaseDataStore';
import IncreaseStaffManager from '@/pages/shop/IncreaseStaffManager';
@@ -137,8 +137,8 @@ const router = new Router({
},
{
path: '/shop/increase/data/region',
- name: 'IncreaseDataRegion',
- component: IncreaseDataRegion
+ name: 'IncreaseDataCompany',
+ component: IncreaseDataCompany
},
{
path: '/shop/increase/data/store',
diff --git a/src/services/CommonHttp.js b/src/services/CommonHttp.js
index d0a7c72..da2dd25 100755
--- a/src/services/CommonHttp.js
+++ b/src/services/CommonHttp.js
@@ -42,7 +42,7 @@ axios.interceptors.request.use((config) => {
axios.interceptors.response.use((res) =>{
let data = res.data.results;
- if(res.data.code == '9999' && sessionStorage.getItem("logout")){
+ if(res.data.code === '9999' || sessionStorage.getItem("logout")){
// iView.Message.error('会话超时,请重新登录');
// store.commit('LOGOUT');
commonUtils.goToLogin();
@@ -54,51 +54,51 @@ axios.interceptors.response.use((res) =>{
return Promise.resolve(res);
}
- if(data.code == "1001"){
+ if(data.code === "1001"){
// iView.Message.error("账号不存在");
return Promise.resolve(res);
}
- if(data.code == "1002"){
+ if(data.code === "1002"){
// iView.Message.error("账号已停用");
return Promise.resolve(res);
}
- if(data.code == "1003"){
+ if(data.code === "1003"){
// iView.Message.error("密码错误");
return Promise.resolve(res);
}
- if(data.code == "1004"){
+ if(data.code === "1004"){
// iView.Message.error("账号已注销");
return Promise.resolve(res);
}
- if(data.code == "1005"){
+ if(data.code === "1005"){
// iView.Message.error("账号未绑定品牌");
return Promise.resolve(res);
}
- if(data.code == "1006"){
+ if(data.code === "1006"){
// iView.Message.error("账号未绑定店铺");
return Promise.resolve(res);
}
- if(data.code == "1007"){
+ if(data.code === "1007"){
// iView.Message.error("账号无权限");
return Promise.resolve(res);
}
- if(data.code == "1009"){
+ if(data.code === "1009"){
// iView.Message.error("账号已过时");
return Promise.resolve(res);
}
- if(data.code == "0001"){
+ if(data.code === "0001"){
// this.$Message.error("系统繁忙,请重试");
return Promise.resolve(res);
}
- if(data.code != "0000") {
+ if(data.code !== "0000") {
// this.$Message.error(data.errorMsg);
return Promise.resolve(res);
}
diff --git a/src/services/generalize/IncreaseData.js b/src/services/generalize/IncreaseData.js
new file mode 100644
index 0000000..85a39b8
--- /dev/null
+++ b/src/services/generalize/IncreaseData.js
@@ -0,0 +1,97 @@
+/**
+ * home请求数据
+ * @author wangyinjia
+ * @date 2020/2/24
+ */
+
+import http from '../CommonHttp'
+
+/**
+ * 查询所有的零售公司信息
+ * @param params
+ * @param call
+ * @returns {Promise}
+ */
+export function listOfRetailCompany(params, call) {
+ return http.get('/retail/company', params).then(call)
+}
+
+/**
+ * 查询零售公司下的店铺
+ * @param params
+ * @param call
+ * @returns {Promise}
+ */
+export function listOfStoreByCompany(params, call) {
+ return http.get('/retail/store/company', params).then(call)
+}
+
+/**
+ * 查询店铺下的导购
+ * @param params
+ * @param call
+ * @returns {Promise}
+ */
+export function listOfSellerByStore(params, call) {
+ return http.get('/retail/seller/store', params).then(call)
+}
+
+/**
+ * 零售公司的推广数据
+ * @param params
+ * @param call
+ * @returns {Promise}
+ */
+export function generalizeOfRetail(params, call) {
+ return http.get('/retail/retail', params).then(call)
+}
+
+/**
+ * 门店的推广数据
+ * @param params
+ * @param call
+ * @returns {Promise}
+ */
+export function generalizeOfStore(params, call) {
+ return http.get('/retail/store', params).then(call)
+}
+
+/**
+ * 导购的推广数据
+ * @param params
+ * @param call
+ * @returns {Promise}
+ */
+export function generalizeOfSeller(params, call) {
+ return http.get('/retail/seller', params).then(call)
+}
+
+/**
+ * 门店信息
+ * @param params
+ * @param call
+ * @returns {Promise}
+ */
+export function storeInit(params, call) {
+ return http.get('/poi/store/user/shop', params).then(call)
+}
+/**
+ * 导购信息
+ * @param params
+ * @param call
+ * @returns {Promise}
+ */
+export function sellerInit(params, call) {
+ return http.get('/poi/seller/user/seller', params).then(call)
+}
+
+export default {
+ listOfRetailCompany,
+ listOfStoreByCompany,
+ listOfSellerByStore,
+ generalizeOfRetail,
+ generalizeOfStore,
+ generalizeOfSeller,
+ storeInit,
+ sellerInit
+}