Commit 9427143b by caoyanzhi

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

parents e700a424 74ea55c7
...@@ -90,7 +90,8 @@ export default { ...@@ -90,7 +90,8 @@ export default {
groupDataCopy: [], groupDataCopy: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'storeGroupName' label: 'storeGroupName',
disabled: data => !data.hasRight
}, },
checkedKeys: this.selectData.length ? this.selectData.map(ele => ele.departmentId) : [] checkedKeys: this.selectData.length ? this.selectData.map(ele => ele.departmentId) : []
}; };
......
...@@ -114,7 +114,9 @@ export default { ...@@ -114,7 +114,9 @@ export default {
item.children = await that.getChildData(item); item.children = await that.getChildData(item);
item.loading = false; item.loading = false;
} */ } */
that.$emit('getSelectData', item); if (item.hasRight) {
that.$emit('getSelectData', item);
}
}, },
/** /**
* 获取下级数据 * 获取下级数据
......
...@@ -61,6 +61,9 @@ export default { ...@@ -61,6 +61,9 @@ 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.storeTypes.every(el => this.selectedTypes.includes(el.value))) {
return callback(new Error('一种门店类型仅能包含在一个特殊策略中,当前所有门店类型已被其它特殊策略占用,无法创建'));
}
if (data.length == 0) { if (data.length == 0) {
return callback(new Error('请选择门店类型')); return callback(new Error('请选择门店类型'));
} }
...@@ -110,9 +113,6 @@ export default { ...@@ -110,9 +113,6 @@ export default {
errMsg.errorMsg(res.data); errMsg.errorMsg(res.data);
return; return;
} }
this.$nextTick(() => {
this.rules.storeType.trigger = 'change';
});
// storeType = -1时为通用策略 // storeType = -1时为通用策略
// 通用策略不能修改门店类型 // 通用策略不能修改门店类型
if (this.myCustomData.storeType.includes('-1')) return; if (this.myCustomData.storeType.includes('-1')) return;
...@@ -127,6 +127,9 @@ export default { ...@@ -127,6 +127,9 @@ export default {
}, []); }, []);
this.myCustomData.storeType = this.myCustomData.storeType.concat(this.selectedTypes); this.myCustomData.storeType = this.myCustomData.storeType.concat(this.selectedTypes);
} }
this.$nextTick(() => {
this.rules.storeType.trigger = 'change';
});
}); });
}, },
onSave() { onSave() {
......
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