Commit 5f749b51 by fairyly

feat: 更新路由配置

parent 04789620
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2018-10-10 14:44:45 * @Date: 2018-10-10 14:44:45
* @LastEditors : 无尘 * @LastEditors : 无尘
* @LastEditTime : 2020-02-12 11:21:17 * @LastEditTime : 2020-02-18 08:46:29
*/ */
import Vue from 'vue'; import Vue from 'vue';
import Router from 'vue-router'; import Router from 'vue-router';
...@@ -44,11 +44,6 @@ export const constantRouterMap = [ ...@@ -44,11 +44,6 @@ export const constantRouterMap = [
redirect: 'login' redirect: 'login'
}, },
{ {
path: '/tree',
name: '登录',
component: _import('login', 'tree')
},
{
path: '/login', path: '/login',
name: '登录', name: '登录',
component: _import('login', 'index') component: _import('login', 'index')
...@@ -120,17 +115,17 @@ export const constantRouterMap = [ ...@@ -120,17 +115,17 @@ export const constantRouterMap = [
children: [ children: [
{ {
path: '/memberShowSet', path: '/memberShowSet',
name: '会员基础设置', name: '会员展示设置',
component: _import('apps/customerApp', 'memberShowSet') component: _import('apps/customerApp', 'memberShowSet')
}, },
{ {
path: '/memberGroupSet', path: '/memberGroupSet',
name: '会员基础设置', name: '会员分组设置',
component: _import('apps/customerApp', 'memberGroupSet') component: _import('apps/customerApp', 'memberGroupSet')
}, },
{ {
path: '/memberSearchSet', path: '/memberSearchSet',
name: '会员基础设置', name: '会员搜索设置',
component: _import('apps/customerApp', 'memberSearchSet') component: _import('apps/customerApp', 'memberSearchSet')
} }
] ]
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-08-14 16:51:07
* @LastEditors : 无尘
* @LastEditTime : 2020-01-14 14:44:57
-->
<!--
<org-tree v-if="item.children.length" :itemData="item.children" ></org-tree>
import orgTree from './org-tree.vue';
-->
<template>
<ul class="m-l-10">
<draggable :list="itemData" class="org-component" :options="leftOption" :move="onMove" @start="isDragging = true" @end="itemMoveEnd">
<li v-for="(item, index) in itemData" :key="index + 'gic'">
<div class="li-cell cursor-pointer" @click="toggleExpand(item)">{{ item.label }}</div>
<li-row v-show="!!item.children.length && item.expand" :itemData="item.children"></li-row>
</li>
</draggable>
</ul>
</template>
<script>
import draggable from 'vuedraggable';
export default {
name: 'li-row',
components: {
draggable
},
props: {
itemData: {
type: [Object, Array],
default() {
return [];
}
}
},
data() {
return {
// leftOption
leftOption: {
group: {
name: 'people',
pull: true,
put: false
},
sort: false,
disabled: false
}
};
},
methods: {
/**
* 展开或者关闭下级
*/
toggleExpand(item) {
console.log(item);
item.expand = item.expand ? false : true;
},
/**
* move{relatedContext, draggedContext}
*/
onMove(evt) {
// const that = this;
// 判断中间是否存在父级
const draggedElement = evt.draggedContext.element;
console.log(evt, !draggedElement.fixed);
return !draggedElement.fixed;
},
/**
* move end
*/
itemMoveEnd(evt) {
const that = this;
// 判断中间是否已经添加
console.log(that.itemData);
that.$forceUpdate();
}
},
watch: {
itemData: function(newData, oldData) {
const that = this;
that.trData = JSON.parse(JSON.stringify(newData));
}
},
mounted() {
const that = this;
that.trData = JSON.parse(JSON.stringify(that.itemData));
},
beforeDestroy() {
this.tempArr = [];
}
};
</script>
<style lang="less" scoped>
.li-cell {
line-height: 26px;
}
.w-110 {
width: 110px;
}
.w-320 {
width: 320px;
}
.m-t-14 {
margin-top: 14px;
}
.child-row {
padding-left: 10px;
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-08-14 16:51:07
* @LastEditors : 无尘
* @LastEditTime : 2020-01-14 14:44:57
-->
<!--
<wx-tree v-model="itemData" ></wx-tree>
import wxTree from './wx-tree.vue';
-->
<template>
<ul class="m-l-10">
<draggable :list="itemData" class="wx-component" :options="rightOption" @input="emitter" @change="changeData">
<li v-for="(item, index) in itemData" :key="index + 'gic'">
<div class="li-cell cursor-pointer" v-contextmenu:contextmenu @click="toggleExpand(item)">{{ item.label }}</div>
<v-contextmenu ref="contextmenu">
<v-contextmenu-item @click="addChild(item)">添加子部门</v-contextmenu-item>
<v-contextmenu-item @click="modChild(item)">修改名称</v-contextmenu-item>
<v-contextmenu-item @click="delChild(item)">删除</v-contextmenu-item>
<v-contextmenu-item>部门ID: {{ item.id }}</v-contextmenu-item>
</v-contextmenu>
<li-row v-if="item.expand" :itemData="item.children"></li-row
><!-- v-show="!!item.children.length && item.expand" -->
</li>
</draggable>
</ul>
</template>
<script>
import draggable from 'vuedraggable';
import showMsg from '@/common/js/showmsg';
export default {
name: 'li-row',
components: {
draggable
},
props: {
value: {
type: [Object, Array],
default() {
return [];
}
},
itemData: {
type: [Object, Array],
default() {
return [];
}
}
},
data() {
return {
rightOption: { group: { name: 'people', pull: true, put: true }, sort: true }
};
},
computed: {},
methods: {
/**
* 改变数组数据
*/
emitter(value) {
console.log(value);
this.$emit('input', value);
},
changeData(value) {
console.log(value);
},
/**
* 展开或者关闭下级
*/
toggleExpand(item) {
const that = this;
console.log(item);
item.expand = item.expand ? false : true;
if (!item.children.length) {
item.expand = true;
}
that.$forceUpdate();
},
/**
* 添加子部门
*/
addChild(item) {
const that = this;
console.log('添加:', item);
item.children.push({
id: 225,
expand: true,
label: '总部225',
children: []
});
that.$forceUpdate();
},
/**
* 修改名称
*/
modChild(item) {
const that = this;
console.log('修改:', item);
item.label = 2222;
that.$forceUpdate();
},
/**
* 删除
*/
delChild(item) {
const that = this;
console.log('删除:', item, that.itemData);
if (!!item.children.length) {
showMsg.showmsg('当前节点下有子节点,不可删除', 'warning');
return false;
}
let key = '';
that.itemData.forEach((ele, index) => {
if (ele.id == item.id) {
key = index;
}
});
that.itemData.splice(key, 1);
that.$forceUpdate();
}
},
watch: {
value: function(newData, oldData) {
const that = this;
that.trData = JSON.parse(JSON.stringify(newData));
}
},
mounted() {
const that = this;
that.trData = JSON.parse(JSON.stringify(that.value));
}
/* beforeDestroy() {} */
};
</script>
<style lang="less" scoped>
.li-cell {
min-height: 26px;
line-height: 26px;
}
.w-110 {
width: 110px;
}
.w-320 {
width: 320px;
}
.m-t-14 {
margin-top: 14px;
}
.child-row {
padding-left: 10px;
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2018-10-10 14:44:45
* @LastEditors: 无尘
* @LastEditTime: 2019-09-25 17:00:58
-->
<template>
<div class="review-wrap">
<!-- 公共头部菜单插件 -->
<vue-office-header :projectName="projectName" @collapseTag="collapseTag" @toRouterView="toRouterView"> </vue-office-header>
<div class="setting-wrap__body">
<div id="content" class="content">
<div class="content-body" :style="{ height: contentHeight }">
<div class="left-menu" :style="{ height: contentHeight }">
<vue-office-aside ref="asideMenu" :projectName="projectName" :collapseFlag="collapseFlag"> </vue-office-aside>
</div>
<transition name="fade" mode="out-in">
<!-- 缓存已经填好内容的页面 -->
<!-- <keep-alive include="editGroupGrade"> -->
<router-view></router-view>
<!-- </keep-alive > -->
</transition>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'reviewed',
data() {
return {
projectName: 'haoban-manage-web', // 当前项目名
collapseFlag: false, // 折叠参数
contentHeight: '0px' //页面内容高度
};
},
computed: {},
methods: {
// 处理路由跳转
toRouterView(val) {
const that = this;
// 模拟检查数据,有两个参数
/*{
name:,
path:
}*/
that.$router.push({
path: val.path
});
},
// 折叠事件
collapseTag(val) {
const that = this;
that.collapseFlag = val;
}
},
watch: {
$route: {
handler: function(val, oldVal) {
this.$refs.asideMenu.refreshRoute();
},
// 深度观察监听
deep: true
}
},
mounted() {
const that = this;
that.contentHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 64 + 'px';
}
};
</script>
<style lang="less">
.review-wrap {
background-color: #f0f2f5;
}
.setting-wrap__body {
.content {
padding-top: 64px;
/* height: calc(100% - 64px);
overflow-y: auto;*/
min-width: 1400px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
.content-body {
display: flex;
overflow: hidden;
.common-set-wrap {
position: relative;
width: 100%;
height: 100%;
overflow-y: auto;
.right-content {
/*width: 100%;*/
padding: 24px;
min-height: calc(100% - 240px);
.right-box {
background: #fff;
padding: 24px;
}
}
}
}
}
}
.el-table__body-wrapper .el-table__empty-block {
height: 256px;
}
.el-table__empty-text {
width: auto;
margin-bottom: 80px;
&::before {
content: ' ';
display: block;
width: 60px;
height: 60px;
background: url(../../assets/no-data_icon.png) no-repeat center;
margin: 0px auto 22px auto;
}
}
.el-table__empty-text {
margin-bottom: 0;
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2018-10-10 16:47:28
* @LastEditors: 无尘
* @LastEditTime: 2019-11-18 09:32:40
-->
<template>
<div class="companyAddress-wrap common-set-wrap">
<nav-crumb :navpath="navpath"></nav-crumb>
<div class="right-content">
<div class="right-box" :style="{ height: $store.state.bgHeight }">
<h2 class="font-w-500">企业地址设置</h2>
<p class="m-t-24">暂时无法设置</p>
<!-- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="企业地址" prop="switch" class="m-t-22">开启后手机端通讯录将显示,反之则不显示
<el-switch v-model="ruleForm.switch"></el-switch>
</el-form-item>
<el-form-item label=" " prop="name" class="" v-if="ruleForm.switch">
<el-input v-model="ruleForm.name" placeholder="请输入地址" class="w-380"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('ruleForm')">保 存</el-button>
</el-form-item>
</el-form> -->
</div>
</div>
<vue-gic-footer></vue-gic-footer>
</div>
</template>
<script>
import navCrumb from '@/components/nav/nav.vue';
// import showMsg from '@/common/js/showmsg';
// import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public';
// import { getRequest, postRequest, postJson, postForm } from '@/api/api';
export default {
name: 'companyAddress',
data() {
const nameValid = (rule, value, callback) => {
if (!!this.ruleForm.switch && value.replace(/\s/g) == '') {
callback(new Error('请输入地址'));
} else {
callback();
}
};
return {
// 面包屑参数
navpath: [
{
name: '首页',
path: '/index'
},
{
name: '设置',
path: '/companyAddress'
},
{
name: '企业设置',
path: '/companyAddress'
},
{
name: '企业地址',
path: ''
}
],
ruleForm: {
switch: false,
name: ''
},
rules: {
name: [
{ validator: nameValid, trigger: 'blur' } //required: true,
]
}
};
},
computed: {},
methods: {
/**
* 保存
*/
submitForm: _debounce(function(formName) {
const that = this;
that.$refs[formName].validate(valid => {
/* eslint-disable */
if (valid) {
} else {
return false;
}
});
}, 500),
/**
* 保存---api
*/
postSave() {
const that = this;
that.ruleForm = [];
}
},
// mounted() {},
components: {
navCrumb
}
};
</script>
<style lang="less" scoped>
.right-content {
/*width: 100%;*/
padding: 24px;
min-height: calc(100% - 240px);
.right-box {
background: #fff;
padding: 24px;
min-height: 500px;
h2 {
font-size: 16px;
color: #303133;
}
p {
font-size: 14px;
color: #909399;
}
.m-t-24 {
margin-top: 24px;
}
.w-380 {
width: 380px;
}
}
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-08-01 14:42:38
* @LastEditors: 无尘
* @LastEditTime: 2019-09-25 17:02:30
-->
<template>
<div class="storePermission-wrap common-set-wrap">
<nav-crumb :navpath="navpath"></nav-crumb>
<div class="right-content">
<div class="right-box">
<div class="">
<div class="check-box-wrap inline-block vertical-top">
<el-checkbox v-model="contactHideFlag">隐藏通讯录模块</el-checkbox>
</div>
<div class="tip-text-wrap w-440 inline-block vertical-top">注:隐藏后,APP将不展示通讯录,通讯录仍可用,但无法进行通讯录及门店管理,以及添加员工操作。所有通讯录内容仅可在PC管理后台进行操作和管理。</div>
</div>
<div>
<el-button type="primary" @click="saveSet">保 存</el-button>
</div>
</div>
</div>
<vue-gic-footer></vue-gic-footer>
</div>
</template>
<script>
import navCrumb from '@/components/nav/nav.vue';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api';
export default {
name: 'contactPermission',
data() {
return {
// 面包屑参数
navpath: [
{
name: '首页',
path: '/index'
},
{
name: '设置',
path: '/companyAddress'
},
{
name: '通讯录信息',
path: '/staffDetails'
},
{
name: '通讯录控制',
path: ''
}
],
contactHideFlag: false
};
},
methods: {
saveSet: _debounce(function() {
const that = this;
let para = {
contactHideFlag: that.contactHideFlag ? '1' : '0'
};
postRequest('/haoban-manage-web/contact/save-contact-setting', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('保存成功', 'success');
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}, 300),
/**
* 获取设置数据
*/
getSetData() {
const that = this;
let para = {};
postRequest('/haoban-manage-web/contact/find-contact-setting', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.contactHideFlag = resData.result.contactHideFlag == 1 ? true : false;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
mounted() {
const that = this;
that.getSetData();
},
components: {
navCrumb
}
};
</script>
<style lang="less" scoped>
.bg-fff {
background: #fff;
}
.common-set-wrap {
.right-content {
/*width: 100%;*/
padding: 24px;
min-height: calc(100% - 240px);
.right-box {
/*background: #fff;*/
/*padding: 24px;*/
min-height: 500px;
.m-t-24 {
margin-top: 24px;
}
.w-440 {
width: 440px;
white-space: pre-wrap;
word-break: break-all;
font-size: 12px;
color: #909399;
}
.tip-text-wrap {
line-height: 24px;
padding-left: 20px;
}
.vertical-top {
vertical-align: top;
}
}
}
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2018-10-10 14:44:45
* @LastEditors: 无尘
* @LastEditTime: 2018-10-10 14:44:45
-->
<template>
<div class="setting-wrap">
<!-- 公共头部菜单插件 -->
<vue-office-header :projectName="projectName" @collapseTag="collapseTag" @toRouterView="toRouterView"> </vue-office-header>
<div class="setting-wrap__body">
<div id="content" class="content">
<div class="content-body" :style="{ height: contentHeight }">
<div class="left-menu" :style="{ height: contentHeight }">
<vue-office-aside ref="asideMenu" :projectName="projectName" :collapseFlag="collapseFlag"> </vue-office-aside>
</div>
<transition name="fade" mode="out-in">
<!-- 缓存已经填好内容的页面 -->
<!-- <keep-alive include="editGroupGrade"> -->
<router-view></router-view>
<!-- </keep-alive > -->
</transition>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'setting',
data() {
return {
projectName: 'haoban-manage-web',
contentHeight: '0px', //页面内容高度
collapseFlag: false // 折叠参数
};
},
computed: {},
methods: {
// 处理路由跳转
toRouterView(val) {
let that = this;
// 模拟检查数据
// //有两个参数
//{
// name:,
// path:
//}
that.$router.push({
path: val.path
});
},
// 折叠事件
collapseTag(val) {
const that = this;
that.collapseFlag = val;
}
},
watch: {
$route: {
handler: function(val, oldVal) {
// console.log("获取当前路由:",val,oldVal);
this.$refs.asideMenu.refreshRoute();
},
// 深度观察监听
deep: true
}
},
mounted() {
const that = this;
//获取项目名 pathname (路由的hash)
that.pathName = window.location.hash.split('/')[1];
that.contentHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 64 + 'px';
}
};
</script>
<style lang="less">
.setting-wrap {
background-color: #f0f2f5;
}
.setting-wrap__body {
.content {
padding-top: 64px;
/* height: calc(100% - 64px);
overflow-y: auto;*/
min-width: 1400px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
.content-body {
display: flex;
overflow: hidden;
.common-set-wrap {
position: relative;
width: 100%;
height: 100%;
overflow-y: auto;
.right-content {
/*width: 100%;*/
padding: 24px;
min-height: calc(100% - 240px);
.right-box {
background: #fff;
padding: 24px;
}
}
&.setChildAdmin-wrap {
.right-content {
.right-box {
background: transparent;
padding: 0;
}
}
}
}
}
}
}
/*.content-body .left-menu {
-ms-flex: 0 0 200px;
flex: 0 0 200px;
width: 200px;
height: 100%;
background: #020b21;
transition: all .2s ease;
position: fixed;
z-index: 5;
}*/
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2018-10-10 16:55:06
* @LastEditors: 无尘
* @LastEditTime: 2019-09-25 17:02:54
-->
<template>
<div class="staffDetails-wrap common-set-wrap">
<nav-crumb :navpath="navpath"></nav-crumb>
<div class="right-content">
<div class="right-box" :style="{ height: $store.state.bgHeight, 'overflow-y': 'auto' }">
<div class="staffDetails-cell">
<h2 class="m-b-25 font-w-500">{{ adminStruct.name }}</h2>
<div class="staffDetails-cell-fixed">
<template v-for="(item, index) in adminStruct.fixedList">
<el-button disabled class="staffDetails-cell-btn" :key="'btn1' + index">{{ item.fieldName }}</el-button>
</template>
</div>
<div class="staffDetails-cell-add font-0">
<template v-for="(item, index) in adminStruct.defineList">
<el-tag class="staffDetails-cell-btn" :key="'tag1' + index">{{ item.fieldName }} <i class="el-icon-circle-close" @click.stop="delField(index, item, adminStruct.defineList, 1)"></i></el-tag>
</template>
<el-button class="el-tag m-l-8 staffDetails-cell-btn" @click.stop="showDialogLayer(1)"><i class="el-icon-plus"></i>添加字段</el-button>
</div>
</div>
<div class="staffDetails-cell">
<h2 class="m-b-25 font-w-500">{{ storeStruct.name }}</h2>
<div class="staffDetails-cell-fixed">
<template v-for="(item, index) in storeStruct.fixedList">
<el-button disabled class="staffDetails-cell-btn" :key="'btn' + index">{{ item.fieldName }}</el-button>
</template>
</div>
<div class="staffDetails-cell-add font-0">
<template v-for="(item, index) in storeStruct.defineList">
<el-tag class="staffDetails-cell-btn" :key="'tag' + index">{{ item.fieldName }} <i class="el-icon-circle-close" @click.stop="delField(index, item, storeStruct.defineList, 2)"></i></el-tag>
</template>
<el-button class="el-tag m-l-8 staffDetails-cell-btn" @click.stop="showDialogLayer(2)"><i class="el-icon-plus"></i>添加字段</el-button>
</div>
</div>
</div>
</div>
<vue-gic-footer></vue-gic-footer>
<!-- 自定义字段 -->
<staff-detail-field :detailData="detailData" :showCustomDialog="showCustomDialog" :dataType="dataType" @customHandleConfirm="customHandleConfirm"> </staff-detail-field>
</div>
</template>
<script>
import navCrumb from '@/components/nav/nav.vue';
import staffDetailField from '@/components/set/staff-detail-field.vue';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { postRequest } from '@/api/api';
export default {
name: 'staffDetails',
data() {
return {
// 面包屑参数
navpath: [
{
name: '首页',
path: '/index'
},
{
name: '设置',
path: '/companyAddress'
},
{
name: '通讯录信息',
path: '/staffDetails'
},
{
name: '员工详细字段',
path: ''
}
],
// 固定的字段
fixData: ['clerkName', 'clerkPhone', 'groupName', 'positionName'],
fixDataStore: ['clerkName', 'clerkPhone', 'groupName', 'positionName', 'clerkCode'],
// 行政架构
adminStruct: {
name: '行政架构通讯录员工详情字段',
fixedList: [
/*{
fieldName: "姓名",
fields: "clerkName"
}*/
],
defineList: [
/* {
fieldName: "姓名",
fields: "clerkName"
},*/
]
},
// 门店架构'
storeStruct: {
name: '门店架构通讯录员工详情字段',
fixedList: [
/* {
fieldName: "姓名",
fields: "clerkName"
},*/
],
defineList: [
/* {
fieldName: "姓名",
fields: "clerkName"
}*/
]
},
showCustomDialog: false, // 自定义弹框显示标志
detailData: [], // 已选数据 '类型:1行政架构,2门店架构'
dataType: null //'类型:1行政架构,2门店架构'
};
},
computed: {},
methods: {
/**
* 自定义弹窗显示事件
*/
showDialogLayer(type) {
const that = this;
that.showCustomDialog = true;
that.dataType = type;
if (type === 1) {
that.detailData = that.adminStruct.fixedList.map(item => item.fields).concat(that.adminStruct.defineList.map(item => item.fields));
} else {
that.detailData = that.storeStruct.fixedList.map(item => item.fields).concat(that.storeStruct.defineList.map(item => item.fields));
}
},
/**
* 自定义弹框触发事件
*/
customHandleConfirm(val) {
const that = this;
that.showCustomDialog = false;
if (!!val) {
return false;
}
that.getSaveFields(that.dataType);
},
/**
* 删除字段
*/
delField(index, item, list, flag) {
const that = this;
that
.$alert('确定要删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
})
.then(({ value }) => {
that.postDlField(item.fields, flag, list, index);
})
.catch(() => {});
},
/**
* 删除字段---api
*/
postDlField(code, type, list, index) {
const that = this;
const para = {
fields: code,
type: type // 类型:1行政架构,2门店架构'
};
postRequest('/haoban-manage-web/record/employee-show-field-delete.json', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('删除成功', 'success');
list.splice(index, 1);
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 获取已经选择的字段
*/
getSaveFields(type) {
const that = this;
if (type === 1) {
that.adminStruct.fixedList = [];
that.adminStruct.defineList = [];
} else {
that.storeStruct.fixedList = [];
that.storeStruct.defineList = [];
}
const para = {
type: type // 类型:1行政架构,2门店架构'
};
postRequest('/haoban-manage-web/record/employee-show-field-detail.json', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
resData.result.forEach(function(ele, index) {
if (Number.parseInt(type) === 1) {
that.fixData.includes(ele.fields) ? that.adminStruct.fixedList.push(ele) : that.adminStruct.defineList.push(ele);
} else {
that.fixDataStore.includes(ele.fields) ? that.storeStruct.fixedList.push(ele) : that.storeStruct.defineList.push(ele);
}
});
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
mounted() {
const that = this;
Promise.all([that.getSaveFields(1), that.getSaveFields(2)]);
},
components: {
navCrumb,
staffDetailField
}
};
</script>
<style lang="less" scoped>
.right-content {
/*width: 100%;*/
padding: 24px;
min-height: calc(100% - 240px);
.right-box {
background: #fff;
padding: 24px;
min-height: 500px;
h2 {
font-size: 16px;
color: #303133;
}
.m-l-8 {
margin-left: 8px;
}
.m-r-20 {
margin-left: 20px;
}
.m-b-25 {
margin-bottom: 25px;
}
.staffDetails-cell {
& + .staffDetails-cell {
margin-top: 14px;
padding-top: 36px;
border-top: 1px solid #e4e7ed;
}
}
.el-tag {
position: relative;
cursor: pointer;
.el-icon-circle-close {
position: absolute;
top: -10px;
right: -10px;
font-size: 16px;
color: #808995;
cursor: pointer;
&:hover {
color: #f56c6c;
}
}
}
.staffDetails-cell-btn {
width: 110px;
height: 32px;
padding: 0;
margin: 0 20px 20px 0;
text-align: center;
vertical-align: top;
font-size: 12px;
}
}
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-05-10 09:43:35
* @LastEditors: 无尘
* @LastEditTime: 2019-09-25 17:01:20
-->
<template>
<div class="sign-contain">
<div class="sign-content border-box">
<div>
<el-date-picker class="m-l-10" v-model="choiceDate" @change="changeDate" :picker-options="pickerOptions" :editable="false" :value-format="'yyyy-MM-dd'" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker>
</div>
<div class="m-t-20">
<store-tree-select :brandId="brandId" :activeGroupId="activeGroupId" @checkStoreGroupIds="checkStoreGroupIds"> </store-tree-select>
</div>
<div class="m-t-20">
<el-button type="primary" class="m-l-10" @click="exportData"><i class="iconfont icon-icon_yunxiazai p-r-6"></i>导 出</el-button>
</div>
</div>
</div>
</template>
<script>
import storeTreeSelect from '@/components/app/store-tree-select.vue';
import { getRequest } from '@/api/api';
import errMsg from '@/common/js/error';
export default {
name: 'index',
components: {
storeTreeSelect
},
data() {
return {
projectName: 'haoban-manage-web', // 当前项目名
contentHeight: '0px', // 页面内容高度
choiceDate: [],
choiceDateCopy: [],
pickerOptions: {
onPick: ({ maxDate, minDate }) => {
this.choiceDateCopy = [minDate.getTime()];
if (maxDate) {
this.choiceDateCopy = [];
}
},
disabledDate: time => {
if (this.choiceDateCopy.length) {
const one = 31 * 24 * 3600 * 1000;
const minTime = this.choiceDateCopy[0] - one;
const maxTime = this.choiceDateCopy[0] + one;
return time.getTime() < minTime || time.getTime() > maxTime || time.getTime() > Date.now() - 8.64e6;
}
return time.getTime() > Date.now() - 8.64e6;
}
},
brandId: '',
activeGroupId: '',
storeGroupIds: []
};
},
methods: {
/**
* 导出数据
*/
exportData() {
let that = this;
that.postExportData();
},
postExportData() {
let that = this;
let para = {
date: that.choiceDate,
storeIds: that.storeGroupIds
};
getRequest('/haoban-manage-web/home/find-quick-entry', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.entryData = resData.result;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 日期
*/
changeDate(e) {
let that = this;
if (!e) {
that.choiceDateCopy = [];
that.choiceDate = [];
} else {
that.choiceDateCopy = JSON.parse(JSON.stringify(that.choiceDate));
}
},
/**
* 选择门店分组
*/
checkStoreGroupIds: function(nodes) {
let that = this;
that.currentPage = 1;
that.storeGroupIds = nodes;
},
/**
* 获取门店数据
*/
getStoreData() {
const that = this;
let para = {};
getRequest('/haoban-manage-web/home/find-quick-entry', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.entryData = resData.result;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
mounted() {
const that = this;
that.getStoreData();
}
};
</script>
<style lang="less" scoped>
.sign-contain {
width: 100%;
.sign-content {
width: 100%;
padding: 20px;
.m-l-10 {
margin-left: 10px;
}
/* .item-cell-select {
&.m-l-10 {
margin-left: 0;
}
} */
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment