Commit 8cace42f by caoyanzhi

update: 权限调整

parent 33637a3a
...@@ -11,8 +11,8 @@ module.exports = { ...@@ -11,8 +11,8 @@ module.exports = {
assign: ['分配', 1, 2], assign: ['分配', 1, 2],
}, },
memberTagSet: { memberTagSet: {
// 1.同步历史 (按钮,控制“同步记录”页面的所哟有操作权限) willSyncTag: ['待开启同步标签', 1, 2],
syncTagLog: ['同步历史', 0, 0, 'syncHistory'] breakSyncTag: ['关闭同步', 1, 2]
}, },
// 客户展示设置 // 客户展示设置
memberShowSet: { memberShowSet: {
...@@ -24,10 +24,17 @@ module.exports = { ...@@ -24,10 +24,17 @@ module.exports = {
delShowRules: ['删除', 1, 1] delShowRules: ['删除', 1, 1]
}, },
memberGroupSet: { memberGroupSet: {
// 按钮名称、是否受权限控制0否1是、是否增删改0:跳转 1:增删改 2:其他、按钮跳转路径
memberGroupList: ['客户分组列表', 0, 0, 'memberGroupList'],
memberGroupSetList: ['分组展示设置', 0, 0, 'memberGroupSetList']
},
memberGroupList: {
// 1.会员分组失效后不展示(按钮) // 1.会员分组失效后不展示(按钮)
groupExpire: ['分组失效后不展示', 1, 2], groupExpire: ['分组失效后不展示', 1, 2],
// 2.立即同步(按钮) // 2.立即同步(按钮)
syncGroup: ['立即同步', 1, 2], syncGroup: ['立即同步', 1, 2]
},
memberGroupSetList: {
// 1.新建模板 (按钮,控制“客户分组设置”新建页面内所有操作权限) // 1.新建模板 (按钮,控制“客户分组设置”新建页面内所有操作权限)
addGroupTemp: ['新建模板', 1, 0, 'addGroupTemplate'], addGroupTemp: ['新建模板', 1, 0, 'addGroupTemplate'],
// 2.编辑 (按钮,控制“客户分组设置”修改页面内所有操作权限) // 2.编辑 (按钮,控制“客户分组设置”修改页面内所有操作权限)
...@@ -158,12 +165,18 @@ module.exports = { ...@@ -158,12 +165,18 @@ module.exports = {
// 1.保存(按钮) // 1.保存(按钮)
saveTaskSet: ['保存', 1, 1] saveTaskSet: ['保存', 1, 1]
}, },
'daily-setting': {
systemReport: ['系统报表', 0, 0],
customReport: ['自定义报表', 0, 0],
},
// 云日报设置-系统报表 // 云日报设置-系统报表
systemReport: { systemReport: {
// 1.模板设置(按钮,控制“模板设置”弹窗内所有操作权限); // 1.模板设置(按钮,控制“模板设置”弹窗内所有操作权限);
settingSystemReport: ['模板设置', 1, 2], settingSystemReport: ['模板设置', 1, 2],
// 2.保存并启用(按钮) // 2.保存并启用(按钮)
saveSystemReport: ['保存并启用', 1, 2], saveSystemReport: ['保存并启用', 1, 2],
},
customReport: {
// 1.新建模板(按钮,控制“新建模板”页面内所有操作权限); // 1.新建模板(按钮,控制“新建模板”页面内所有操作权限);
addCustomReport: ['新建模板', 1, 0, 'customReportSet'], addCustomReport: ['新建模板', 1, 0, 'customReportSet'],
// 2.复制(按钮,控制“新建模板”页面内所有操作权限); // 2.复制(按钮,控制“新建模板”页面内所有操作权限);
...@@ -288,8 +301,14 @@ module.exports = { ...@@ -288,8 +301,14 @@ module.exports = {
// 导购设置-导购操作权限设置 // 导购设置-导购操作权限设置
// 保存(按钮) // 保存(按钮)
'guide-setting': { 'guide-setting': {
saveGuideSetting: ['导购操作权限设置-保存', 1, 1], guideAuthSetting: ['导购操作权限设置', 0, 0],
saveAppsVisible: ['应用可见权限设置-保存', 1, 1], appVisibleSetting: ['应用可见权限设置', 0, 0]
},
'guide-auth-setting': {
saveGuideSetting: ['保存', 1, 1],
},
'app-visible-setting': {
saveAppsVisible: ['保存', 1, 1],
}, },
enterpriseSet: { enterpriseSet: {
// 1.同步刷新(按钮) // 1.同步刷新(按钮)
......
...@@ -30,9 +30,15 @@ module.exports = [ ...@@ -30,9 +30,15 @@ module.exports = [
{ {
menu: ['客户分组设置', 'memberGroupSet', 1], menu: ['客户分组设置', 'memberGroupSet', 1],
children: [ children: [
{ menu: ['新建模板', 'addGroupTemplate', 1 ]}, { menu: ['会员分组列表', '', 1] },
{ menu: ['编辑模板', 'editGroupTemplate', 1] }, {
{ menu: ['门店范围设置', 'storeRangeSet', 1] }, menu: ['分组展示设置', '', 1],
children: [
{ menu: ['新建模板', 'addGroupTemplate', 1] },
{ menu: ['编辑模板', 'editGroupTemplate', 1] },
{ menu: ['门店范围设置', 'storeRangeSet', 1] },
]
},
] ]
}, },
{ menu: ['客户管理设置', 'memberSearchSet', 1] }, { menu: ['客户管理设置', 'memberSearchSet', 1] },
...@@ -148,11 +154,17 @@ module.exports = [ ...@@ -148,11 +154,17 @@ module.exports = [
{ menu: ['云日报导出', 'dailyExport', 1] }, { menu: ['云日报导出', 'dailyExport', 1] },
{ menu: ['任务下发设置', 'taskAssign', 1] }, { menu: ['任务下发设置', 'taskAssign', 1] },
{ {
menu: ['云日报设置', 'systemReport', 1], menu: ['云日报设置', 'daily-setting', 1],
children: [ children: [
{ menu: ['新建模板', 'customReportSet', 1]}, { menu: ['系统报表', 'systemReport', 1] },
{ menu: ['复制模板', 'customReportCopy', 1]}, {
{ menu: ['编辑模板', 'customReportEdit', 1]} menu: ['自定义报表', 'customReport', 1],
children: [
{ menu: ['新建模板', 'customReportSet', 1]},
{ menu: ['复制模板', 'customReportCopy', 1]},
{ menu: ['编辑模板', 'customReportEdit', 1]}
]
},
] ]
}, },
] ]
...@@ -215,7 +227,13 @@ module.exports = [ ...@@ -215,7 +227,13 @@ module.exports = [
{ {
menu: ['导购设置', '', 1, 'icondaogoushezhi'], menu: ['导购设置', '', 1, 'icondaogoushezhi'],
children: [ children: [
{ menu: ['导购设置', 'guide-setting', 1] } {
menu: ['导购设置', 'guide-setting', 1],
children: [
{ menu: ['导购操作权限设置', 'guide-auth-setting', 1] },
{ menu: ['应用可见权限设置', 'app-visible-setting', 1] }
],
}
] ]
}, },
{ {
......
...@@ -114,7 +114,19 @@ export const constantRouterMap = [ ...@@ -114,7 +114,19 @@ export const constantRouterMap = [
{ {
path: '/guide-setting', path: '/guide-setting',
name: '导购设置', name: '导购设置',
component: _import('enterprise', 'guide-setting') component: _import('enterprise', 'guide-setting'),
children: [
{
path: '/guide-auth-setting',
name: '导购操作权限设置',
component: _import('enterprise', 'guide-auth-setting')
},
{
path: '/app-visible-setting',
name: '应用可见权限设置',
component: _import('enterprise', 'app-visible-setting')
}
]
}, },
{ {
path: '/setting', path: '/setting',
...@@ -234,7 +246,19 @@ export const constantRouterMap = [ ...@@ -234,7 +246,19 @@ export const constantRouterMap = [
{ {
path: '/memberGroupSet', path: '/memberGroupSet',
name: '客户分组设置', name: '客户分组设置',
component: _import('apps/customerApp', 'memberGroupSet') component: _import('apps/customerApp', 'memberGroupSet'),
children: [
{
path: '/memberGroupList',
name: '客户分组列表',
component: _import('apps/customerApp', 'memberGroupList'),
},
{
path: '/memberGroupSetList',
name: '客户分组列表',
component: _import('apps/customerApp', 'memberGroupSetList'),
},
]
}, },
{ {
path: '/memberSearchSet', path: '/memberSearchSet',
...@@ -298,15 +322,22 @@ export const constantRouterMap = [ ...@@ -298,15 +322,22 @@ export const constantRouterMap = [
component: _import('apps/cloudDaily', 'taskAssign') component: _import('apps/cloudDaily', 'taskAssign')
}, },
{ {
path: '/systemReport', path: '/daily-setting',
name: '系统报表', name: '系统报表',
component: _import('apps/cloudDaily', 'daily-setting') component: _import('apps/cloudDaily', 'daily-setting'),
children: [
{
path: '/systemReport',
name: '系统报表',
component: _import('apps/cloudDaily', 'systemReport')
},
{
path: '/customReport',
name: '自定义报表',
component: _import('apps/cloudDaily', 'customReport')
},
]
}, },
// {
// path: '/customReport',
// name: '自定义报表',
// component: _import('apps/cloudDaily', 'customReport')
// },
{ {
path: '/customReportSet', path: '/customReportSet',
name: '新增自定义报表设置', name: '新增自定义报表设置',
......
...@@ -195,25 +195,11 @@ export default { ...@@ -195,25 +195,11 @@ export default {
}); });
} }
}, },
watch: {
brandId: function(newData, oldData) {
let that = this;
if (!!newData) {
that.activeBrand = newData;
that.getData();
}
}
},
mounted() { mounted() {
document.documentElement.style.backgroundColor = '#f0f2f5';
this.$emit('showTab', '32');
if (!!this.brandId) { if (!!this.brandId) {
this.getData(); this.getData();
} }
}, },
destroyed() {
document.documentElement.style.backgroundColor = '#fff';
},
components: { components: {
appDetail, appDetail,
commonDetailTop, commonDetailTop,
......
<template> <template>
<el-tabs class="daily-setting" v-model="activeName"> <div>
<el-tab-pane label="系统报表" name="first"> <el-tabs class="daily-setting" v-model="activeName" @tab-click="handleClick">
<system-report></system-report> <el-tab-pane v-if="$getButtonLimit($buttonCode.systemReport)" :limit-code="$buttonCode.systemReport" label="系统报表" name="/systemReport"></el-tab-pane>
</el-tab-pane> <el-tab-pane v-if="$getButtonLimit($buttonCode.customReport)" :limit-code="$buttonCode.customReport" label="自定义报表" name="/customReport"></el-tab-pane>
<el-tab-pane label="自定义报表" name="second"> </el-tabs>
<custom-report></custom-report> <router-view :brand-id="brandId"></router-view>
</el-tab-pane> </div>
</el-tabs>
</template> </template>
<script> <script>
import SystemReport from './systemReport.vue';
import CustomReport from './customReport.vue';
export default { export default {
name: 'DailySetting', name: 'DailySetting',
components: { SystemReport, CustomReport }, props: {
brandId: {
type: String,
default: ''
}
},
data() { data() {
return { return {
activeName: 'first' activeName: ''
}; };
},
methods: {
handleClick() {
this.$router.replace(this.activeName);
}
},
created() {
if (this.$route.path == '/daily-setting') {
if (this.$getButtonLimit(this.$buttonCode.systemReport)) {
this.activeName = '/systemReport';
} else if (this.$getButtonLimit(this.$buttonCode.customReport)) {
this.activeName = '/customReport';
}
if (this.activeName) {
this.handleClick();
}
} else {
this.activeName = this.$route.path;
}
} }
}; };
</script> </script>
......
...@@ -290,7 +290,6 @@ export default { ...@@ -290,7 +290,6 @@ export default {
mounted() { mounted() {
const that = this; const that = this;
that.$emit('showTab', '12'); that.$emit('showTab', '12');
sessionStorage.setItem('memberGroupSet', 'second');
if (that.brandId && !!that.$route.query.templateId) { if (that.brandId && !!that.$route.query.templateId) {
that.getTemplateSet(that.brandId); that.getTemplateSet(that.brandId);
} }
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-26 10:01:07
-->
<!--
我的客户应用:
<app-detail ></app-detail>
-->
<template>
<div class="app-detail-pane border-box p-lbr-20">
<div class="condition-wrap flex flex-space-between">
<div>
<el-input placeholder="请输入分组名称" maxlength="50" v-model="conditionObj.searchInput" class="w-264" style="width: 217px;" prefix-icon="el-icon-search" @keyup.native="value => toInput(value, conditionObj.searchInput)" clearable @clear="clearInput"></el-input
><el-select class="w-168 m-l-10" v-model="conditionObj.classifyName" placeholder="全部分类" @change="changeCondition">
<el-option label="全部分类" value=""></el-option>
<el-option v-for="item in classifyList" :key="item" :label="item" :value="item"> </el-option> </el-select
><el-select class="w-168 m-l-10" v-model="conditionObj.effectiveStatus" placeholder="全部状态" @change="changeCondition">
<el-option label="全部状态" value=""></el-option>
<el-option label="有效" value="1"></el-option>
<el-option label="失效" value="0"></el-option>
</el-select>
</div>
<div>
<el-checkbox v-if="$getButtonLimit($buttonCode.groupExpire)" :limit-code="$buttonCode.groupExpire" v-model="overTimeSeeFlag" @change="saveGroupSet" :disabled="$store.state.wxEnterpriseType">
<el-tooltip class="item" effect="dark" content="开启后,GIC中设置的好办端会员分组失效后,即使在GIC开启好办展示,好办移动端也不再展示该条分组" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;margin-left:-4px;" class="font-14 color-606266 m-r-20">会员分组失效后不展示</span></el-tooltip>
</el-checkbox>
<el-button v-if="$getButtonLimit($buttonCode.syncGroup)" :limit-code="$buttonCode.syncGroup" type="primary" :loading="loadingBtn" @click="toSync" :disabled="$store.state.wxEnterpriseType">立即同步</el-button>
<span v-if="syncDate" class="font-14 color-606266 p-r-10">最近一次同步时间:{{ syncDate | formatTimeStamp }}</span>
</div>
</div>
<div class="m-t-20">
<el-table class="select-table" ref="multipleTable" v-loading="loading" :data="groupListData" tooltip-effect="dark" :style="{ width: '100%' }">
<el-table-column label="分组名称" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.groupName }}</template>
</el-table-column>
<el-table-column prop="" label="分类">
<template slot-scope="scope">{{ scope.row.memberTagGroupClassifyName }}</template>
</el-table-column>
<el-table-column prop="" label="是否实时" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.isRealTime == 1 ? '是' : '否' }}</template>
</el-table-column>
<el-table-column prop="" label="是否固化" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.curingFlag == 1 ? '是' : '否' }}</template>
</el-table-column>
<el-table-column prop="" label="更新频率" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.updateType == 1 ? '每日' : scope.row.updateType == 2 ? '每周' : scope.row.updateType == 3 ? '每月' : '-' }} {{ scope.row.updateType == 1 ? '一次' : scope.row.updateType == 2 ? '周' + scope.row.updateDay : scope.row.updateType == 3 ? scope.row.updateDay + '号' : '-' }} </template>
</el-table-column>
<el-table-column prop="" label="状态" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.effectiveStatus == '1' ? '有效' : '失效' }}</template>
</el-table-column>
<el-table-column prop="" label="覆盖人数" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.memberCount || 0 }}</template>
</el-table-column>
<el-table-column prop="" label="到期时间" show-overflow-tooltip>
<template slot-scope="scope">
<div class="line-18">{{ scope.row.effectiveDate | timeStampToYmd }}</div>
<div class="line-18">{{ scope.row.effectiveDate | timeStampToHms }}</div>
</template>
</el-table-column>
</el-table>
<div class="block common-wrap__page text-right m-t-24" v-if="groupListData.length != 0">
<dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination>
</div>
</div>
</div>
</template>
<script>
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: 'app-detail',
props: {
brandId: {
type: String,
default() {
return '';
}
}
},
data() {
return {
wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '',
overTimeSeeFlag: false,
// 会员分组设置
conditionObj: {
searchInput: '',
classifyName: '',
effectiveStatus: ''
},
groupListData: [], // 列表数据
classifyList: [], // 会员分组
currentPage: 1,
pageSize: 20,
total: 0,
loading: false,
// 最近同步时间
syncDate: '',
loadingBtn: false
};
},
methods: {
/**
* 获取同步时间
*/
getSyncDate(brandId) {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/memberGroup/get-group_last_syn_time', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.syncDate = resData.result;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 立即同步
*/
toSync: _debounce(function() {
const that = this;
that.loadingBtn = true;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/memberGroup/syn-group', para)
.then(res => {
let resData = res.data;
that.loadingBtn = false;
if (resData.errorCode == 1) {
showMsg.showmsg('同步成功', 'success');
that.getSyncDate();
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.loadingBtn = false;
that.$message.error({
duration: 1000,
message: error.message
});
});
}, 500),
/**
* 获取分组设置
*/
getGroupClassSet(brandId) {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/memberGroup/get-member-group-setting', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.overTimeSeeFlag = resData.result == 0 ? false : true;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 保存分组设置
*/
saveGroupSet() {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
overTimeSeeFlag: that.overTimeSeeFlag == true ? 1 : 0
};
postRequest('/haoban-app-customer-web/memberGroup/save-member-group-setting', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('设置成功', 'success');
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 输入
*/
toInput: _debounce(function(e, value) {
const that = this;
that.currentPage = 1;
that.getGroupList(that.brandId);
}, 500),
// 搜索清除
clearInput() {
const that = this;
that.currentPage = 1;
that.getGroupList(that.brandId);
},
changeCondition() {
const that = this;
that.currentPage = 1;
that.getGroupList(that.brandId);
},
/**
* 获取会员分组分类
*/
getGroupClassify(brandId) {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/memberGroup/get-member-class-list', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.classifyList = resData.result.list || [];
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 分页---页码变化
* @param {Number} val
*/
handleSizeChange(val) {
const that = this;
that.currentPage = 1;
that.pageSize = val;
that.getGroupList(that.brandId);
},
/**
* 分页---当前页变化
* @param {Number} val
*/
handleCurrentChange(val) {
const that = this;
that.currentPage = val;
that.getGroupList(that.brandId);
},
/**
* 获取会员分组列表
*/
getGroupList(brandId) {
const that = this;
that.loading = true;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
memberGroupName: that.conditionObj.searchInput,
classifyName: that.conditionObj.classifyName,
effectiveStatus: that.conditionObj.effectiveStatus,
pageNum: that.currentPage,
pageSize: that.pageSize
};
postRequest('/haoban-app-customer-web/memberGroup/member-tag-group-list', para)
.then(res => {
let resData = res.data;
that.loading = false;
if (resData.errorCode == 1) {
if (resData.result.list && resData.result.list.length) {
resData.result.list.forEach(ele => {
ele.isSendTemplate = ele.isSendTemplate == 1 ? true : false;
});
}
that.groupListData = resData.result.list || [];
that.total = resData.result.pageInfo.total;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.loading = false;
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
mounted() {
const that = this;
if (that.brandId) {
that.getGroupClassify(that.brandId);
that.getGroupList(that.brandId);
that.getGroupClassSet(that.brandId);
that.getSyncDate(that.brandId);
}
}
};
</script>
<style lang="scss" scoped>
.w-500 {
width: 500px;
}
.w-168 {
width: 168px;
}
.w-195 {
width: 195px;
}
.color-1890ff {
color: #2f54eb;
}
.p-20 {
padding: 20px;
}
.p-lbr-20 {
padding: 0 20px 20px 20px;
}
.p-l-38 {
padding-left: 38px;
}
.p-l-199 {
padding-left: 199px;
}
.m-l-20 {
margin-left: 20px;
}
.app-detail-wrap {
height: 100%;
background: #fff;
.el-tabs {
background: #fff;
>>> .el-tabs__nav-wrap {
/* height: 48px;
line-height: 48px; */
&::after {
height: 1px;
}
/* .el-tabs__nav-scroll {
padding-left: 20px;
} */
}
}
.condition-tip {
width: 740px;
.el-alert--info {
background: #e6f7ff;
border: 1px solid rgba(145, 213, 255, 1);
.el-alert__icon {
font-size: 12px;
}
}
}
}
</style>
...@@ -14,616 +14,56 @@ ...@@ -14,616 +14,56 @@
<template> <template>
<div class="app-detail-wrap"> <div class="app-detail-wrap">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="客户分组列表" name="first"> <el-tab-pane v-if="$getButtonLimit($buttonCode.memberGroupList)" :limit-code="$buttonCode.memberGroupList" label="客户分组列表" name="/memberGroupList"></el-tab-pane>
<div class="app-detail-pane border-box p-lbr-20"> <el-tab-pane v-if="$getButtonLimit($buttonCode.memberGroupSetList)" :limit-code="$buttonCodememberGroupSetList" label="分组展示设置" name="/memberGroupSetList"></el-tab-pane>
<div class="condition-wrap flex flex-space-between">
<div>
<el-input placeholder="请输入分组名称" maxlength="50" v-model="conditionObj.searchInput" class="w-264" style="width: 217px;" prefix-icon="el-icon-search" @keyup.native="value => toInput(value, conditionObj.searchInput)" clearable @clear="clearInput"></el-input
><el-select class="w-168 m-l-10" v-model="conditionObj.classifyName" placeholder="全部分类" @change="changeCondition">
<el-option label="全部分类" value=""></el-option>
<el-option v-for="item in classifyList" :key="item" :label="item" :value="item"> </el-option> </el-select
><el-select class="w-168 m-l-10" v-model="conditionObj.effectiveStatus" placeholder="全部状态" @change="changeCondition">
<el-option label="全部状态" value=""></el-option>
<el-option label="有效" value="1"></el-option>
<el-option label="失效" value="0"></el-option>
</el-select>
</div>
<div>
<el-checkbox v-if="$getButtonLimit($buttonCode.groupExpire)" :limit-code="$buttonCode.groupExpire" v-model="overTimeSeeFlag" @change="saveGroupSet" :disabled="$store.state.wxEnterpriseType">
<el-tooltip class="item" effect="dark" content="开启后,GIC中设置的好办端会员分组失效后,即使在GIC开启好办展示,好办移动端也不再展示该条分组" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;margin-left:-4px;" class="font-14 color-606266 m-r-20">会员分组失效后不展示</span></el-tooltip>
</el-checkbox>
<el-button v-if="$getButtonLimit($buttonCode.syncGroup)" :limit-code="$buttonCode.syncGroup" type="primary" :loading="loadingBtn" @click="toSync" :disabled="$store.state.wxEnterpriseType">立即同步</el-button>
<span v-if="syncDate" class="font-14 color-606266 p-r-10">最近一次同步时间:{{ syncDate | formatTimeStamp }}</span>
</div>
</div>
<div class="m-t-20">
<el-table class="select-table" ref="multipleTable" v-loading="loading" :data="groupListData" tooltip-effect="dark" :style="{ width: '100%' }">
<el-table-column label="分组名称" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.groupName }}</template>
</el-table-column>
<el-table-column prop="" label="分类">
<template slot-scope="scope">{{ scope.row.memberTagGroupClassifyName }}</template>
</el-table-column>
<el-table-column prop="" label="是否实时" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.isRealTime == 1 ? '是' : '否' }}</template>
</el-table-column>
<el-table-column prop="" label="是否固化" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.curingFlag == 1 ? '是' : '否' }}</template>
</el-table-column>
<el-table-column prop="" label="更新频率" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.updateType == 1 ? '每日' : scope.row.updateType == 2 ? '每周' : scope.row.updateType == 3 ? '每月' : '-' }} {{ scope.row.updateType == 1 ? '一次' : scope.row.updateType == 2 ? '周' + scope.row.updateDay : scope.row.updateType == 3 ? scope.row.updateDay + '号' : '-' }} </template>
</el-table-column>
<el-table-column prop="" label="状态" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.effectiveStatus == '1' ? '有效' : '失效' }}</template>
</el-table-column>
<el-table-column prop="" label="覆盖人数" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.memberCount || 0 }}</template>
</el-table-column>
<el-table-column prop="" label="到期时间" show-overflow-tooltip>
<template slot-scope="scope">
<div class="line-18">{{ scope.row.effectiveDate | timeStampToYmd }}</div>
<div class="line-18">{{ scope.row.effectiveDate | timeStampToHms }}</div>
</template>
</el-table-column>
</el-table>
<div class="block common-wrap__page text-right m-t-24" v-if="groupListData.length != 0">
<dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="分组展示设置" name="second">
<div class=" border-box p-lbr-20">
<div class="flex flex-space-between">
<div></div>
<div>
<span class="font-12 color-909399">最多新建20个模板</span>
<el-button v-if="$getButtonLimit($buttonCode.addGroupTemp)" :limit-code="$buttonCode.addGroupTemp" :disabled="$store.state.wxEnterpriseType || templateList.length >= 20" class="m-l-20" type="primary" @click="addTemplate">新建模版</el-button>
</div>
</div>
<div class="m-t-20">
<el-table class="select-table" ref="tempTable" v-loading="loading" :data="templateList" tooltip-effect="dark" :style="{ width: '100%' }">
<el-table-column label="模板名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.templateName }}</template>
</el-table-column>
<el-table-column label="模板id" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.templateId }}</template>
</el-table-column>
<el-table-column label="编辑人" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.editPerson }}</template>
</el-table-column>
<el-table-column prop="" label="最近编辑时间" show-overflow-tooltip>
<template slot-scope="scope">
<div class="line-18">{{ scope.row.editTime | timeStampToYmd }}</div>
<div class="line-18">{{ scope.row.editTime | timeStampToHms }}</div>
</template>
</el-table-column>
<el-table-column label="操作" v-if="$getButtonLimit($buttonCode.editGroupTemp) || $getButtonLimit($buttonCode.setStoreArea) || $getButtonLimit($buttonCode.delGroupTemp)">
<template slot-scope="scope">
<el-button v-if="$getButtonLimit($buttonCode.editGroupTemp)" :limit-code="$buttonCode.editGroupTemp" @click="toEdit(scope.$index, scope.row)" type="text" :disabled="$store.state.wxEnterpriseType">编辑</el-button>
<el-button v-if="$getButtonLimit($buttonCode.setStoreArea)" :limit-code="$buttonCode.setStoreArea" @click="toStore(scope.$index, scope.row)" type="text" :disabled="$store.state.wxEnterpriseType">门店范围设置</el-button>
<el-button v-if="$getButtonLimit($buttonCode.delGroupTemp)" :limit-code="$buttonCode.delGroupTemp" @click="toDel(scope.$index, scope.row)" type="text" :disabled="$store.state.wxEnterpriseType">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-tab-pane>
</el-tabs> </el-tabs>
<router-view :brandId="brandId"></router-view>
</div> </div>
</template> </template>
<script> <script>
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 { export default {
name: 'app-detail', name: 'app-detail',
props: { props: {
brandId: { brandId: {
type: String, type: String,
default() { default: ''
return '';
}
},
tabType: {
type: String,
default() {
return '1';
}
} }
}, },
data() { data() {
return { return {
projectName: '', // 当前项目名 activeName: ''
activeName: 'first',
wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '',
myCustomData: {
searchFlag: false,
chatFlag: false,
mainStoreFlag: false, // 服务门店显示,1显示0不现实
minorStoreFlag: false, // 协管门店显示,1显示0不显示
openCardStoreFlag: false, // 开卡门店显示,1显示0不显示
clerkSeeOtherFlag: false, // 导购查看其他导购,1显示0不显示
isSeeAuthMember: false,
allowGuideContact: false,
allowGuideMobile: false,
allowGuideMessage: false,
allowGuideOnlineChat: false
},
overTimeSeeFlag: false,
// 会员分组设置
conditionObj: {
searchInput: '',
classifyName: '',
effectiveStatus: ''
},
groupListData: [], // 列表数据
classifyList: [], // 会员分组
currentPage: 1,
pageSize: 20,
total: 0,
loading: false,
// 最近同步时间
syncDate: '',
loadingBtn: false,
// 模板
templateList: []
}; };
}, },
beforeDestroy() {
sessionStorage.removeItem('memberGroupSet');
},
beforeMount() {
let that = this;
let host = window.location.origin;
if (host.indexOf('localhost') != -1) {
that.baseUrl = 'http://www.gicdev.com';
} else {
that.baseUrl = host;
}
},
methods: { methods: {
/** handleClick() {
* 删除 this.$router.replace(this.activeName);
*/
toDel(index, row) {
const that = this;
that
.$confirm('是否要删除选中的模板?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
that.delTempList(row.templateId);
})
.catch(() => {});
},
/**
* 删除卡券
*/
delTempList(templateId) {
const that = this;
let para = {
templateId: templateId
};
postRequest('/haoban-app-customer-web/del-group-template', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('删除成功', 'success');
that.getTableList();
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 编辑
*/
toEdit(index, row) {
const that = this;
that.$router.push(`/editGroupTemplate?templateId=${row.templateId}`);
},
/**
* 门店范围设置
*/
toStore(index, row) {
const that = this;
that.$router.push(`/storeRangeSet?templateId=${row.templateId}&brandId=${that.brandId}`);
},
/**
* 新增模板
*/
addTemplate() {
const that = this;
that.$router.push('/addGroupTemplate');
},
/**
* 获取模板
*/
getTableList() {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/get-template-list', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.templateList = resData.result || [];
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 切换tab
*/
handleClick(tab, event) {
const that = this;
that.currentPage = 1;
that.pageSize = 20;
that.total = 0;
if (tab.name == 'first') {
that.getGroupClassify();
that.getGroupList();
that.getGroupClassSet();
that.getSyncDate();
} else {
that.getTableList();
}
},
/**
* 获取同步时间
*/
getSyncDate(brandId) {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/memberGroup/get-group_last_syn_time', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.syncDate = resData.result;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 立即同步
*/
toSync: _debounce(function() {
const that = this;
that.loadingBtn = true;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/memberGroup/syn-group', para)
.then(res => {
let resData = res.data;
that.loadingBtn = false;
if (resData.errorCode == 1) {
showMsg.showmsg('同步成功', 'success');
that.getSyncDate();
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.loadingBtn = false;
that.$message.error({
duration: 1000,
message: error.message
});
});
}, 500),
/**
* 获取分组设置
*/
getGroupClassSet(brandId) {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/memberGroup/get-member-group-setting', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.overTimeSeeFlag = resData.result == 0 ? false : true;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 保存分组设置
*/
saveGroupSet() {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
overTimeSeeFlag: that.overTimeSeeFlag == true ? 1 : 0
};
postRequest('/haoban-app-customer-web/memberGroup/save-member-group-setting', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('设置成功', 'success');
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 输入
*/
toInput: _debounce(function(e, value) {
const that = this;
that.currentPage = 1;
that.getGroupList(that.brandId);
}, 500),
// 搜索清除
clearInput() {
const that = this;
that.currentPage = 1;
that.getGroupList(that.brandId);
},
changeCondition() {
const that = this;
that.currentPage = 1;
that.getGroupList(that.brandId);
},
/**
* 获取会员分组分类
*/
getGroupClassify(brandId) {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/memberGroup/get-member-class-list', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.classifyList = resData.result.list || [];
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 模板消息设置
*/
toChangeTemp(e, index, row) {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
memberTagGroupId: row.memberTagGroupId,
isSendTemplate: row.isSendTemplate == true ? 1 : 0
};
postRequest('/haoban-app-customer-web/memberGroup/save-member-group-is-template-message', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('操作成功', 'success');
that.pageNum = 1;
that.getGroupList(that.brandId);
return;
} else {
row.isSendTemplate = false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 分页---页码变化
* @param {Number} val
*/
handleSizeChange(val) {
const that = this;
that.currentPage = 1;
that.pageSize = val;
that.getGroupList(that.brandId);
},
/**
* 分页---当前页变化
* @param {Number} val
*/
handleCurrentChange(val) {
const that = this;
that.currentPage = val;
that.getGroupList(that.brandId);
},
/**
* 获取会员分组列表
*/
getGroupList(brandId) {
const that = this;
that.loading = true;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
memberGroupName: that.conditionObj.searchInput,
classifyName: that.conditionObj.classifyName,
effectiveStatus: that.conditionObj.effectiveStatus,
pageNum: that.currentPage,
pageSize: that.pageSize
};
postRequest('/haoban-app-customer-web/memberGroup/member-tag-group-list', para)
.then(res => {
let resData = res.data;
that.loading = false;
if (resData.errorCode == 1) {
if (resData.result.list && resData.result.list.length) {
resData.result.list.forEach(ele => {
ele.isSendTemplate = ele.isSendTemplate == 1 ? true : false;
});
}
that.groupListData = resData.result.list || [];
that.total = resData.result.pageInfo.total;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.loading = false;
that.$message.error({
duration: 1000,
message: error.message
});
});
} }
}, },
watch: { created() {
brandId: function(newData, oldData) { if (this.$route.path == '/memberGroupSet') {
const that = this; if (this.$getButtonLimit(this.$buttonCode.memberGroupList)) {
if (newData) { this.activeName = '/memberGroupList';
that.getGroupClassify(that.brandId); } else if (this.$getButtonLimit(this.$buttonCode.memberGroupSetList)) {
that.getGroupList(that.brandId); this.activeName = '/memberGroupSetList';
that.getGroupClassSet(that.brandId);
that.getSyncDate(that.brandId);
} }
if (that.activeName == 'second') { if (this.activeName) {
that.getTableList(); this.handleClick();
} }
} else {
this.activeName = this.$route.path;
} }
}, }
mounted() {
const that = this;
that.$emit('showTab', '12');
if (that.brandId) {
that.getGroupClassify(that.brandId);
that.getGroupList(that.brandId);
that.getGroupClassSet(that.brandId);
that.getSyncDate(that.brandId);
}
if (that.brandId && sessionStorage.getItem('memberGroupSet') == 'second') {
this.activeName = 'second';
that.getTableList();
}
// this.activeName = sessionStorage.getItem('memberGroupSet') ? sessionStorage.getItem('memberGroupSet') : 'first';
},
components: {}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.w-500 {
width: 500px;
}
.w-168 {
width: 168px;
}
.w-195 {
width: 195px;
}
.color-1890ff {
color: #2f54eb;
}
.p-20 {
padding: 20px;
}
.p-lbr-20 {
padding: 0 20px 20px 20px;
}
.p-l-38 {
padding-left: 38px;
}
.p-l-199 {
padding-left: 199px;
}
.m-l-20 {
margin-left: 20px;
}
.app-detail-wrap { .app-detail-wrap {
height: 100%; height: 100%;
background: #fff; background: #fff;
.el-tabs { .el-tabs {
background: #fff;
>>> .el-tabs__nav-wrap { >>> .el-tabs__nav-wrap {
/* height: 48px;
line-height: 48px; */
&::after { &::after {
height: 1px; height: 1px;
} }
/* .el-tabs__nav-scroll {
padding-left: 20px;
} */
}
}
.condition-tip {
width: 740px;
.el-alert--info {
background: #e6f7ff;
border: 1px solid rgba(145, 213, 255, 1);
.el-alert__icon {
font-size: 12px;
}
} }
} }
} }
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-26 10:01:07
-->
<!--
我的客户应用:
<app-detail ></app-detail>
-->
<template>
<div class=" border-box p-lbr-20">
<div class="flex flex-space-between">
<div></div>
<div>
<span class="font-12 color-909399">最多新建20个模板</span>
<el-button v-if="$getButtonLimit($buttonCode.addGroupTemp)" :limit-code="$buttonCode.addGroupTemp" :disabled="$store.state.wxEnterpriseType || templateList.length >= 20" class="m-l-20" type="primary" @click="addTemplate">新建模版</el-button>
</div>
</div>
<div class="m-t-20">
<el-table class="select-table" ref="tempTable" v-loading="loading" :data="templateList" tooltip-effect="dark" :style="{ width: '100%' }">
<el-table-column label="模板名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.templateName }}</template>
</el-table-column>
<el-table-column label="模板id" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.templateId }}</template>
</el-table-column>
<el-table-column label="编辑人" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.editPerson }}</template>
</el-table-column>
<el-table-column prop="" label="最近编辑时间" show-overflow-tooltip>
<template slot-scope="scope">
<div class="line-18">{{ scope.row.editTime | timeStampToYmd }}</div>
<div class="line-18">{{ scope.row.editTime | timeStampToHms }}</div>
</template>
</el-table-column>
<el-table-column label="操作" v-if="$getButtonLimit($buttonCode.editGroupTemp) || $getButtonLimit($buttonCode.setStoreArea) || $getButtonLimit($buttonCode.delGroupTemp)">
<template slot-scope="scope">
<el-button v-if="$getButtonLimit($buttonCode.editGroupTemp)" :limit-code="$buttonCode.editGroupTemp" @click="toEdit(scope.$index, scope.row)" type="text" :disabled="$store.state.wxEnterpriseType">编辑</el-button>
<el-button v-if="$getButtonLimit($buttonCode.setStoreArea)" :limit-code="$buttonCode.setStoreArea" @click="toStore(scope.$index, scope.row)" type="text" :disabled="$store.state.wxEnterpriseType">门店范围设置</el-button>
<el-button v-if="$getButtonLimit($buttonCode.delGroupTemp)" :limit-code="$buttonCode.delGroupTemp" @click="toDel(scope.$index, scope.row)" type="text" :disabled="$store.state.wxEnterpriseType">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { postRequest } from '@/api/api';
export default {
name: 'app-detail',
props: {
brandId: {
type: String,
default: ''
}
},
data() {
return {
wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '',
loading: false,
// 模板
templateList: []
};
},
methods: {
/**
* 删除
*/
toDel(index, row) {
const that = this;
that
.$confirm('是否要删除选中的模板?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
that.delTempList(row.templateId);
})
.catch(() => {});
},
/**
* 删除卡券
*/
delTempList(templateId) {
const that = this;
let para = {
templateId: templateId
};
postRequest('/haoban-app-customer-web/del-group-template', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('删除成功', 'success');
that.getTableList();
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 编辑
*/
toEdit(index, row) {
const that = this;
that.$router.push(`/editGroupTemplate?templateId=${row.templateId}`);
},
/**
* 门店范围设置
*/
toStore(index, row) {
const that = this;
that.$router.push(`/storeRangeSet?templateId=${row.templateId}&brandId=${that.brandId}`);
},
/**
* 新增模板
*/
addTemplate() {
const that = this;
that.$router.push('/addGroupTemplate');
},
/**
* 获取模板
*/
getTableList() {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-customer-web/get-template-list', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.templateList = resData.result || [];
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
mounted() {
const that = this;
that.getTableList();
}
};
</script>
<style lang="scss" scoped>
.p-lbr-20 {
padding: 0 20px 20px 20px;
}
.m-l-20 {
margin-left: 20px;
}
</style>
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
</el-select> </el-select>
</div> </div>
<div class="btn-group"> <div class="btn-group">
<el-button v-if="$getButtonLimit($buttonCode.syncTagLog)" :limit-code="$buttonCode.syncTagLog" @click="$router.push('/syncHistory')">同步历史</el-button>
<el-button @click="drawer = true" type="primary" :disabled="!canSync || !canUseCount" :class="['sync-btn', isShake ? 'shake' : '']">待开启同步标签( {{ tagIds.length }}</el-button><span v-if="canUseCount === 0" class="no-use-count">本月同步次数已用尽</span> <el-button @click="drawer = true" type="primary" :disabled="!canSync || !canUseCount" :class="['sync-btn', isShake ? 'shake' : '']">待开启同步标签( {{ tagIds.length }}</el-button><span v-if="canUseCount === 0" class="no-use-count">本月同步次数已用尽</span>
</div> </div>
</div> </div>
......
...@@ -297,7 +297,6 @@ export default { ...@@ -297,7 +297,6 @@ export default {
mounted() { mounted() {
const that = this; const that = this;
that.$emit('showTab', '12'); that.$emit('showTab', '12');
sessionStorage.setItem('memberGroupSet', 'second');
if (that.brandId) { if (that.brandId) {
that.getTableList(that.brandId); that.getTableList(that.brandId);
} }
......
<template>
<div class="guide-setting">
<p class="app-auth-tip">设置导购可见应用</p>
<el-row>
<el-checkbox-group v-model="settingData.checked">
<el-col :span="3" v-for="el in allApps" :key="el.applicationId" style="margin-bottom: 12px">
<el-checkbox :label="el.applicationId">{{ el.applicationName }}</el-checkbox>
</el-col>
</el-checkbox-group>
</el-row>
<el-button class="save-btn" v-if="$getButtonLimit($buttonCode.saveAppsVisible)" :limit-code="$buttonCode.saveAppsVisible" :loading="loading" type="primary" @click="onSave">保存</el-button>
</div>
</template>
<script>
import { getRequest, postRequest } from '@/api/api.js';
import errorMsg from '@/common/js/error.js';
export default {
name: 'AppVisibleSetting',
data() {
return {
loading: false,
settingData: {
checked: []
},
allApps: []
};
},
created() {
this.getSetting();
},
methods: {
getSetting() {
getRequest('/haoban-manage3-web/application-open-close-list', {}).then(res => {
const { errorCode, result } = res.data || {};
if (errorCode != 1) {
return errorMsg.errorMsg(res.data);
}
let { allList } = result || {};
allList = Array.isArray(allList) ? allList : [];
this.allApps = allList;
this.settingData.checked = allList.filter(el => el.openFlag == 1).map(el => el.applicationId);
});
},
onSave() {
this.loading = true;
const { checked } = this.settingData;
const dataJson = this.allApps.map(el => {
return { applicationId: el.applicationId, openFlag: checked.includes(el.applicationId) ? 1 : 0 };
});
const params = { dataJson: JSON.stringify(dataJson) };
postRequest('/haoban-manage3-web/open-or-close', params)
.then(res => {
const { errorCode } = res.data || {};
if (errorCode != 1) {
return errorMsg.errorMsg(res.data);
}
this.$message.success('保存成功');
})
.finally(() => {
setTimeout(() => (this.loading = false), 100);
});
}
}
};
</script>
<style lang="scss" scoped>
.guide-setting {
padding: 0 20px 20px;
.app-auth-tip {
margin-bottom: 16px;
font-size: 14px;
font-weight: 400;
color: #303133;
line-height: 20px;
}
.save-btn {
margin-top: 40px;
}
}
</style>
<template>
<div class="guide-setting">
<div class="guide-auth-list">
<div class="guide-auth-item">
<span class="auth-item-label">允许编辑导购信息</span>
<el-switch v-model="settingData.editClerkFlag" :active-value="1" :inactive-value="0"></el-switch>
</div>
<div class="guide-auth-item">
<span class="auth-item-label">允许店长添加导购</span>
<el-switch v-model="settingData.addClerkFlag" :active-value="1" :inactive-value="0"></el-switch>
</div>
<div class="guide-auth-item">
<span class="auth-item-label">允许店长删除导购</span>
<el-switch v-model="settingData.delClerkFlag" :active-value="1" :inactive-value="0"></el-switch>
</div>
</div>
<el-button class="save-btn" v-if="$getButtonLimit($buttonCode.saveGuideSetting)" :limit-code="$buttonCode.saveGuideSetting" :loading="loading" type="primary" @click="onSave">保存</el-button>
</div>
</template>
<script>
import { getRequest, postRequest } from '@/api/api.js';
import errorMsg from '@/common/js/error.js';
export default {
name: 'GuideAuthSetting',
data() {
return {
loading: false,
settingData: {
editClerkFlag: 0,
addClerkFlag: 0,
delClerkFlag: 0
}
};
},
created() {
this.getSetting();
},
methods: {
getSetting() {
getRequest('/haoban-manage3-web/application-open-close-list', {}).then(res => {
const { errorCode, result } = res.data || {};
if (errorCode != 1) {
return errorMsg.errorMsg(res.data);
}
let { clerkEditInfo } = result || {};
Object.assign(this.settingData, clerkEditInfo);
});
},
onSave() {
this.loading = true;
const { editClerkFlag, addClerkFlag, delClerkFlag } = this.settingData;
const params = { editClerkFlag, addClerkFlag, delClerkFlag };
postRequest('/haoban-manage3-web/save-clerk-edit-flag', params)
.then(res => {
const { errorCode } = res.data || {};
if (errorCode != 1) {
return errorMsg.errorMsg(res.data);
}
this.$message.success('保存成功');
})
.finally(() => {
setTimeout(() => (this.loading = false), 100);
});
}
}
};
</script>
<style lang="scss" scoped>
.guide-setting {
padding: 0 20px 20px;
.guide-auth-list {
border-radius: 4px;
border: 1px solid #dcdfe6;
.guide-auth-item {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 0 20px;
height: 67px;
+ .guide-auth-item {
border-top: 1px solid #dcdfe6;
}
.auth-item-label {
margin-right: 60px;
font-size: 14px;
font-weight: 400;
color: #303133;
}
}
}
.save-btn {
margin-top: 40px;
}
}
</style>
<template> <template>
<el-tabs v-model="activeName"> <div>
<el-tab-pane label="导购操作权限设置" name="first"> <el-tabs v-model="activeName" @tab-click="handleClick">
<div class="guide-setting"> <el-tab-pane v-if="$getButtonLimit($buttonCode.guideAuthSetting)" :limit-code="$buttonCode.guideAuthSetting" label="导购操作权限设置" name="/guide-auth-setting"> </el-tab-pane>
<div class="guide-auth-list"> <el-tab-pane v-if="$getButtonLimit($buttonCode.appVisibleSetting)" :limit-code="$buttonCode.appVisibleSetting" label="应用可见权限设置" name="/app-visible-setting"> </el-tab-pane>
<div class="guide-auth-item"> </el-tabs>
<span class="auth-item-label">允许编辑导购信息</span> <router-view></router-view>
<el-switch v-model="settingData.editClerkFlag" :active-value="1" :inactive-value="0"></el-switch> </div>
</div>
<div class="guide-auth-item">
<span class="auth-item-label">允许店长添加导购</span>
<el-switch v-model="settingData.addClerkFlag" :active-value="1" :inactive-value="0"></el-switch>
</div>
<div class="guide-auth-item">
<span class="auth-item-label">允许店长删除导购</span>
<el-switch v-model="settingData.delClerkFlag" :active-value="1" :inactive-value="0"></el-switch>
</div>
</div>
<el-button class="save-btn" v-if="$getButtonLimit($buttonCode.saveGuideSetting)" :limit-code="$buttonCode.saveGuideSetting" :loading="loading" type="primary" @click="onSave">保存</el-button>
</div>
</el-tab-pane>
<el-tab-pane label="应用可见权限设置" name="second">
<div class="guide-setting">
<p class="app-auth-tip">设置导购可见应用</p>
<el-row>
<el-checkbox-group v-model="settingData.checked">
<el-col :span="3" v-for="el in allApps" :key="el.applicationId" style="margin-bottom: 12px">
<el-checkbox :label="el.applicationId">{{ el.applicationName }}</el-checkbox>
</el-col>
</el-checkbox-group>
</el-row>
<el-button class="save-btn" v-if="$getButtonLimit($buttonCode.saveAppsVisible)" :limit-code="$buttonCode.saveAppsVisible" :loading="loading" type="primary" @click="onSave">保存</el-button>
</div>
</el-tab-pane>
</el-tabs>
</template> </template>
<script> <script>
import { getRequest, postRequest } from '@/api/api.js';
import errorMsg from '@/common/js/error.js';
export default { export default {
name: 'GuideSetting', name: 'GuideSetting',
data() { data() {
return { return {
loading: false, activeName: ''
activeName: 'first',
settingData: {
editClerkFlag: 0,
addClerkFlag: 0,
delClerkFlag: 0,
checked: []
},
allApps: []
}; };
}, },
created() {
this.getSetting();
},
methods: { methods: {
getSetting() { handleClick() {
getRequest('/haoban-manage3-web/application-open-close-list', {}).then(res => { this.$router.replace(this.activeName);
const { errorCode, result } = res.data || {};
if (errorCode != 1) {
return errorMsg.errorMsg(res.data);
}
let { allList, clerkEditInfo } = result || {};
allList = Array.isArray(allList) ? allList : [];
this.allApps = allList;
this.settingData.checked = allList.filter(el => el.openFlag == 1).map(el => el.applicationId);
Object.assign(this.settingData, clerkEditInfo);
});
},
onSave() {
this.loading = true;
const { editClerkFlag, addClerkFlag, delClerkFlag, checked } = this.settingData;
let params = {};
if (this.activeName == 'first') {
params = { editClerkFlag, addClerkFlag, delClerkFlag };
} else if (this.activeName == 'second') {
const dataJson = this.allApps.map(el => {
return { applicationId: el.applicationId, openFlag: checked.includes(el.applicationId) ? 1 : 0 };
});
params = { dataJson: JSON.stringify(dataJson) };
}
const methods = {
first: params => postRequest('/haoban-manage3-web/save-clerk-edit-flag', params),
second: params => postRequest('/haoban-manage3-web/open-or-close', params)
};
methods[this.activeName](params)
.then(res => {
const { errorCode } = res.data || {};
if (errorCode != 1) {
return errorMsg.errorMsg(res.data);
}
this.$message.success('保存成功');
})
.finally(() => {
setTimeout(() => (this.loading = false), 100);
});
} }
} },
}; created() {
</script> if (this.$route.path == '/guide-setting') {
if (this.$getButtonLimit(this.$buttonCode.guideAuthSetting)) {
<style lang="scss" scoped> this.activeName = '/guide-auth-setting';
.guide-setting { } else if (this.$getButtonLimit(this.$buttonCode.appVisibleSetting)) {
padding: 0 20px 20px; this.activeName = '/app-visible-setting';
.guide-auth-list {
border-radius: 4px;
border: 1px solid #dcdfe6;
.guide-auth-item {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 0 20px;
height: 67px;
+ .guide-auth-item {
border-top: 1px solid #dcdfe6;
} }
.auth-item-label { if (this.activeName) {
margin-right: 60px; this.handleClick();
font-size: 14px;
font-weight: 400;
color: #303133;
} }
} else {
this.activeName = this.$route.path;
} }
} }
.app-auth-tip { };
margin-bottom: 16px; </script>
font-size: 14px;
font-weight: 400;
color: #303133;
line-height: 20px;
}
.save-btn {
margin-top: 40px;
}
}
</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