Commit 1c966f7a by caoyanzhi

Merge branch 'feature/4月-菜单和权限' into test

parents fe572d5c 12e7016d
...@@ -22,7 +22,7 @@ export default new Vuex.Store({ ...@@ -22,7 +22,7 @@ export default new Vuex.Store({
addDepartment: [], // 添加 addDepartment: [], // 添加
editDepartment: [], // 编辑配置 editDepartment: [], // 编辑配置
delDepartment: [], // 删除配置 delDepartment: [], // 删除配置
wxEnterpriseType: 0, wxEnterpriseType: 0, // 0:总部 1:代理,有些按钮对代理商禁用,新权限管理系统上线后废弃此逻辑
salesDate: initDataRange() salesDate: initDataRange()
}, },
mutations: { mutations: {
......
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
data() { data() {
const valiStoreType = (rules, value, callback) => { const valiStoreType = (rules, value, callback) => {
const data = value.filter(el => !this.selectedTypes.includes(el)); const data = value.filter(el => !this.selectedTypes.includes(el));
if (this.myCustomData.storeType.includes('-1')) { if (this.myCustomData.storeType.includes('-999')) {
return callback(); return callback();
} }
if (this.storeTypes.every(el => this.selectedTypes.includes(el.value))) { if (this.storeTypes.every(el => this.selectedTypes.includes(el.value))) {
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
}; };
return { return {
// 门店类型(0:自营,1:联营,2:代理(加盟),3:代销,4:托管) // 门店类型(0:自营,1:联营,2:代理(加盟),3:代销,4:托管)
// -1:全部,也就是通用策略、默认策略 // -999:全部,也就是通用策略、默认策略
storeTypes: [ storeTypes: [
{ label: '自营', value: '0' }, { label: '自营', value: '0' },
{ label: '联营', value: '1' }, { label: '联营', value: '1' },
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
myCustomData: { myCustomData: {
memberManageSettingId: '', // 会员设置id,更新时必传 memberManageSettingId: '', // 会员设置id,更新时必传
strategyName: '', strategyName: '',
storeType: [], //门店类型 -1:全部;1:自营;2:联营;3:代理;4:代销;5:托管 storeType: [], //门店类型 -999:全部;1:自营;2:联营;3:代理;4:代销;5:托管
mainStoreFlag: 0, // 服务门店显示,1显示0不现实 mainStoreFlag: 0, // 服务门店显示,1显示0不现实
minorStoreFlag: 0, // 协管门店显示,1显示0不显示 minorStoreFlag: 0, // 协管门店显示,1显示0不显示
openCardStoreFlag: 0, // 开卡门店显示,1显示0不显示 openCardStoreFlag: 0, // 开卡门店显示,1显示0不显示
...@@ -119,7 +119,7 @@ export default { ...@@ -119,7 +119,7 @@ export default {
} }
// storeType = -1时为通用策略 // storeType = -1时为通用策略
// 通用策略不能修改门店类型 // 通用策略不能修改门店类型
if (this.myCustomData.storeType.includes('-1')) return; if (this.myCustomData.storeType.includes('-999')) return;
if (Array.isArray(result)) { if (Array.isArray(result)) {
this.selectedTypes = result.reduce((types, el) => { this.selectedTypes = result.reduce((types, el) => {
if (typeof el.storeType == 'string' && el.memberManageSettingId != this.myCustomData.memberManageSettingId) { if (typeof el.storeType == 'string' && el.memberManageSettingId != this.myCustomData.memberManageSettingId) {
...@@ -180,10 +180,10 @@ export default { ...@@ -180,10 +180,10 @@ export default {
}); });
// storeType = -1时为通用策略 // storeType = -1时为通用策略
// 通用策略不能修改门店类型 // 通用策略不能修改门店类型
if (storeType == -'1') { if (storeType == '-999') {
this.selectedTypes = this.storeTypes.map(el => el.value); this.selectedTypes = this.storeTypes.map(el => el.value);
this.myCustomData.storeType = this.storeTypes.map(el => el.value); this.myCustomData.storeType = this.storeTypes.map(el => el.value);
this.myCustomData.storeType.push('-1'); this.myCustomData.storeType.push('-999');
} }
this.$nextTick(() => { this.$nextTick(() => {
this.rules.options.trigger = 'change'; this.rules.options.trigger = 'change';
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div></div> <div></div>
<div> <div>
<span class="font-12 color-909399">最多新建20个模板</span> <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> <el-button v-if="$getButtonLimit($buttonCode.addGroupTemp)" :limit-code="$buttonCode.addGroupTemp" :disabled="$store.state.wxEnterpriseType || canAddTemp" class="m-l-20" type="primary" @click="addTemplate">新建模版</el-button>
</div> </div>
</div> </div>
<div class="m-t-20"> <div class="m-t-20">
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<script> <script>
import showMsg from '@/common/js/showmsg'; import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
import { postRequest } from '@/api/api'; import { getRequest, postRequest } from '@/api/api';
export default { export default {
name: 'app-detail', name: 'app-detail',
props: { props: {
...@@ -72,10 +72,21 @@ export default { ...@@ -72,10 +72,21 @@ export default {
wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '', wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '',
loading: false, loading: false,
// 模板 // 模板
templateList: [] templateList: [],
canAddTemp: false
}; };
}, },
methods: { methods: {
getTemplateCount() {
getRequest('/haoban-app-customer-web/get-template-count', {}).then(res => {
const { errorCode, result } = res.data || {};
if (errorCode != 1) {
errMsg.errorMsg(res.data);
return;
}
this.canAddTemp = result >= 20;
});
},
/** /**
* 删除 * 删除
*/ */
...@@ -167,6 +178,7 @@ export default { ...@@ -167,6 +178,7 @@ export default {
mounted() { mounted() {
const that = this; const that = this;
that.getTableList(); that.getTableList();
this.getTemplateCount();
} }
}; };
</script> </script>
......
...@@ -74,12 +74,12 @@ ...@@ -74,12 +74,12 @@
<span :class="['state-point', syncStatusClass[row.syncFlag]]">{{ syncStatusOpt[row.syncFlag] }}</span> <span :class="['state-point', syncStatusClass[row.syncFlag]]">{{ syncStatusOpt[row.syncFlag] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作" v-if="$getButtonLimit($buttonCode.breakSyncTag)">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<p v-if="row.syncFlag == 2 && canSync"> <p v-if="row.syncFlag == 2 && canSync && $getButtonLimit($buttonCode.breakSyncTag)">
<el-button type="text" @click="changeSync(row)">关闭同步</el-button> <el-button :limit-code="$buttonCode.breakSyncTag" type="text" @click="changeSync(row)">关闭同步</el-button>
</p> </p>
<p v-else></p> <p v-else>--</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column type="expand" width="1"> <el-table-column type="expand" width="1">
......
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