Commit e124f8e8 by caoyanzhi

update: 分组展示模板上限

parent 1fb7879b
......@@ -22,7 +22,7 @@ export default new Vuex.Store({
addDepartment: [], // 添加
editDepartment: [], // 编辑配置
delDepartment: [], // 删除配置
wxEnterpriseType: 0,
wxEnterpriseType: 0, // 0:总部 1:代理,有些按钮对代理商禁用,新权限管理系统上线后废弃此逻辑
salesDate: initDataRange()
},
mutations: {
......
......@@ -17,7 +17,7 @@
<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>
<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 class="m-t-20">
......@@ -58,7 +58,7 @@
<script>
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { postRequest } from '@/api/api';
import { getRequest, postRequest } from '@/api/api';
export default {
name: 'app-detail',
props: {
......@@ -72,10 +72,21 @@ export default {
wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '',
loading: false,
// 模板
templateList: []
templateList: [],
canAddTemp: false
};
},
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 {
mounted() {
const that = this;
that.getTableList();
this.getTemplateCount();
}
};
</script>
......
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