组织管理-大区功能开发。

feature_0521
kevin jiang 5 years ago
parent 223efe0268
commit 0fca538d9d

@ -70,4 +70,8 @@
padding-right: 20px;
float: right;
}
.table-margin-top {
margin-top: 20px;
}
</style>

@ -0,0 +1,13 @@
<template>
<div>company</div>
</template>
<script>
export default {
name: "OrganizationCompany"
}
</script>
<style scoped>
</style>

@ -0,0 +1,13 @@
<template>
<div>customer</div>
</template>
<script>
export default {
name: "OrganizationCustomer"
}
</script>
<style scoped>
</style>

@ -0,0 +1,46 @@
<template>
<div>
<Menu ref="menu" mode="horizontal" :active-name="selectedItemName">
<MenuItem :name="cItem.id" :to="cItem.resource" v-for="cItem in threeLevel"
:key="cItem.id">
{{cItem.name}}
</MenuItem>
</Menu>
<div>
<router-view/>
</div>
</div>
</template>
<script>
export default {
name: "OrganizationMain",
data() {
return {
threeLevel: null,
selectedItemName: null,
}
},
created() {
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit();
},
mounted() {
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit();
},
methods:{
menuInit(){
let that = this;
that.selectedItemName = that.threeLevel[0].id;
this.$nextTick(() => {
that.$refs.menu.updateActiveName();
});
}
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,269 @@
<template>
<div>
<Row class="search-row">
<i-col span="24" class="search-col">
<Row class="row-style">
<div class="search-div-btn">
<Button type="primary" @click="open(0,null)"></Button>
</div>
</Row>
</i-col>
</Row>
<Table :loading="loading" ref="table" :columns="columns1" :data="data1" class="table-margin-top"
size="small">
<template slot-scope="{row}" slot="action">
<Button
ghost
type="primary"
size="small"
style="border: 0px;color:#2074E2"
@click="open(1,row)"
>修改
</Button>
<Button
ghost
type="error"
size="small"
style="border: 0px"
@click="remove(row)"
>删除</Button>
</template>
</Table>
<Page :total="totalSize" :current="pageNum" :page-size="pageSize" show-elevator show-total
placement="top" @on-change="handlePage" class-name="ks-page"></Page>
<!-- 修改大区 -->
<Modal
v-model="isShow"
:footer-hide="true"
>
<div slot="header">{{type === 0 ? '添加' : '修改'}}大区</div>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="大区名称" prop="name">
<i-input type="text" v-model="formValidate.name" placeholder="请输入大区名称"></i-input>
</FormItem>
<FormItem style="text-align: left;">
<Button :loading="btnLoading" type="primary" @click="handleSubmit(formValidate)">{{type === 0 ? '' : ''}}</Button>
<Button @click="handleReset('formValidate')" style="margin-left: 10px">取消</Button>
</FormItem>
</Form>
</Modal>
<Modal v-model="isModelShow" title="删除提示" align="center">
<p style="margin-top: 20px;margin-bottom: 20px">
确定要删除此大区吗删除后不可恢复
</p>
<div slot="footer"
style="text-align: center;margin-bottom: 10px;margin-top: 10px">
<Button style="width: 100px;" @click="isModelShow = false">取消</Button>
<Button :loading="btnLoading" type="error" style="width: 100px;margin-left: 20px" @click="deleteRegion"></Button>
</div>
</Modal>
</div>
</template>
<script>
import service from '../../services/organization/OrganizationService'
export default {
name: "OrganizationRegion",
data() {
return {
userId: "",
loading: false,
btnLoading: false,//
columns1: [
{
title: '序号',
key: 'index'
},
{
title: '大区名称',
key: 'name'
},
{
title: '操作',
slot: 'action',
width: '200px'
}
],
data1: [
],
//
totalSize: 0,
pageNum: 1,
pageSize: 10,
isShow: false,
type: 0, // 0 1
formValidate: {
name: ''
},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
isModelShow: false,
currentId: 0
}
},
created() {
this.userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId;
this.getData();
},
methods: {
remove: function (row) {
this.isModelShow = true;
this.currentId = row.id;
},
open: function (type, item) {
this.isShow = true;
this.type = type;
if(type === 0){
//
this.formValidate = {
name: ""
}
}else{
this.formValidate = {
id: item.id,
name: item.name
}
}
},
show: function (index) {
this.isShow = true;
this.showStoreName = index.name;
this.rowData = index;
},
hide: function () {
this.isShow = false;
},
handleSubmit(value) {
if (value) {
if(this.type === 0){
//
this.addRegion(value.name);
}else{
//
this.modifyRegion(value);
}
} else {
this.$Message.error('Fail!');
}
},
handleReset(name) {
this.$refs[name].resetFields();
this.isShow = false;
},
//
handlePage: function (value) {
this.pageNum = value;
this.getData();
},
deleteRegion: function () {
//
let that = this;
if(that.currentId === 0){
return;
}
that.btnLoading = true;
let request = {
id: that.currentId
};
service.postOrganizationRemoveId(request, function (res) {
that.btnLoading = false;
let data = res.data;
if(data.code === "0000"){
that.$Message.success("删除成功");
that.isModelShow = false;
that.getData();
}else{
that.$Message.error("删除失败");
}
}, function () {
that.btnLoading = false;
});
},
//
getData: function () {
let that = this;
that.loading = true;
let request = {
userId: that.userId,
pageNum: that.pageNum,
pageSize: that.pageSize
};
service.getOrganizationRegionList(request, function (res) {
that.loading = false;
let data = res.data;
if(that.pageNum === 1){
that.data1 = [];
}
for (let i=0;i<data.results.records.length;i++) {
let item = data.results.records[i];
item.index = i+that.pageNum;
that.data1.push(item);
}
that.totalSize = data.results.total;
}, function () {
that.loading = false;
});
},
//
addRegion: function (name) {
let that = this;
let request = {
name: name
};
that.btnLoading = true;
service.postOrganizationRegionAdd(request, function (res) {
that.btnLoading = false;
let data = res.data;
if(data.code === "0000"){
that.$Message.success("添加成功");
that.hide();
that.getData();
}else{
that.$Message.error("添加失败");
}
}, function () {
that.btnLoading = false;
});
},
//
modifyRegion: function (val) {
let that = this;
let request = {
id: val.id,
name: val.name
};
service.postOrganizationRegionModify(request, function (res) {
that.btnLoading = false;
let data = res.data;
debugger
if(data.code === "0000"){
that.$Message.success("修改成功");
that.hide();
that.getData();
}else{
that.$Message.error("修改失败");
}
}, function () {
that.btnLoading = false;
});
}
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,13 @@
<template>
<div>store</div>
</template>
<script>
export default {
name: "OrganizationStore"
}
</script>
<style scoped>
</style>

@ -198,7 +198,7 @@ import staff from "../../services/staff/staff";
return {
modal13: false,
deleteId: null,
userId: 13,
userId: '',
// 1 2
flag: 1,
prefixDefault: data.prefixDefault,
@ -301,7 +301,8 @@ import staff from "../../services/staff/staff";
}
},
mounted() {
this.setMenuName("门店推广", "推广管理", "门店导购管理");
this.userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId;
this.setMenuName("门店推广", "推广管理", "门店导购管理");
this.listOfLogistics();
},
methods: {

@ -35,246 +35,281 @@ import ActivityPlan from "@/pages/activity/ActivityPlan";
import ActivityCode from "@/pages/activity/ActivityCode";
import GuideCode from "@/pages/activity/GuideCode";
import Recruit from "@/pages/recruit/Recruit";
import OrganizationRegion from "@/pages/organization/OrganizationRegion";
import OrganizationCompany from "@/pages/organization/OrganizationCompany";
import OrganizationCustomer from "@/pages/organization/OrganizationCustomer";
import OrganizationStore from "@/pages/organization/OrganizationStore";
import OrganizationMain from "@/pages/organization/OrganizationMain"
Vue.use(Router);
const router = new Router({
mode: "history",
base: "/youke",
routes: [
{
path: "/",
redirect: "/login",
},
{
path: "/login",
name: "login",
component: Login,
},
{
path: "/external/contact",
name: "externalContact",
component: ExternalContact,
},
{
path: "/home",
name: "Home",
component: Home,
children: [
{
path: "/activity/manager",
name: "ActivityManager",
component: ActivityManager,
},
{
path: "/activity/plan",
name: "ActivityPlan",
component: ActivityPlan,
children: [],
},
{
path: "/activity/plan/code",
name: "ActivityCode",
component: ActivityCode,
},
{
path: "/activity/plan/GuideCode",
name: "GuideCode",
component: GuideCode,
},
{
path: "/activity/analysis",
name: "ActivityAnalysis",
component: ActivityAnalysis,
},
{
path: "/account/manager",
name: "AccountManager",
component: AccountManager,
},
{
path: "/account/management/add",
name: "AccountManagerAdd",
component: AccountManagerAdd,
},
{
path: "/account/management/modify",
name: "AccountManagementModify",
component: AccountManagementModify,
},
{
path: "/account/upload",
name: "AccountManagerUpload",
component: AccountManagerUpload,
},
{
path: "/role/manager",
name: "RoleManager",
component: RoleManager,
},
{
path: "/shop/increase/manager",
name: "IncreaseManager",
component: IncreaseManager,
children: [
{
path: "/",
redirect: "/shop/increase/manager/store",
},
{
path: "/shop/increase/manager/store",
name: "IncreaseStoreManager",
component: IncreaseStoreManager,
},
{
path: "/shop/increase/manager/staff",
name: "IncreaseStaffManager",
component: IncreaseStaffManager,
},
{
path: "/shop/increase/manager/staff/batch/add",
name: "IncreaseStaffManagerBatchAdd",
component: IncreaseStaffManagerBatchAdd,
},
{
path: "/shop/increase/welcome/list",
component: () => import("@/pages/shop/IncreaseWelcomeList"),
},
{
path: "/shop/increase/welcome/edit",
component: () => import("@/pages/shop/IncreaseWelcomeEdit"),
},
],
},
{
path: "/table/analysis",
name: "TableAnalysis",
component: TableAnalysis,
children: [
{
path: "/",
redirect: "/table/analysis/customer/add",
},
{
path: "/table/analysis/customer/add",
name: "AddCustomerTable",
component: AddCustomerTable,
},
{
path: "/table/analysis/customer/apply",
name: "ApplyCustomerTable",
component: ApplyCustomerTable,
},
],
},
{
path: "/shop/increase/configure",
name: "IncreaseConfigure",
component: IncreaseConfigure,
children: [
{
path: "/",
redirect: "/shop/increase/configure/welcome",
},
{
path: "/shop/increase/configure/group",
name: "IncreaseGroupSendConfigure",
component: IncreaseGroupSendConfigure,
},
{
path: "/shop/increase/configure/welcome",
name: "IncreaseWelcomeConfigure",
component: IncreaseWelcomeConfigure,
},
{
path: "/shop/increase/configure/group/add",
name: "IncreaseGroupSendConfigureAdd",
component: IncreaseGroupSendConfigureAdd,
},
],
},
{
path: "/shop/increase/data",
name: "IncreaseData",
component: IncreaseData,
children: [
{
path: "/",
redirect: "/shop/increase/data/region",
},
{
path: "/shop/increase/data/region",
name: "IncreaseDataCompany",
component: IncreaseDataCompany,
},
{
path: "/shop/increase/data/store",
name: "IncreaseDataStore",
component: IncreaseDataStore,
},
{
path: "/shop/increase/data/staff",
name: "IncreaseDataStaff",
component: IncreaseDataStaff,
},
],
},
{
path: "/recruit",
component: Recruit,
children: [
{
path: "/recruit/bulletin/index",
component: () => import("@/pages/recruit/BulletinIndex"),
},
{
path: "/recruit/check/list",
component: () => import("@/pages/recruit/CheckList"),
},
{
path: "/recruit/promoter/list",
component: () => import("@/pages/recruit/PromoterList"),
},
],
},
mode: "history",
base: "/youke",
routes: [
{
path: "/customer/view",
name: "CustomerView",
component: CustomerView,
path: "/",
redirect: "/login",
},
{
path: "/zero/extend/detail",
name: "ZeroExtendDetail",
component: ZeroExtendDetail,
path: "/login",
name: "login",
component: Login,
},
{
path: "/customer/data/detail",
name: "CustomerDetail",
component: CustomerDetail,
path: "/external/contact",
name: "externalContact",
component: ExternalContact,
},
{
path: '/store/data/detail',
name: 'StoreDetail',
component: StoreDetail,
path: "/home",
name: "Home",
component: Home,
children: [
{
path: "/activity/manager",
name: "ActivityManager",
component: ActivityManager,
},
{
path: "/activity/plan",
name: "ActivityPlan",
component: ActivityPlan,
children: [],
},
{
path: "/activity/plan/code",
name: "ActivityCode",
component: ActivityCode,
},
{
path: "/activity/plan/GuideCode",
name: "GuideCode",
component: GuideCode,
},
{
path: "/activity/analysis",
name: "ActivityAnalysis",
component: ActivityAnalysis,
},
{
path: "/account/manager",
name: "AccountManager",
component: AccountManager,
},
{
path: "/account/management/add",
name: "AccountManagerAdd",
component: AccountManagerAdd,
},
{
path: "/account/management/modify",
name: "AccountManagementModify",
component: AccountManagementModify,
},
{
path: "/account/upload",
name: "AccountManagerUpload",
component: AccountManagerUpload,
},
{
path: "/role/manager",
name: "RoleManager",
component: RoleManager,
},
{
path: "/shop/increase/manager",
name: "IncreaseManager",
component: IncreaseManager,
children: [
{
path: "/",
redirect: "/shop/increase/manager/store",
},
{
path: "/shop/increase/manager/store",
name: "IncreaseStoreManager",
component: IncreaseStoreManager,
},
{
path: "/shop/increase/manager/staff",
name: "IncreaseStaffManager",
component: IncreaseStaffManager,
},
{
path: "/shop/increase/manager/staff/batch/add",
name: "IncreaseStaffManagerBatchAdd",
component: IncreaseStaffManagerBatchAdd,
},
{
path: "/shop/increase/welcome/list",
component: () => import("@/pages/shop/IncreaseWelcomeList"),
},
{
path: "/shop/increase/welcome/edit",
component: () => import("@/pages/shop/IncreaseWelcomeEdit"),
},
],
},
{
path: "/table/analysis",
name: "TableAnalysis",
component: TableAnalysis,
children: [
{
path: "/",
redirect: "/table/analysis/customer/add",
},
{
path: "/table/analysis/customer/add",
name: "AddCustomerTable",
component: AddCustomerTable,
},
{
path: "/table/analysis/customer/apply",
name: "ApplyCustomerTable",
component: ApplyCustomerTable,
},
],
},
{
path: "/shop/increase/configure",
name: "IncreaseConfigure",
component: IncreaseConfigure,
children: [
{
path: "/",
redirect: "/shop/increase/configure/welcome",
},
{
path: "/shop/increase/configure/group",
name: "IncreaseGroupSendConfigure",
component: IncreaseGroupSendConfigure,
},
{
path: "/shop/increase/configure/welcome",
name: "IncreaseWelcomeConfigure",
component: IncreaseWelcomeConfigure,
},
{
path: "/shop/increase/configure/group/add",
name: "IncreaseGroupSendConfigureAdd",
component: IncreaseGroupSendConfigureAdd,
},
],
},
{
path: "/shop/increase/data",
name: "IncreaseData",
component: IncreaseData,
children: [
{
path: "/",
redirect: "/shop/increase/data/region",
},
{
path: "/shop/increase/data/region",
name: "IncreaseDataCompany",
component: IncreaseDataCompany,
},
{
path: "/shop/increase/data/store",
name: "IncreaseDataStore",
component: IncreaseDataStore,
},
{
path: "/shop/increase/data/staff",
name: "IncreaseDataStaff",
component: IncreaseDataStaff,
},
],
},
{
path: "/recruit",
component: Recruit,
children: [
{
path: "/recruit/bulletin/index",
component: () => import("@/pages/recruit/BulletinIndex"),
},
{
path: "/recruit/check/list",
component: () => import("@/pages/recruit/CheckList"),
},
{
path: "/recruit/promoter/list",
component: () => import("@/pages/recruit/PromoterList"),
},
],
},
{
path: "/customer/view",
name: "CustomerView",
component: CustomerView,
},
{
path: "/zero/extend/detail",
name: "ZeroExtendDetail",
component: ZeroExtendDetail,
},
{
path: "/customer/data/detail",
name: "CustomerDetail",
component: CustomerDetail,
},
{
path: '/store/data/detail',
name: 'StoreDetail',
component: StoreDetail,
},
{
path: '/no/permission',
name: 'NoPermission',
component: NoPermission,
},
{
path: "/organization/main",
name: "OrganizationMain",
component: OrganizationMain,
children: [
{
path: "/",
redirect: OrganizationStore,
},
{
path: "/organization/customer",
name: "OrganizationCustomer",
component: OrganizationCustomer,
},
{
path: "/organization/company",
name: "OrganizationCompany",
component: OrganizationCompany,
},
{
path: "/organization/region",
name: "OrganizationRegion",
component: OrganizationRegion,
},
{
path: "/organization/store",
name: "OrganizationStore",
component: OrganizationStore,
}
],
},
],
},
{
path: '/no/permission',
name: 'NoPermission',
component: NoPermission,
path: "/customer/view/home",
name: "CustomerViewHome",
component: CustomerViewHome,
},
],
},
{
path: "/customer/view/home",
name: "CustomerViewHome",
component: CustomerViewHome,
},
],
],
});
/*
* 跳转前的处理事件
* */
router.beforeEach(function(to, from, next) {
next();
router.beforeEach(function (to, from, next) {
next();
});
export default router;

@ -0,0 +1,54 @@
/**
* 组织管理 server层
* @author dexiang.jiang
* @date 2020/06/07 16:14
*/
import http from '../CommonHttp'
/**
* 查询大区列表
* @param params
* @param call
* @returns {Promise<any>}
*/
export function getOrganizationRegionList(params, call, errorCallback) {
return http.get('/organization/region/list', params).then(call).catch(errorCallback)
}
/**
* 修改大区
* @param params
* @param call
* @returns {Promise<any>}
*/
export function postOrganizationRegionModify(params, call, errorCallback) {
return http.post('/organization/region/modify', params).then(call).catch(errorCallback)
}
/**
* 添加大区
* @param params
* @param call
* @returns {Promise<any>}
*/
export function postOrganizationRegionAdd(params, call, errorCallback) {
return http.post('/organization/region/add', params).then(call).catch(errorCallback)
}
/**
* 删除
* @param params
* @param call
* @returns {Promise<any>}
*/
export function postOrganizationRemoveId(params, call, errorCallback) {
return http.post('/organization/remove/id', params).then(call).catch(errorCallback)
}
export default {
getOrganizationRegionList,
postOrganizationRegionModify,
postOrganizationRegionAdd,
postOrganizationRemoveId
}
Loading…
Cancel
Save